結果

問題 No.1338 Giant Class
ユーザー GER_chenGER_chen
提出日時 2021-01-22 10:13:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 689 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 723 ms
コンパイル使用メモリ 10,516 KB
実行使用メモリ 21,832 KB
最終ジャッジ日時 2023-08-27 00:36:26
合計ジャッジ時間 11,824 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,468 KB
testcase_01 AC 16 ms
8,512 KB
testcase_02 AC 559 ms
8,480 KB
testcase_03 AC 18 ms
8,384 KB
testcase_04 AC 18 ms
8,480 KB
testcase_05 AC 21 ms
8,536 KB
testcase_06 AC 396 ms
15,104 KB
testcase_07 AC 605 ms
21,656 KB
testcase_08 AC 386 ms
15,060 KB
testcase_09 AC 375 ms
14,968 KB
testcase_10 AC 689 ms
21,688 KB
testcase_11 AC 75 ms
9,220 KB
testcase_12 AC 459 ms
14,936 KB
testcase_13 AC 402 ms
14,928 KB
testcase_14 AC 110 ms
10,216 KB
testcase_15 AC 151 ms
11,680 KB
testcase_16 AC 61 ms
9,168 KB
testcase_17 AC 371 ms
15,256 KB
testcase_18 AC 118 ms
10,016 KB
testcase_19 AC 186 ms
11,604 KB
testcase_20 AC 631 ms
21,664 KB
testcase_21 AC 635 ms
21,748 KB
testcase_22 AC 645 ms
21,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki-1338
from collections import defaultdict as ddt
H, W, Q = map(int, input().split())

ans = H*W
foremost = ddt(int)
for _ in range(Q):
    Y, X = map(int, input().split())
    f = foremost[X]
    if H-Y+1 > f:
        foremost[X] = H-Y+1
        ans -= H-Y+1-f
    print(ans)
0