Tourist likes

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.

 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 (airepresents the change in rating in the ith contest where 0 ≤ i < N)

 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.

 

Input

3
5 2000
100 100 100 100 100
2 1600
100 5
3 100
100 -1800 300

Output

Correct
Bug
Correct
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    int t, n, r, x;
    cin >> t;
    while(t--)
    {
        cin >> n >> r;
        int sum = 1500;
        for(int i = 0 ; i < n; i++)
        {
            cin >> x;
            sum += x;
        }
        if(sum == r)
            cout << "Correct" << endl;
        else
            cout << "Bug" << endl;
    }
    return 0;
}

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值