Submission #1387457
Source Code Expand
# -*- coding: utf-8 -*- import math import sys import itertools import numpy as np h, w = map(int, input().split()) m = 10000000000000000000000000 m = min(m, (1 if h % 3 else 0) * w) m = min(m, (1 if w % 3 else 0) * h) for _ in range(2): for i in range(1, h+1): v = np.array([i*w, w//2*(h-i), (w-w//2)*(h-i)]) m = min(m, max(v) - min(v)) h, w = w, h print(m)
Submission Info
Submission Time | |
---|---|
Task | C - Chocolate Bar |
User | hamko |
Language | Python (3.4.3) |
Score | 400 |
Code Size | 402 Byte |
Status | AC |
Exec Time | 1089 ms |
Memory | 14404 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 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 | AC | 148 ms | 12500 KB |
0_01.txt | AC | 148 ms | 12500 KB |
0_02.txt | AC | 149 ms | 12500 KB |
0_03.txt | AC | 641 ms | 12504 KB |
0_04.txt | AC | 1089 ms | 12500 KB |
1_00.txt | AC | 149 ms | 12500 KB |
1_01.txt | AC | 608 ms | 12500 KB |
1_02.txt | AC | 553 ms | 12500 KB |
1_03.txt | AC | 685 ms | 12504 KB |
1_04.txt | AC | 462 ms | 14404 KB |
1_05.txt | AC | 693 ms | 12500 KB |
1_06.txt | AC | 1070 ms | 12496 KB |
1_07.txt | AC | 702 ms | 12504 KB |
1_08.txt | AC | 623 ms | 12504 KB |
1_09.txt | AC | 800 ms | 12500 KB |
1_10.txt | AC | 893 ms | 12504 KB |
1_11.txt | AC | 498 ms | 12496 KB |
1_12.txt | AC | 916 ms | 14404 KB |
1_13.txt | AC | 581 ms | 12372 KB |
1_14.txt | AC | 402 ms | 12500 KB |