CF106B.Choosing Laptop

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

瓦西娅正在挑选一台笔记本电脑。商店里有 nn 台笔记本电脑,款式各异,能满足各种需求。

瓦西娅只关心以下三个参数:处理器速度、内存(RAM)和硬盘(HDD)容量。作为一名程序员而非游戏玩家,他对其他所有参数均不感兴趣。

若某台笔记本电脑的上述三个参数均严格小于另一台笔记本电脑的对应参数,则瓦西娅认为这台笔记本电脑已经过时。在所有未被瓦西娅视为过时的笔记本电脑中,他将选择价格最便宜的一台。

由于笔记本电脑数量极多,瓦西娅决定编写一个程序来自动选出合适的笔记本电脑。然而,瓦西娅目前还没有自己的笔记本电脑,因此他请求你帮助他完成这一任务。

输入格式

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.

第一行包含一个整数 nn(1≤n≤1001 \leq n \leq 100)。

接下来有 nn 行,每行描述一台笔记本电脑,格式为:speed ram hdd cost。此外,

  • speed、ram、hdd 和 cost 均为整数;
  • 1000≤speed≤42001000 \leq \text{speed} \leq 4200,表示处理器主频(单位:兆赫兹);
  • 256≤ram≤4096256 \leq \text{ram} \leq 4096,表示内存容量(单位:兆字节);
  • 1≤hdd≤5001 \leq \text{hdd} \leq 500,表示硬盘容量(单位:吉字节);
  • 100≤cost≤1000100 \leq \text{cost} \leq 1000,表示价格(单位:图格里克)。

所有笔记本电脑的价格互不相同。

输出格式

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 到 nn 的正整数编号。

输入输出样例

  • 输入#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.

在第三个样例中,Vasya 认为第一台和第五台笔记本电脑已过时,因为它们的所有属性均无法与第三台笔记本电脑相匹配。剩余笔记本电脑中,第四台最便宜。因此,Vasya 选择第四台笔记本电脑。

输入解题思路,AI测评打分。不知道怎么写?

首页