AtCoder Beginner Contest 062

Submission #1387457

Source codeソースコード

# -*- 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

Task問題 C - Chocolate Bar
User nameユーザ名 はむこ
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 AC
Score得点 400
Source lengthソースコード長 402 Byte
File nameファイル名
Exec time実行時間 1089 ms
Memory usageメモリ使用量 14404 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - 0_00.txt,0_01.txt,0_02.txt,0_03.txt,0_04.txt
All 400 / 400 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
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