結果

問題 No.1338 Giant Class
ユーザー maninimanini
提出日時 2021-01-25 17:38:12
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 578 bytes
コンパイル時間 439 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 123,736 KB
最終ジャッジ日時 2023-09-04 11:03:42
合計ジャッジ時間 6,776 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,220 KB
testcase_01 AC 72 ms
71,208 KB
testcase_02 AC 216 ms
88,580 KB
testcase_03 AC 74 ms
71,204 KB
testcase_04 AC 76 ms
71,240 KB
testcase_05 AC 80 ms
75,208 KB
testcase_06 AC 235 ms
106,284 KB
testcase_07 AC 292 ms
118,308 KB
testcase_08 AC 231 ms
105,756 KB
testcase_09 AC 223 ms
102,416 KB
testcase_10 AC 307 ms
123,284 KB
testcase_11 AC 124 ms
78,872 KB
testcase_12 AC 236 ms
102,476 KB
testcase_13 AC 223 ms
103,296 KB
testcase_14 AC 138 ms
81,904 KB
testcase_15 AC 152 ms
85,812 KB
testcase_16 AC 121 ms
78,388 KB
testcase_17 AC 226 ms
105,312 KB
testcase_18 AC 137 ms
82,084 KB
testcase_19 AC 164 ms
88,168 KB
testcase_20 AC 314 ms
123,588 KB
testcase_21 AC 318 ms
123,736 KB
testcase_22 AC 320 ms
123,576 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)]     # スペース区切り連続数字(行列)

def compress(arr):
    *XS, = set(arr)
    XS.sort()
    return {e: i for i, e in enumerate(XS)}

mp = compress([x for y, x in YX])

res = H * W
zan = [H] * len(mp)

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

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