結果

問題 No.1338 Giant Class
ユーザー 👑 timitimi
提出日時 2021-01-26 13:57:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 666 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 21,440 KB
最終ジャッジ日時 2023-09-05 18:07:14
合計ジャッジ時間 9,328 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,860 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 625 ms
7,816 KB
testcase_03 AC 16 ms
7,816 KB
testcase_04 AC 17 ms
7,900 KB
testcase_05 AC 18 ms
7,856 KB
testcase_06 AC 421 ms
14,708 KB
testcase_07 AC 603 ms
21,380 KB
testcase_08 AC 384 ms
14,660 KB
testcase_09 AC 366 ms
14,624 KB
testcase_10 AC 666 ms
21,364 KB
testcase_11 AC 74 ms
8,980 KB
testcase_12 AC 481 ms
14,732 KB
testcase_13 AC 378 ms
14,668 KB
testcase_14 AC 113 ms
9,868 KB
testcase_15 AC 162 ms
11,460 KB
testcase_16 AC 65 ms
8,972 KB
testcase_17 AC 390 ms
14,524 KB
testcase_18 AC 111 ms
9,784 KB
testcase_19 AC 189 ms
11,368 KB
testcase_20 AC 666 ms
21,284 KB
testcase_21 AC 656 ms
21,284 KB
testcase_22 AC 660 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