結果

問題 No.1338 Giant Class
コンテスト
ユーザー 炭酸水
提出日時 2022-05-19 20:17:41
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 501 ms / 2,000 ms
+ 217µs
コード長 275 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,169 ms
コンパイル使用メモリ 21,284 KB
実行使用メモリ 28,340 KB
最終ジャッジ日時 2026-08-30 15:55:25
合計ジャッジ時間 9,592 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

h, w, q = map(int, input().split())
a = {}

ans = h * w
for _ in range(q):
    y, x = map(int, input().split())
    if a.get(x, -1) == -1:
        a[x] = y
        ans -= h - y + 1
    else:
        if a[x] > y:
            ans -= a[x] - y
            a[x] = y
    print(ans)
0