Submission #1643073


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int T; cin >> T;
    rep(i ,T) {
        int N, D;
        cin >> N >> D;
        if (N % 2 == 0) D ^= 127;
        cout << 127 * (N-1) + D << endl;
    }

    return 0;
}

Submission Info

Submission Time
Task C - Cookie Breeding Machine
User toame
Language C++14 (GCC 5.4.1)
Score 100
Code Size 517 Byte
Status AC
Exec Time 5 ms
Memory 892 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 6
Set Name Test Cases
All 00_sample.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt
Case Name Status Exec Time Memory
00_sample.txt AC 5 ms 892 KB
random_00.txt AC 3 ms 256 KB
random_01.txt AC 3 ms 256 KB
random_02.txt AC 3 ms 256 KB
random_03.txt AC 3 ms 256 KB
random_04.txt AC 3 ms 256 KB