結果

問題 No.853 河原の石
ユーザー lam6er
提出日時 2025-04-15 22:55:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 268 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 81,732 KB
実行使用メモリ 67,528 KB
最終ジャッジ日時 2025-04-15 22:57:25
合計ジャッジ時間 10,804 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other WA * 23 TLE * 3 -- * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
d = abs(W)
if H == 0 or d == 0:
    print(0)
else:
    total = 0
    for i in range(H):
        current_H = H - i
        if current_H >= d:
            total += 1
        else:
            total += 2 * (d - current_H)
    print(total)
0