結果

問題 No.1338 Giant Class
ユーザー hir355hir355
提出日時 2021-01-15 21:53:34
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 358 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 1,766 ms
コンパイル使用メモリ 86,152 KB
実行使用メモリ 87,372 KB
最終ジャッジ日時 2023-08-17 16:53:14
合計ジャッジ時間 7,506 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,060 KB
testcase_01 AC 68 ms
70,792 KB
testcase_02 AC 326 ms
78,192 KB
testcase_03 AC 71 ms
70,848 KB
testcase_04 AC 73 ms
71,164 KB
testcase_05 AC 79 ms
75,248 KB
testcase_06 AC 257 ms
84,592 KB
testcase_07 AC 332 ms
85,816 KB
testcase_08 AC 249 ms
84,484 KB
testcase_09 AC 244 ms
84,164 KB
testcase_10 AC 347 ms
87,300 KB
testcase_11 AC 124 ms
78,580 KB
testcase_12 AC 296 ms
82,788 KB
testcase_13 AC 245 ms
84,212 KB
testcase_14 AC 138 ms
79,444 KB
testcase_15 AC 159 ms
80,612 KB
testcase_16 AC 120 ms
78,084 KB
testcase_17 AC 245 ms
84,296 KB
testcase_18 AC 140 ms
79,244 KB
testcase_19 AC 167 ms
81,852 KB
testcase_20 AC 347 ms
87,352 KB
testcase_21 AC 352 ms
87,192 KB
testcase_22 AC 358 ms
87,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w, q = map(int, input().split())
d = dict()
ans = w * h
for i in range(q):
    y, x = map(int, input().split())
    if x in d:
        ans -= d[x]
        d[x] = min(d[x], y - 1)
        ans += d[x]
    else:
        ans -= h
        d[x] = y - 1
        ans += d[x] 
    print(ans)
0