結果

問題 No.1338 Giant Class
ユーザー O2MTO2MT
提出日時 2021-01-23 17:09:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 505 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 87,404 KB
実行使用メモリ 94,836 KB
最終ジャッジ日時 2023-08-30 01:41:36
合計ジャッジ時間 10,110 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,536 KB
testcase_01 AC 70 ms
71,412 KB
testcase_02 AC 505 ms
81,184 KB
testcase_03 AC 72 ms
71,336 KB
testcase_04 AC 76 ms
71,596 KB
testcase_05 AC 82 ms
75,876 KB
testcase_06 AC 318 ms
89,404 KB
testcase_07 AC 375 ms
92,236 KB
testcase_08 AC 286 ms
88,056 KB
testcase_09 AC 282 ms
87,860 KB
testcase_10 AC 414 ms
94,152 KB
testcase_11 AC 171 ms
80,816 KB
testcase_12 AC 320 ms
87,348 KB
testcase_13 AC 293 ms
87,332 KB
testcase_14 AC 144 ms
79,948 KB
testcase_15 AC 185 ms
82,120 KB
testcase_16 AC 124 ms
78,768 KB
testcase_17 AC 299 ms
89,324 KB
testcase_18 AC 142 ms
79,676 KB
testcase_19 AC 178 ms
83,284 KB
testcase_20 AC 423 ms
94,836 KB
testcase_21 AC 416 ms
92,856 KB
testcase_22 AC 411 ms
94,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,Q = map(int,input().split())
room = {}
count = H*W
for _ in range(Q):
    y,x = map(int,input().split())
    if x not in room:
        room[x] = [y]
        count -= H-y+1
    else:
        min_room = min(room[x])
        if y < min_room:
            count -= min_room-y
        room[x].append(y)
    print(count)
0