結果

問題 No.1338 Giant Class
ユーザー setsuatsusetsuatsu
提出日時 2024-01-06 07:02:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 357 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 85,508 KB
最終ジャッジ日時 2024-01-06 07:03:01
合計ジャッジ時間 6,711 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 41 ms
53,460 KB
testcase_02 AC 308 ms
76,376 KB
testcase_03 AC 44 ms
55,612 KB
testcase_04 AC 43 ms
55,612 KB
testcase_05 AC 49 ms
61,116 KB
testcase_06 AC 240 ms
82,908 KB
testcase_07 AC 326 ms
83,532 KB
testcase_08 AC 234 ms
82,912 KB
testcase_09 AC 227 ms
82,908 KB
testcase_10 AC 340 ms
85,508 KB
testcase_11 AC 101 ms
76,636 KB
testcase_12 AC 265 ms
80,944 KB
testcase_13 AC 227 ms
83,160 KB
testcase_14 AC 117 ms
77,400 KB
testcase_15 AC 142 ms
78,808 KB
testcase_16 AC 97 ms
76,380 KB
testcase_17 AC 225 ms
82,908 KB
testcase_18 AC 116 ms
77,404 KB
testcase_19 AC 148 ms
79,580 KB
testcase_20 AC 342 ms
84,208 KB
testcase_21 AC 357 ms
84,208 KB
testcase_22 AC 337 ms
85,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W, Q = map(int, input().split())
from collections import defaultdict
min_y = defaultdict(int)
ans = H*W

for _ in range(Q):
    y, x = map(int, input().split())
    if x not in min_y:
        ans -= H - y +1
        min_y[x] = y
    else:
        ans -= min_y[x] - min(min_y[x], y)
        min_y[x] = min(min_y[x], y)
    
    print(ans)
0