結果

問題 No.84 悪の算盤
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-04-16 16:49:00
言語 Python2
(2.7.18)
結果
AC  
実行時間 14 ms / 5,000 ms
コード長 928 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-21 10:01:41
合計ジャッジ時間 1,065 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,812 KB
testcase_01 AC 14 ms
6,940 KB
testcase_02 AC 13 ms
6,944 KB
testcase_03 AC 14 ms
6,944 KB
testcase_04 AC 13 ms
6,944 KB
testcase_05 AC 14 ms
6,940 KB
testcase_06 AC 14 ms
6,940 KB
testcase_07 AC 14 ms
6,940 KB
testcase_08 AC 13 ms
6,940 KB
testcase_09 AC 13 ms
6,940 KB
testcase_10 AC 14 ms
6,940 KB
testcase_11 AC 13 ms
6,940 KB
testcase_12 AC 14 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
# -*- coding: utf-8 -*-
# †
# (ΦωΦ)<
# 実世界にはないそろばんの考え方なので考えづらい。
# 「回転しても同じとみなす」というのは90度, 180度, 270度の回転のこと。
# 180度の回転のことだけではないことに注意。この辺の言及がほしい。
#
# どのセルを「珠がないセル」にするかを決める場合の数はR*C通り。
# 回転しても同じ数を表現する必要があるので2または4で割る必要がある。
# RとCが同じときは正方形なので4で割る。そうでなければ長方形なので2で割る。
#
# R*Cが奇数のとき(RもCも奇数のとき)は、
# 真ん中に珠がないときは回転しても同じ位置に珠がないことになるので
# 数えるときに重複させる必要がある。
R, C = map(int, raw_input().split())
d = 4 if R == C else 2
print (R * C - 1) / d
0