結果
| 問題 | No.853 河原の石 | 
| コンテスト | |
| ユーザー |  lam6er | 
| 提出日時 | 2025-04-15 22:52:44 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 268 bytes | 
| コンパイル時間 | 229 ms | 
| コンパイル使用メモリ | 82,648 KB | 
| 実行使用メモリ | 66,552 KB | 
| 最終ジャッジ日時 | 2025-04-15 22:55:15 | 
| 合計ジャッジ時間 | 19,127 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | WA * 23 TLE * 3 -- * 31 | 
ソースコード
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)
            
            
            
        