結果

問題 No.1338 Giant Class
ユーザー ThetaTheta
提出日時 2022-10-14 17:54:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 618 ms / 2,000 ms
コード長 505 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 21,736 KB
最終ジャッジ日時 2023-09-08 19:47:26
合計ジャッジ時間 9,445 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,516 KB
testcase_01 AC 18 ms
8,452 KB
testcase_02 AC 536 ms
8,560 KB
testcase_03 AC 18 ms
8,420 KB
testcase_04 AC 18 ms
8,616 KB
testcase_05 AC 19 ms
8,424 KB
testcase_06 AC 383 ms
15,096 KB
testcase_07 AC 565 ms
21,680 KB
testcase_08 AC 360 ms
14,896 KB
testcase_09 AC 343 ms
14,984 KB
testcase_10 AC 609 ms
21,660 KB
testcase_11 AC 73 ms
9,324 KB
testcase_12 AC 434 ms
15,024 KB
testcase_13 AC 351 ms
14,972 KB
testcase_14 AC 109 ms
10,084 KB
testcase_15 AC 151 ms
11,668 KB
testcase_16 AC 63 ms
9,304 KB
testcase_17 AC 355 ms
14,948 KB
testcase_18 AC 108 ms
9,984 KB
testcase_19 AC 176 ms
11,720 KB
testcase_20 AC 615 ms
21,736 KB
testcase_21 AC 604 ms
21,668 KB
testcase_22 AC 618 ms
21,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


def main():
    H, W, Q = map(int, input().split())
    rest_sheets = H * W
    most_front_other_students = defaultdict(lambda: H + 1)
    for _ in range(Q):
        y, x = map(int, input().split())
        if most_front_other_students[x] < y:
            print(rest_sheets)
        else:
            rest_sheets -= (most_front_other_students[x] - y)
            most_front_other_students[x] = y
            print(rest_sheets)


if __name__ == "__main__":
    main()
0