結果

問題 No.1338 Giant Class
ユーザー LignanLignan
提出日時 2021-07-09 12:01:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 682 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 21,748 KB
最終ジャッジ日時 2023-09-14 06:24:49
合計ジャッジ時間 11,250 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,484 KB
testcase_01 AC 19 ms
8,544 KB
testcase_02 AC 588 ms
8,384 KB
testcase_03 AC 19 ms
8,580 KB
testcase_04 AC 20 ms
8,496 KB
testcase_05 AC 20 ms
8,592 KB
testcase_06 AC 426 ms
15,052 KB
testcase_07 AC 618 ms
21,748 KB
testcase_08 AC 403 ms
15,000 KB
testcase_09 AC 379 ms
15,076 KB
testcase_10 AC 670 ms
21,580 KB
testcase_11 AC 79 ms
9,320 KB
testcase_12 AC 484 ms
15,084 KB
testcase_13 AC 391 ms
14,888 KB
testcase_14 AC 120 ms
10,020 KB
testcase_15 AC 167 ms
11,680 KB
testcase_16 AC 69 ms
9,260 KB
testcase_17 AC 400 ms
15,028 KB
testcase_18 AC 116 ms
9,964 KB
testcase_19 AC 197 ms
11,656 KB
testcase_20 AC 679 ms
21,648 KB
testcase_21 AC 682 ms
21,700 KB
testcase_22 AC 669 ms
21,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

h,w,q=map(int,input().split())
d=defaultdict(lambda: h+1)

cnt=h*w

for i in range(q):
    y,x=map(int,input().split())
    if y<=d[x]:
        cnt-=d[x]-y
        d[x]=y
        print(cnt)
    else:
        print(cnt)
        




0