結果

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

ソースコード

diff #

H,W,Q=map(int,input().split())
c=dict()
ans=H*W
for i in range(Q):
    Y,X=map(int,input().split())
    if X-1 in c:
        if c[X-1]>Y:
            ans-=c[X-1]-Y
            c[X-1]=Y
    else:
        ans-=H+1-Y
        c[X-1]=Y
    print(ans)
0