Codeforces Choosing Laptop 题解
这题实在是太水了,具体看注释
蒟蒻的方法是一边找过时的电脑一边比大小
蒟蒻不才,只会C++
其实还会free basic,但它已经过时了
附:
希望蒟蒻的题解能对看官有帮助
别忘记点赞+关注,谢谢!
Code: (C++)
#include <bits/stdc++.h>
using namespace std;
const int N=;
int c[N],s[N],r[N],h[N];
int main() {
int n;
cin>>n;
int minn=,ans;
for(int i=;i<=n;i++) cin>>s[i]>>r[i]>>h[i]>>c[i];//注意:最后才输入cost
for(int i=;i<=n;i++) {
bool bad=;//一个判断是否过时的bool
for(int j=;j<=n;j++) {
if(s[i]<s[j] && r[i]<r[j] && h[i]<h[j]) bad=;//过时了
}
if(!bad) { //如果没有过时,那么和最minn中的价格作比较
if(c[i]<minn) {
minn=c[i];
ans=i;
}
}
}
cout<<ans<<endl;
return ;
}
Codeforces Choosing Laptop 题解的更多相关文章
- Codeforces Round #556 题解
Codeforces Round #556 题解 Div.2 A Stock Arbitraging 傻逼题 Div.2 B Tiling Challenge 傻逼题 Div.1 A Prefix S ...
- Codeforces Round #569 题解
Codeforces Round #569 题解 CF1179A Valeriy and Deque 有一个双端队列,每次取队首两个值,将较小值移动到队尾,较大值位置不变.多组询问求第\(m\)次操作 ...
- Codeforces Round #557 题解【更完了】
Codeforces Round #557 题解 掉分快乐 CF1161A Hide and Seek Alice和Bob在玩捉♂迷♂藏,有\(n\)个格子,Bob会检查\(k\)次,第\(i\)次检 ...
- CFEducational Codeforces Round 66题解报告
CFEducational Codeforces Round 66题解报告 感觉丧失了唯一一次能在CF上超过wqy的机会QAQ A 不管 B 不能直接累计乘法打\(tag\),要直接跳 C 考虑二分第 ...
- codeforces CF475 ABC 题解
Bayan 2015 Contest Warm Up http://codeforces.com/contest/475 A - Bayan Bus B - Strongly Connected Ci ...
- Codeforces Round #542 题解
Codeforces Round #542 abstract I决策中的独立性, II联通块染色板子 IIIVoronoi diagram O(N^2 logN) VI环上距离分类讨论加取模,最值中的 ...
- Codeforces-Educational Codeforces Round 53题解
写之前,先发表下感慨:好久没写题解了,也许是因为自己越来越急利了,也可以说是因为越来越懒了. A. Diverse Substring 直接找一找有没有相邻的两个不同的字符即可. B. Vasya a ...
- Codeforces 381 简要题解
做的太糟糕了...第一题看成两人都取最优策略,写了个n^2的dp,还好pre-test良心(感觉TC和CF的pretest还是很靠谱的),让我反复过不去,仔细看题原来是取两边最大的啊!!!前30分钟就 ...
- Codeforces 863 简要题解
文章目录 A题 B题 C题 D题 E题 F题 G题 传送门 简要题解?因为最后一题太毒不想写了所以其实是部分题解... A题 传送门 题意简述:给你一个数,问你能不能通过加前导000使其成为一个回文数 ...
随机推荐
- MySQL Workbench: mysqldump version mismatch
Windows10 64bit系统下,步骤就是: Edit --> preferences --> Administrator --> Path to mysqldump tool: ...
- mysql(8.0.16)安装及使用注意事项
1.安装地址:https://dev.mysql.com/downloads/mysql/ 2.在安装路径:D:\mysql\mysql-8.0.16-winx64(安装时的路径,可自己选择)下面新建 ...
- 【25.93%】【676D】Theseus and labyrinth
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- python类方法、类属性和静态方法
class Game(object): #类属性 num = 0 #实例方法 def __init__(self): #实例属性 self.name = "laowang" #类方 ...
- Adam Harley的卷积神经网络3D视觉化模型
https://m.huxiu.com/article/138857/1.html 最近 Google Tensorflow 做了一个非常直观的神经网络 playground.不夸张地说,现在每个人都 ...
- 【原创】(十四)Linux内存管理之page fault处理
背景 Read the fucking source code! --By 鲁迅 A picture is worth a thousand words. --By 高尔基 说明: Kernel版本: ...
- 将 Sidecar 容器带入新的阶段
作者 | 徐迪.张晓宇 导读:本文根据徐迪和张晓宇在 KubeCon NA 2019 大会分享整理.分享将会从以下几个方面进行切入:首先会简单介绍一下什么是 Sidecar 容器:其次,会分享几个阿里 ...
- 王雅超的学习笔记-大数据hadoop集群部署(七)
MySQL的安装部署
- eclipse中如何配置jdk
1.在eclipse的上方打开Windows这个选项,选择Preferences==>Java==>Installed JREs 2.然后选择Add==>Standard VM==& ...
- windows7下mysql8.0.18部署安装
一.前期准备(windows7+mysql-8.0.18-winx64) 1.下载地址:https://dev.mysql.com/downloads/ 2.选择直接下载不登录账号,下载的压缩包大概两 ...