Submission #1819980


Source Code Expand

#include <bits/stdc++.h>

using namespace std;
long q,n,d;
int a[8];
void np(long & n,long i)
{
    if(n>=pow(2,i-1)) {
        a[i]=1;
        n=n-pow(2,i);
    }
    else a[i]=0;
}
int main()
{
    cin>>q;
    while(q--)
    {
        cin>>n>>d;
        if(n%2==1) cout<<(n-1)*127+d;
        else{
        long cc=(d^127);
        cout<<(n-1)*127+cc;

    }
    cout<<endl;
    }



}

Submission Info

Submission Time
Task C - Cookie Breeding Machine
User vjudge4
Language C++14 (GCC 5.4.1)
Score 100
Code Size 387 Byte
Status AC
Exec Time 3 ms
Memory 256 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 1 ms 256 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