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. .net开发之我见,or实现 最简 优化法。knock out type convert 与我之简化orm的实现原理及实现细则,最简化开发法

    现在的.net or构架,大家认同的各种大大小小,ef,subsonic,nhibernate,甚至小一些的petapoco这种,但用过的人我想他们考虑的是比较多. 小一些的Petapoco也有几千行 ...

  2. jquery 实现ajax 上传文件的功能(使用插件 ajaxfileupload)

    js文件的下载地址 : http://files.cnblogs.com/wangqc/ajaxfileupload.js 页面代码: <html>    <!-- 引入相关的js文 ...

  3. android 添加背景音乐

    MediaPlayer mediaPlayer=MediaPlayer.create(MainActivity.this,R.raw.qiji); mediaPlayer.start();

  4. 同时启动多个Tomcat

    一,修改配置文件server.xml的端口 C:\apache-tomcat-5.5.23-1\conf\server.xml用记事本什么的打开修改3个地方   第一: <Server port ...

  5. paper 90:人脸检测研究2015最新进展

    搜集整理了2004~2015性能最好的人脸检测的部分资料,欢迎交流和补充相关资料. 1:人脸检测性能 1.1 人脸检测测评 目前有两个比较大的人脸测评网站: 1:Face Detection Data ...

  6. 夺命雷公狗---Thinkphp----7之栏目配合Model的增删改查

    我们首先来写一个查: public function lists(){ $type = M('Type')->select(); $this -> assign('type',$type) ...

  7. linux设备驱动归纳总结(十三):1.触摸屏与ADC时钟【转】

    本文转载自:http://blog.chinaunix.net/uid-25014876-id-119723.html linux设备驱动归纳总结(十三):1.触摸屏与ADC时钟 xxxxxxxxxx ...

  8. TM1680的I2C的51例程

    搞到一个例程,虽然是51的, 但是我的ST版本也是用的模拟I2C, 分析一下吧: unsigned char i=0;TM1680start();  //I2C起始信号 TM1680SendByte( ...

  9. va_list/va_start/va_arg/va_end深入分析【转】

    转自:http://www.cnblogs.com/justinzhang/archive/2011/09/29/2195969.html va_list/va_start/va_arg/va_end ...

  10. 【原创】Nexus搭建Maven私服

    前言: 公司一般都有个自己的私服来管理各种jar包,原因大概有这么3个,分别是: 1.有的公司不能访问外网,只能通过私服来管理jar包和插件: 2.公司网速比较慢,通过公司的私服来获取jar包比较快: ...