結果

問題 No.1338 Giant Class
ユーザー kozykozy
提出日時 2021-01-15 21:52:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 376 ms / 2,000 ms
コード長 246 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 87,840 KB
最終ジャッジ日時 2023-08-17 16:50:46
合計ジャッジ時間 7,369 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,352 KB
testcase_01 AC 74 ms
71,408 KB
testcase_02 AC 332 ms
77,528 KB
testcase_03 AC 76 ms
71,416 KB
testcase_04 AC 78 ms
71,312 KB
testcase_05 AC 85 ms
75,216 KB
testcase_06 AC 276 ms
85,032 KB
testcase_07 AC 346 ms
86,180 KB
testcase_08 AC 265 ms
84,900 KB
testcase_09 AC 259 ms
84,296 KB
testcase_10 AC 374 ms
87,764 KB
testcase_11 AC 135 ms
78,984 KB
testcase_12 AC 301 ms
83,108 KB
testcase_13 AC 262 ms
84,792 KB
testcase_14 AC 150 ms
79,744 KB
testcase_15 AC 168 ms
81,148 KB
testcase_16 AC 131 ms
78,724 KB
testcase_17 AC 260 ms
84,884 KB
testcase_18 AC 149 ms
79,828 KB
testcase_19 AC 179 ms
82,112 KB
testcase_20 AC 373 ms
87,836 KB
testcase_21 AC 376 ms
87,744 KB
testcase_22 AC 369 ms
87,840 KB
権限があれば一括ダウンロードができます

ソースコード

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