結果

問題 No.1338 Giant Class
ユーザー chineristACchineristAC
提出日時 2021-01-15 21:31:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 92,864 KB
最終ジャッジ日時 2023-08-17 16:09:28
合計ジャッジ時間 5,106 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,652 KB
testcase_01 AC 72 ms
71,372 KB
testcase_02 AC 126 ms
82,572 KB
testcase_03 AC 72 ms
71,496 KB
testcase_04 AC 74 ms
71,536 KB
testcase_05 AC 75 ms
71,472 KB
testcase_06 AC 130 ms
91,556 KB
testcase_07 AC 148 ms
90,488 KB
testcase_08 AC 129 ms
90,928 KB
testcase_09 AC 129 ms
89,264 KB
testcase_10 AC 167 ms
92,556 KB
testcase_11 AC 93 ms
77,320 KB
testcase_12 AC 138 ms
87,560 KB
testcase_13 AC 127 ms
89,408 KB
testcase_14 AC 99 ms
79,560 KB
testcase_15 AC 103 ms
80,212 KB
testcase_16 AC 91 ms
76,952 KB
testcase_17 AC 134 ms
90,524 KB
testcase_18 AC 100 ms
79,660 KB
testcase_19 AC 105 ms
80,320 KB
testcase_20 AC 160 ms
92,864 KB
testcase_21 AC 161 ms
92,840 KB
testcase_22 AC 160 ms
92,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline

H,W,Q = map(int,input().split())
min_dic = {}
res = H*W
ans = []
for _  in range(Q):
    y,x = map(int,input().split())
    if x not in min_dic:
        res -= H
        res += y - 1
        min_dic[x] = y
    else:
        if min_dic[x] > y:
            res -= min_dic[x] - 1
            res += y - 1
            min_dic[x] = y
    ans.append(res)

print(*ans,sep="\n")
0