Codeforces Round #357 (Div. 2) A. A Good Contest
来源:互联网 发布:pp助手苹果mac 编辑:程序博客网 时间:2024/05/14 12:14
题目链接:http://codeforces.com/contest/681/problem/A
Codeforces user' handle color depends on his rating — it is red if his rating is greater or equal to 2400; it is orange if his rating is less than 2400 but greater or equal to 2200, etc. Each time participant takes part in a rated contest, his rating is changed depending on his performance.
Anton wants the color of his handle to become red. He considers his performance in the rated contest to be good if he outscored some participant, whose handle was colored red before the contest and his rating has increased after it.
Anton has written a program that analyses contest results and determines whether he performed good or not. Are you able to do the same?
The first line of the input contains a single integer n (1 ≤ n ≤ 100) — the number of participants Anton has outscored in this contest .
The next n lines describe participants results: i-th} of them consists of a participant handle namei and two integers beforei and afteri( - 4000 ≤ beforei, afteri ≤ 4000) — participant's rating before and after the contest, respectively. Each handle is a non-empty string, consisting of no more than 10 characters, which might be lowercase and uppercase English letters, digits, characters «_» and «-» characters.
It is guaranteed that all handles are distinct.
Print «YES» (quotes for clarity), if Anton has performed good in the contest and «NO» (quotes for clarity) otherwise.
3Burunduk1 2526 2537BudAlNik 2084 2214subscriber 2833 2749
YES
3Applejack 2400 2400Fluttershy 2390 2431Pinkie_Pie -2500 -2450
NO
In the first sample, Anton has outscored user with handle Burunduk1, whose handle was colored red before the contest and his rating has increased after the contest.
In the second sample, Applejack's rating has not increased after the contest, while both Fluttershy's and Pinkie_Pie's handles were not colored red before the contest.
题意
一共有n个人。
接下来给你每个人的名字,他比赛前的分数,比赛后的分数。
如果存在任意一个人之前的分数>=2400(即红名),且还涨分了,那就输出YES,否则输出NO。
代码
#include <stdio.h>int main(){ int n,a,x,y,flag; char z[15]; flag=0; scanf("%d",&n); for(a=0;n>a;a++){ scanf("%s%d%d",&z,&x,&y); if(x>=2400&&y>=2400&&y>x&&flag==0){ flag=1; } } if(flag==1){ printf("YES\n"); } else{ printf("NO\n"); } return 0;}
- Codeforces Round #357 (Div. 2) A. A Good Contest
- Codeforces Round #357 (Div. 2) A. A Good Contest
- Codeforces-Round-#357-(Div.-2)-A-Good-Contest
- Codeforces Round #357 (Div. 2) A Good Contest(水题)
- contest: Codeforces Round #301 (Div. 2), problem: (A) Combination Lock
- contest: Codeforces Round #303 (Div. 2), problem: (A) Toy Cars
- [水题]Codeforces Round #307 (Div. 2) A.GukiZ and Contest
- Codeforces Round #307 (Div. 2) A. GukiZ and Contest
- Codeforces Round #442 (Div. 2) A. Alex and broken contest
- Codeforces Round #442 (Div. 2) A Alex and broken contest
- Codeforces Round #442 (Div. 2) A. Alex and broken contest
- CodeForces - 681A A Good Contest
- CodeForces 681A A Good Contest
- codeforces 681A A Good Contest
- contest: Codeforces Round #307 (Div. 2), problem: (A) GukiZ and Contest
- A. A Good Contest
- Codeforces Round #307 (Div. 2) A. GukiZ and Contest (暴力)
- A. GukiZ and Contest-Codeforces Round #307 (Div. 2)-简单水题
- HashMap摘抄
- Android中利用Fragment同时支持屏幕和手机
- Java四种线程池的使用
- First Bad Version - Javascript
- MySQL命令大全
- Codeforces Round #357 (Div. 2) A. A Good Contest
- 页面跳转传参后台乱码的问题
- NEUOJ 711 (字典树)
- 2016年06月14日学习日记c语言结构体
- 画空心圆
- 支持向量机SVM原理篇
- 根据当前日期获取本周日期
- spring mvc 静态资源配置
- Zend Studio 12.5.1 破解、注册码