結果

問題 No.1338 Giant Class
ユーザー tt
提出日時 2021-02-10 20:01:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 661 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 10,552 KB
実行使用メモリ 21,508 KB
最終ジャッジ日時 2023-09-22 15:53:08
合計ジャッジ時間 10,786 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,744 KB
testcase_01 AC 15 ms
7,972 KB
testcase_02 AC 624 ms
7,816 KB
testcase_03 AC 16 ms
7,796 KB
testcase_04 AC 16 ms
7,852 KB
testcase_05 AC 18 ms
7,820 KB
testcase_06 AC 417 ms
14,596 KB
testcase_07 AC 582 ms
21,308 KB
testcase_08 AC 386 ms
14,588 KB
testcase_09 AC 366 ms
14,608 KB
testcase_10 AC 649 ms
21,396 KB
testcase_11 AC 75 ms
9,024 KB
testcase_12 AC 471 ms
14,620 KB
testcase_13 AC 376 ms
14,724 KB
testcase_14 AC 111 ms
9,848 KB
testcase_15 AC 159 ms
11,460 KB
testcase_16 AC 64 ms
9,000 KB
testcase_17 AC 379 ms
14,584 KB
testcase_18 AC 109 ms
9,736 KB
testcase_19 AC 182 ms
11,348 KB
testcase_20 AC 644 ms
21,508 KB
testcase_21 AC 648 ms
21,344 KB
testcase_22 AC 661 ms
21,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W, Q = map(int, input().split())

temp = {}
ans = H*W
for i in range(Q):
    y, x = map(int, input().split())
    if x not in temp:
        temp[x] = y
        ans -= H-y+1
    else:
        if temp[x] > y:
            ans -= temp[x]-y
            temp[x] = y
    print(ans)
0