結果

問題 No.1338 Giant Class
ユーザー tt
提出日時 2021-02-06 14:15:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 676 ms / 2,000 ms
コード長 218 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 21,440 KB
最終ジャッジ日時 2023-09-15 20:46:55
合計ジャッジ時間 12,449 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,824 KB
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 611 ms
7,796 KB
testcase_03 AC 17 ms
7,876 KB
testcase_04 AC 18 ms
7,792 KB
testcase_05 AC 19 ms
7,868 KB
testcase_06 AC 421 ms
14,704 KB
testcase_07 AC 592 ms
21,372 KB
testcase_08 AC 392 ms
14,676 KB
testcase_09 AC 369 ms
14,676 KB
testcase_10 AC 656 ms
21,440 KB
testcase_11 AC 75 ms
8,964 KB
testcase_12 AC 491 ms
14,556 KB
testcase_13 AC 381 ms
14,604 KB
testcase_14 AC 113 ms
9,860 KB
testcase_15 AC 164 ms
11,364 KB
testcase_16 AC 65 ms
8,936 KB
testcase_17 AC 388 ms
14,700 KB
testcase_18 AC 111 ms
9,644 KB
testcase_19 AC 189 ms
11,404 KB
testcase_20 AC 659 ms
21,332 KB
testcase_21 AC 670 ms
21,312 KB
testcase_22 AC 676 ms
21,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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