結果

問題 No.84 悪の算盤
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-01-19 22:11:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 306 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 71,568 KB
最終ジャッジ日時 2023-08-15 08:12:46
合計ジャッジ時間 2,002 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,476 KB
testcase_01 AC 77 ms
71,440 KB
testcase_02 AC 74 ms
71,356 KB
testcase_03 AC 73 ms
71,164 KB
testcase_04 AC 74 ms
71,260 KB
testcase_05 AC 72 ms
71,332 KB
testcase_06 AC 74 ms
71,296 KB
testcase_07 AC 73 ms
71,420 KB
testcase_08 AC 72 ms
71,492 KB
testcase_09 AC 73 ms
71,196 KB
testcase_10 AC 71 ms
71,352 KB
testcase_11 AC 72 ms
71,548 KB
testcase_12 AC 73 ms
71,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

r,c = map(int,input().split())

if r == c:
    if r%2:
        print((r+1)//2*(c+1)//2-1-r//2)
    else:
        print(r//2*c//2-1)

else:
    if r%2 == 0 and c %2 == 0:
        print(r*c//2-1)
    elif r%2 and c%2:
        print(max((r+1)//2*c-c//2-1,(c+1)//2*r-r//2-1))

    else:
        print(r*c//2-1)
0