結果

問題 No.1338 Giant Class
ユーザー qibqib
提出日時 2023-01-15 13:56:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 406 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 622 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 87,676 KB
最終ジャッジ日時 2023-08-27 21:30:08
合計ジャッジ時間 9,778 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,040 KB
testcase_01 AC 71 ms
71,488 KB
testcase_02 AC 358 ms
78,868 KB
testcase_03 AC 73 ms
71,236 KB
testcase_04 AC 75 ms
71,536 KB
testcase_05 AC 80 ms
75,272 KB
testcase_06 AC 269 ms
85,116 KB
testcase_07 AC 335 ms
86,248 KB
testcase_08 AC 268 ms
85,364 KB
testcase_09 AC 253 ms
84,312 KB
testcase_10 AC 363 ms
87,676 KB
testcase_11 AC 131 ms
78,944 KB
testcase_12 AC 291 ms
83,324 KB
testcase_13 AC 253 ms
84,552 KB
testcase_14 AC 152 ms
79,564 KB
testcase_15 AC 162 ms
81,168 KB
testcase_16 AC 125 ms
78,564 KB
testcase_17 AC 259 ms
84,592 KB
testcase_18 AC 143 ms
79,592 KB
testcase_19 AC 174 ms
81,768 KB
testcase_20 AC 362 ms
87,476 KB
testcase_21 AC 406 ms
87,584 KB
testcase_22 AC 361 ms
87,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w, q = map(int, input().split())

ans = h * w
lb = {}
for _ in range(q):
  yi, xi = map(int, input().split())
  lb.setdefault(xi, h + 1)
  ans -= (lb[xi] - 1)
  lb[xi] = min(lb[xi], yi)
  ans += (lb[xi] - 1)
  print(ans)
0