結果

問題 No.1338 Giant Class
ユーザー gorugo30gorugo30
提出日時 2021-01-15 21:58:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 383 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 535 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 87,724 KB
最終ジャッジ日時 2023-08-17 17:03:11
合計ジャッジ時間 7,836 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,252 KB
testcase_01 AC 77 ms
71,144 KB
testcase_02 AC 337 ms
78,492 KB
testcase_03 AC 77 ms
71,272 KB
testcase_04 AC 80 ms
71,084 KB
testcase_05 AC 85 ms
75,244 KB
testcase_06 AC 275 ms
84,892 KB
testcase_07 AC 353 ms
85,904 KB
testcase_08 AC 273 ms
84,768 KB
testcase_09 AC 267 ms
84,308 KB
testcase_10 AC 382 ms
87,576 KB
testcase_11 AC 140 ms
78,668 KB
testcase_12 AC 309 ms
82,916 KB
testcase_13 AC 267 ms
84,332 KB
testcase_14 AC 152 ms
79,332 KB
testcase_15 AC 169 ms
80,824 KB
testcase_16 AC 134 ms
78,396 KB
testcase_17 AC 264 ms
84,168 KB
testcase_18 AC 150 ms
79,324 KB
testcase_19 AC 182 ms
81,620 KB
testcase_20 AC 383 ms
87,660 KB
testcase_21 AC 377 ms
87,700 KB
testcase_22 AC 376 ms
87,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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