Submission #3588306


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:
        tmp = 0
        for a in range(128):
            tmp = max(tmp, a + a^d)
        return tmp - d + 127*(n-2)

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 0
Code Size 308 Byte
Status WA
Exec Time 38 ms
Memory 3316 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 1
WA × 5
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 17 ms 3060 KB
random_00.txt WA 38 ms 3316 KB
random_01.txt WA 35 ms 3316 KB
random_02.txt WA 38 ms 3316 KB
random_03.txt WA 35 ms 3316 KB
random_04.txt WA 34 ms 3316 KB