Submission #3603394
Source Code Expand
h,w=map(int,input().split()) s=[] for i in range(1,h): a=max(i*w,(h-i)*((w+1)//2)) b=min(i*w,(h-i)*(w//2)) s.append(abs(a-b)) a=max(i*w,w*(h-i+1)//2) b=min(i*w,w*(h-i)//2) s.append(abs(a-b)) for j in range(1,w): a=max(h*j,(h+1)//2*(w-j)) b=min(h*j,(h//2)*(w-j)) s.append(abs(a-b)) a=max(h*j,h*(w-j+1)//2) b=min(h*j,h*(w-j)//2) print(min(s))
Submission Info
Submission Time | |
---|---|
Task | C - Chocolate Bar |
User | shel |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 399 Byte |
Status | WA |
Exec Time | 450 ms |
Memory | 14932 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||||
Status |
|
|
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 | WA | 17 ms | 3064 KB |
0_03.txt | AC | 229 ms | 11000 KB |
0_04.txt | AC | 450 ms | 14932 KB |
1_00.txt | AC | 17 ms | 3064 KB |
1_01.txt | AC | 224 ms | 7016 KB |
1_02.txt | AC | 181 ms | 7416 KB |
1_03.txt | WA | 221 ms | 8696 KB |
1_04.txt | WA | 146 ms | 6452 KB |
1_05.txt | AC | 263 ms | 9812 KB |
1_06.txt | AC | 379 ms | 13632 KB |
1_07.txt | AC | 221 ms | 8288 KB |
1_08.txt | AC | 231 ms | 8684 KB |
1_09.txt | WA | 279 ms | 11236 KB |
1_10.txt | AC | 359 ms | 12300 KB |
1_11.txt | AC | 153 ms | 6420 KB |
1_12.txt | WA | 332 ms | 12472 KB |
1_13.txt | AC | 227 ms | 9596 KB |
1_14.txt | AC | 134 ms | 6216 KB |