Submission #10919313


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define MOD 1000000007
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=0,n=0,d=0,ans=0;
    cin>>t;
    while(t--)
    {
        cin>>n>>d;
        ans=(n-1)*127;
        if(n%2==0)
            ans+=127-d;
        else
            ans+=d;
        cout<<ans<<endl;
    }
}

Submission Info

Submission Time
Task C - Cookie Breeding Machine
User Prabhi
Language C++14 (GCC 5.4.1)
Score 100
Code Size 418 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