結果

問題 No.1338 Giant Class
ユーザー wattaiheiwattaihei
提出日時 2021-01-15 22:17:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 257 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 21,472 KB
最終ジャッジ日時 2023-08-17 17:32:05
合計ジャッジ時間 5,313 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,980 KB
testcase_01 AC 15 ms
7,816 KB
testcase_02 AC 207 ms
7,804 KB
testcase_03 AC 15 ms
7,840 KB
testcase_04 AC 15 ms
7,840 KB
testcase_05 AC 16 ms
7,900 KB
testcase_06 AC 165 ms
14,724 KB
testcase_07 AC 226 ms
21,400 KB
testcase_08 AC 153 ms
14,660 KB
testcase_09 AC 150 ms
14,668 KB
testcase_10 AC 254 ms
21,472 KB
testcase_11 AC 38 ms
8,872 KB
testcase_12 AC 191 ms
14,612 KB
testcase_13 AC 148 ms
14,580 KB
testcase_14 AC 52 ms
9,836 KB
testcase_15 AC 70 ms
11,364 KB
testcase_16 AC 33 ms
9,024 KB
testcase_17 AC 153 ms
14,572 KB
testcase_18 AC 51 ms
9,784 KB
testcase_19 AC 77 ms
11,472 KB
testcase_20 AC 257 ms
21,460 KB
testcase_21 AC 253 ms
21,412 KB
testcase_22 AC 257 ms
21,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline

H, W, Q = map(int, input().rstrip().split())
dic = {}
ans = H*W
for _ in range(Q):
    y, x = map(int, input().rstrip().split())
    y -= 1; x -= 1
    d = dic.get(x, H)
    if d > y:
        ans -= (d-y)
        dic[x] = y
    print(ans)
0