結果

問題 No.1603 Manhattan Social Distance
ユーザー rin204
提出日時 2021-07-16 21:25:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 332 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 53,612 KB
最終ジャッジ日時 2024-07-06 08:14:48
合計ジャッジ時間 1,265 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 4
権限があれば一括ダウンロードができます

ソースコード

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