結果

問題 No.1338 Giant Class
ユーザー H20
提出日時 2021-01-15 21:56:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 353 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 86,024 KB
最終ジャッジ日時 2024-11-26 14:27:40
合計ジャッジ時間 6,295 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
H,W,Q = map(int, input().split())
d = defaultdict(lambda: H)
ans = H*W
for i in range(Q):
    Y,X = map(int, input().split())
    if d[X]>=Y:
        ans -= d[X]-Y+1
        d[X]= Y-1
    print(ans)
0