Description

Tourist likes competitive programming and he has his own Codeforces account. He participated in lots of Codeforces Rounds, solved so many problems and became "Legendary Grand Master" (the highest rank on Codeforces). One day, he logged in to check his account. Something wrong happened: his name was in black, like he never participated in any Codeforces Rounds and his rating was incorrect. He received an e-mail from Mike Mirzayanov (the founder of the website), "we are very sorry for this mistake, everything will be fixed in few minutes" Mike said. Tourist is relaxed now. He decided to have some fun until the bug is fixed, he also would like to help the founders of the website to fix all the bugs, so he will select a random user on Codeforces, open his contests page and start to sum the rating changes. Finally, he will make sure the sum is equal to the final rating of this user. Note: when someone creates a new Codeforces account, the initial rating is 1500.

Input

The input consists of several test cases. The first line of the input contains a single integer T, the number of the test cases. Each test case starts with a single line containing two space-separated integers N and R: N is the number of rating changes and R is the final rating of the user. (1 ≤ N ≤ 100, 0 ≤ R ≤ 4000). The next line contains N space-separated integers a0, a1, ..., an - 1 where - 2000 ≤ ai ≤ 2000, 0 ≤ i < N (ai represents the change in rating in the ith contest where 0 ≤ i < N)

Output

For each test case, print a single line: "Correct" if the sum of rating changes (plus 1500) is equal to the final rating of the user and "Bug" otherwise.

Example
input
3
5 2000
100 100 100 100 100
2 1600
100 5
3 100
100 -1800 300
output
Correct
Bug
Correct 题意:我们有初始分1500,然后通过下面的加减分,能不能达到最终分数
解法:模拟
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int st,ed;
int num;
int sum=1500;
cin>>st>>ed;
for(int i=1;i<=st;i++)
{
cin>>num;
sum+=num;
}
if(sum==ed)
{
cout<<"Correct"<<endl;
}
else
{
cout<<"Bug"<<endl;
}
}
return 0;
}

  


2016 Al-Baath University Training Camp Contest-1 A的更多相关文章

  1. 2016 Al-Baath University Training Camp Contest-1

    2016 Al-Baath University Training Camp Contest-1 A题:http://codeforces.com/gym/101028/problem/A 题意:比赛 ...

  2. 2014-2015 Petrozavodsk Winter Training Camp, Contest.58 (Makoto rng_58 Soejima contest)

    2014-2015 Petrozavodsk Winter Training Camp, Contest.58 (Makoto rng_58 Soejima contest) Problem A. M ...

  3. 2016 Al-Baath University Training Camp Contest-1 E

    Description ACM-SCPC-2017 is approaching every university is trying to do its best in order to be th ...

  4. 2016 Al-Baath University Training Camp Contest-1 B

    Description A group of junior programmers are attending an advanced programming camp, where they lea ...

  5. 2016 Al-Baath University Training Camp Contest-1 J

    Description X is fighting beasts in the forest, in order to have a better chance to survive he's gon ...

  6. 2016 Al-Baath University Training Camp Contest-1 I

    Description It is raining again! Youssef really forgot that there is a chance of rain in March, so h ...

  7. 2016 Al-Baath University Training Camp Contest-1 H

     Description You've possibly heard about 'The Endless River'. However, if not, we are introducing it ...

  8. 2016 Al-Baath University Training Camp Contest-1 G

    Description The forces of evil are about to disappear since our hero is now on top on the tower of e ...

  9. 2016 Al-Baath University Training Camp Contest-1 F

    Description Zaid has two words, a of length between 4 and 1000 and b of length 4 exactly. The word a ...

随机推荐

  1. sdutoj 2152 Balloons

    http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2152 Balloons Time Limit: ...

  2. [原创]java WEB学习笔记83:Hibernate学习之路---双向 1-n介绍,关键点解释,代码实现,set属性介绍(inverse,cascade ,order-by )

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...

  3. php初探

    1.php中的连接符.可以连接多个字符串,相当于java中的+ 2.echo必须与后面的输出内容有至少一个空格 3.php编程中每个结尾都需要添加分号

  4. windows 下双网卡在不同网络切换设置

           首先你的机器需要有两块网卡,分别接到两台交换机上, ine rnet地址:192.168.1.8,子网掩码:255.255.255.0,网关:192.168.1.1 内部网地址:172. ...

  5. [php笔记]项目开发五个阶段/雇员管理系统

    zend 公司,管理PHP版本的升级. 功能强大, 官方推荐. (开发一个PHP项目) 软件开发的五个阶段. 1.创建一个项目(工程)2.设置该项目的路径3.创建一个文件test.php ***使用Z ...

  6. memcached +php环境配置和分析

    一.memcached 简介 在很多场合,我们都会听到 memcached 这个名字,但很多同学只是听过,并没有用过或实际了解过,只知道它是一个很不错的东东.这里简单介绍一下,memcached 是高 ...

  7. 向已写好的多行插入sql语句中添加字段和值

    #region 添加支款方式--向已写好的多行插入sql语句中添加字段和值 public int A_ZhifuFS(int diqu) { ; string strData = @"SEL ...

  8. Hadoop实战3:MapReduce编程-WordCount统计单词个数-eclipse-java-ubuntu环境

    之前习惯用hadoop streaming环境编写python程序,下面总结编辑java的eclipse环境配置总结,及一个WordCount例子运行. 一 下载eclipse安装包及hadoop插件 ...

  9. android 学习随笔二十九(自定义监听 )

    package com.itheima.momo.dialog; import com.itheima.momo.R; import android.app.AlertDialog; import a ...

  10. 由于 add 运算符中“Chinese_PRC_CI_AS”和“Chinese_PRC_CS_AS_WS”之间的排序规则冲突

    有一个字段的排序规则是 Chinese_PRC_CS_AS_WS,字符串连接的时候报错. 处理方案 cast(columnName as varbinary) 即可