結果

問題 No.1603 Manhattan Social Distance
ユーザー lam6er
提出日時 2025-03-20 18:44:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 82,968 KB
実行使用メモリ 53,412 KB
最終ジャッジ日時 2025-03-20 18:45:09
合計ジャッジ時間 1,760 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

N, H, W = map(int, input().split())

def calculate_contribution(L, n):
    if L == 1:
        return 0
    k = n // 2
    m = n - k
    return k * m * (L - 1)

total = calculate_contribution(H, N) + calculate_contribution(W, N)
print(total)
0