結果

問題 No.1338 Giant Class
ユーザー maninimanini
提出日時 2021-01-25 17:25:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 326 ms / 2,000 ms
コード長 610 bytes
コンパイル時間 1,036 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 120,564 KB
最終ジャッジ日時 2023-09-04 10:31:21
合計ジャッジ時間 7,523 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,480 KB
testcase_01 AC 74 ms
71,336 KB
testcase_02 AC 214 ms
88,268 KB
testcase_03 AC 77 ms
71,484 KB
testcase_04 AC 80 ms
71,232 KB
testcase_05 AC 85 ms
75,336 KB
testcase_06 AC 237 ms
104,220 KB
testcase_07 AC 302 ms
115,848 KB
testcase_08 AC 239 ms
103,976 KB
testcase_09 AC 231 ms
100,640 KB
testcase_10 AC 325 ms
120,388 KB
testcase_11 AC 131 ms
78,764 KB
testcase_12 AC 240 ms
100,856 KB
testcase_13 AC 230 ms
101,544 KB
testcase_14 AC 146 ms
82,636 KB
testcase_15 AC 157 ms
85,196 KB
testcase_16 AC 129 ms
78,248 KB
testcase_17 AC 234 ms
103,388 KB
testcase_18 AC 145 ms
82,628 KB
testcase_19 AC 164 ms
87,632 KB
testcase_20 AC 321 ms
120,372 KB
testcase_21 AC 321 ms
120,480 KB
testcase_22 AC 326 ms
120,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding:UTF-8
import sys

MOD = 10 ** 9 + 7
INF = float('inf')

H, W, Q = list(map(int, input().split()))     # スペース区切り連続数字
YX = [list(map(int, input().split())) for _ in range(Q)]     # スペース区切り連続数字(行列)

res = H * W
x_set = set()
for y, x in YX:
    x_set.add(x)
x_list = [x for x in x_set]
x_list.sort()
x_dict = {}
for i in range(len(x_list)):
    x_dict[x_list[i]] = i

zan = [H] * len(x_list)

for y, x in YX:
    idx = x_dict[x]
    t = y - 1
    if zan[idx] > t:
        d = zan[idx] - t
        zan[idx] = t
        res -= d

    print("{}".format(res))
0