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

    A. A Good Contest

    题目连接:

    http://www.codeforces.com/contest/681/problem/A

    Description

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

    Sample Input

    3
    Burunduk1 2526 2537
    BudAlNik 2084 2214
    subscriber 2833 2749

    Sample Output

    YES

    Hint

    题意

    有n个人,给你这个人的名字,这个人比赛前的分数,比赛后的分数

    如果存在一个人之前的分数>=2400,且还涨分了

    那就输出yes

    题解:

    按照题意模拟一下就好了

    代码

    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        int n;
        scanf("%d",&n);
        string s1;
        int a,b;
        int flag = 0;
        for(int i=0;i<n;i++)
        {
            cin>>s1>>a>>b;
            if(a>=2400&&b>a)
                flag = 1;
        }
        if(flag==1)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
  • 相关阅读:
    在linux上通过docker运行容器,通过docker搭建jenkens环境
    linux jdk 安装报错
    UEditor 后台配置项返回格式出错,上传功能将不能正常使用!
    spring boot 项目 freemarker 无法加载static 中 js css 文件 原因(报错404)
    windows mongodb 添加用户
    window连接本地mongodb 报错 mongodb shell was not initiallized
    Zookeeper(四) 客户端shell命令
    Zookeeper(三) 集群搭建
    Zookeeper(二) 安装及配置
    Zookeeper(一) 入门
  • 原文地址:https://www.cnblogs.com/qscqesze/p/5586148.html
Copyright © 2011-2022 走看看