zoukankan      html  css  js  c++  java
  • Codeforces Round #357 (Div. 2) A

    A. A Good Contest
    time limit per test
    1 second
    memory limit per test
    256 megabytes
    input
    standard input
    output
    standard output

    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?

    Input

    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: the 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.

    Output

    Print «YES» (quotes for clarity), if Anton has performed good in the contest and «NO» (quotes for clarity) otherwise.

    Examples
    Input
    3
    Burunduk1 2526 2537
    BudAlNik 2084 2214
    subscriber 2833 2749
    Output
    YES
    Input
    3
    Applejack 2400 2400
    Fluttershy 2390 2431
    Pinkie_Pie -2500 -2450
    Output
    NO
    Note

    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.

    题意:存在红名(rate>=2400的)并且涨分的输出YES 否则输出NO

    题解:水题

     1 #include<iostream>
     2 #include<cstring>
     3 #include<cstdio>
     4 #include<algorithm>
     5 int n;
     6 char a[1000];
     7 int be,af;
     8 int  main()
     9 {
    10     scanf("%d",&n);
    11     int flag=0;
    12     getchar();
    13     for(int i=1;i<=n;i++)
    14     {
    15         scanf("%s %d %d",a,&be,&af);
    16         if(be>=2400&&af>be)
    17         flag=1;    
    18     }
    19     if(flag)
    20     printf("YES
    ");
    21     else
    22     printf("NO
    ");
    23     return 0;
    24  } 
  • 相关阅读:
    echarts的legend图例的显示与隐藏(legend折线图加载完页面显示的个数)
    程序员必备网站
    web前端兼容性问题总结
    sass
    JS 中的事件绑定、事件监听、事件委托是什么?
    格式化电话号码,并不像看到的那么简单
    机器学习之Javascript篇: k-Means 聚类算法介绍
    机器学习之Javascript篇:遗传算法(2)
    机器学习之Javascript篇:遗传算法介绍
    机器学习之Javascript篇: 近邻(k-nearest-neighbor) 算法介绍
  • 原文地址:https://www.cnblogs.com/hsd-/p/5612471.html
Copyright © 2011-2022 走看看