結果

問題 No.1338 Giant Class
ユーザー paruf4paruf4
提出日時 2021-01-15 22:15:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 788 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 24,240 KB
最終ジャッジ日時 2024-05-05 00:12:04
合計ジャッジ時間 9,590 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,880 KB
testcase_01 AC 27 ms
10,624 KB
testcase_02 AC 633 ms
10,880 KB
testcase_03 AC 26 ms
10,880 KB
testcase_04 AC 26 ms
10,880 KB
testcase_05 AC 27 ms
10,752 KB
testcase_06 AC 490 ms
17,388 KB
testcase_07 AC 619 ms
24,020 KB
testcase_08 AC 415 ms
17,260 KB
testcase_09 AC 401 ms
17,512 KB
testcase_10 AC 788 ms
24,188 KB
testcase_11 AC 100 ms
11,648 KB
testcase_12 AC 552 ms
17,260 KB
testcase_13 AC 419 ms
17,640 KB
testcase_14 AC 137 ms
12,544 KB
testcase_15 AC 204 ms
13,944 KB
testcase_16 AC 77 ms
11,648 KB
testcase_17 AC 419 ms
17,644 KB
testcase_18 AC 124 ms
12,416 KB
testcase_19 AC 235 ms
14,200 KB
testcase_20 AC 718 ms
24,240 KB
testcase_21 AC 709 ms
24,140 KB
testcase_22 AC 702 ms
23,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
h, w, q = map(int, input().split())
d = defaultdict(lambda: 10**18)
res = h*w
for i in range(q):
    y, x = map(int, input().split())
    if y < d[x]:
        if d[x] == 10**18:
            d[x] = y
            res -= h-d[x]+1
        else:
            res -= d[x]-y
            d[x] = y
    print(res)
0