A8210 | Choosing Laptop
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Vasya is choosing a laptop. The shop has $n$ laptops to all tastes.
Vasya is interested in the following properties: processor speed, ram and hdd. Vasya is a programmer and not a gamer which is why he is not interested in all other properties.
If all three properties of a laptop are strictly less than those properties of some other laptop, then the first laptop is considered outdated by Vasya. Among all laptops Vasya does not consider outdated, he chooses the cheapest one.
There are very many laptops, which is why Vasya decided to write a program that chooses the suitable laptop. However, Vasya doesn't have his own laptop yet and he asks you to help him.
Vasya is interested in the following properties: processor speed, ram and hdd. Vasya is a programmer and not a gamer which is why he is not interested in all other properties.
If all three properties of a laptop are strictly less than those properties of some other laptop, then the first laptop is considered outdated by Vasya. Among all laptops Vasya does not consider outdated, he chooses the cheapest one.
There are very many laptops, which is why Vasya decided to write a program that chooses the suitable laptop. However, Vasya doesn't have his own laptop yet and he asks you to help him.
输入格式
The first line contains number $n$ ( $1<=n<=100$ ).
Then follow $n$ lines. Each describes a laptop as $speed$ $ram$ $hdd$ $cost$ . Besides,
- $speed$ , $ram$ , $hdd$ and $cost$ are integers
- $1000<=speed<=4200$ is the processor's speed in megahertz
- $256<=ram<=4096$ the RAM volume in megabytes
- $1<=hdd<=500$ is the HDD in gigabytes
- $100<=cost<=1000$ is price in tugriks
All laptops have different prices.
Then follow $n$ lines. Each describes a laptop as $speed$ $ram$ $hdd$ $cost$ . Besides,
- $speed$ , $ram$ , $hdd$ and $cost$ are integers
- $1000<=speed<=4200$ is the processor's speed in megahertz
- $256<=ram<=4096$ the RAM volume in megabytes
- $1<=hdd<=500$ is the HDD in gigabytes
- $100<=cost<=1000$ is price in tugriks
All laptops have different prices.
输出格式
Print a single number — the number of a laptop Vasya will choose. The laptops are numbered with positive integers from $1$ to $n$ in the order in which they are given in the input data.
输入输出样例
输入 #1
5 2100 512 150 200 2000 2048 240 350 2300 1024 200 320 2500 2048 80 300 2000 512 180 150
输出 #1
4
In the third sample Vasya considers the first and fifth laptops outdated as all of their properties cannot match those of the third laptop. The fourth one is the cheapest among the laptops that are left. Thus, Vasya chooses the fourth laptop.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted