Submission #3603337


Source Code Expand

h,w=map(int,input().split())
s=[]
for i in range(1,h):
    a=max(i*w,((h-i)*(w//2)),w*(h-i)//2)
    b=min(i*w,((h-i)*(w//2)),w*(h-i)//2)
    s.append((abs(a-b)))
for j in range(1,w):
    a=max(h*j,(h//2)*(w-j),h*((w-j)//2))
    b=min(h*j,(h//2)*(w-j),h*((w-j)//2))
    s.append(abs(a-b))
print(min(s))

Submission Info

Submission Time
Task C - Chocolate Bar
User shel
Language Python (3.4.3)
Score 0
Code Size 311 Byte
Status WA
Exec Time 304 ms
Memory 11032 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 4
WA × 1
AC × 13
WA × 7
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt
Case Name Status Exec Time Memory
0_00.txt WA 17 ms 3064 KB
0_01.txt AC 17 ms 3064 KB
0_02.txt AC 18 ms 3064 KB
0_03.txt AC 161 ms 7084 KB
0_04.txt AC 304 ms 11032 KB
1_00.txt AC 18 ms 3064 KB
1_01.txt AC 163 ms 7032 KB
1_02.txt AC 124 ms 6216 KB
1_03.txt WA 155 ms 6940 KB
1_04.txt WA 104 ms 5416 KB
1_05.txt WA 187 ms 7692 KB
1_06.txt AC 262 ms 10012 KB
1_07.txt AC 159 ms 6972 KB
1_08.txt AC 162 ms 7236 KB
1_09.txt AC 196 ms 7964 KB
1_10.txt WA 254 ms 9548 KB
1_11.txt AC 113 ms 5692 KB
1_12.txt WA 230 ms 8820 KB
1_13.txt AC 161 ms 7104 KB
1_14.txt WA 96 ms 5348 KB