結果

問題 No.1603 Manhattan Social Distance
ユーザー 👑 rin204rin204
提出日時 2021-07-16 21:25:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 332 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 71,452 KB
最終ジャッジ日時 2023-09-20 12:57:08
合計ジャッジ時間 2,678 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,236 KB
testcase_01 AC 71 ms
71,364 KB
testcase_02 AC 72 ms
71,372 KB
testcase_03 AC 70 ms
71,376 KB
testcase_04 AC 70 ms
71,188 KB
testcase_05 WA -
testcase_06 AC 71 ms
71,256 KB
testcase_07 AC 70 ms
71,184 KB
testcase_08 AC 70 ms
71,284 KB
testcase_09 AC 69 ms
71,384 KB
testcase_10 AC 71 ms
71,196 KB
testcase_11 AC 73 ms
71,372 KB
testcase_12 AC 72 ms
70,976 KB
testcase_13 AC 73 ms
71,264 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 72 ms
71,212 KB
testcase_17 AC 70 ms
71,380 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, h, w = map(int, input().split())

lst = []
for i in range(3, -1, -1):
    lst.append((n + i) // 4)
lst[1], lst[2] = lst[2], lst[1]

ans = 0
pos = [(1, 1), (h, 1), (1, w), (h, w)]
for i in range(4):
    for j in range(i + 1, 4):
        ans += lst[i] * lst[j] * (abs(pos[i][0] - pos[j][0]) + abs(pos[i][1] - pos[j][1]))
print(ans)
0