Submission #3588372


Source Code Expand

T = int(input())
ts = [tuple(map(int,input().split())) for i in range(T)]

def solve(n,d):
    if n%2:
        return d + 127*(n-1)
    else:
        return 127*n - d

for n,d in ts:
    print(solve(n,d))

Submission Info

Submission Time
Task C - Cookie Breeding Machine
User prd_xxx
Language Python (3.4.3)
Score 100
Code Size 214 Byte
Status AC
Exec Time 22 ms
Memory 3316 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 18 ms 2940 KB
random_00.txt AC 22 ms 3316 KB
random_01.txt AC 22 ms 3316 KB
random_02.txt AC 22 ms 3316 KB
random_03.txt AC 22 ms 3316 KB
random_04.txt AC 22 ms 3316 KB