結果

問題 No.1338 Giant Class
ユーザー QCFiumQCFium
提出日時 2020-07-10 08:52:35
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 1,701 ms
コンパイル使用メモリ 168,868 KB
実行使用メモリ 8,448 KB
最終ジャッジ日時 2024-04-19 02:52:10
合計ジャッジ時間 4,442 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 45 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 58 ms
6,528 KB
testcase_07 AC 84 ms
8,064 KB
testcase_08 AC 57 ms
6,400 KB
testcase_09 AC 52 ms
6,272 KB
testcase_10 AC 97 ms
8,320 KB
testcase_11 AC 9 ms
5,376 KB
testcase_12 AC 59 ms
6,016 KB
testcase_13 AC 57 ms
6,400 KB
testcase_14 AC 15 ms
5,376 KB
testcase_15 AC 22 ms
5,376 KB
testcase_16 AC 8 ms
5,376 KB
testcase_17 AC 56 ms
6,400 KB
testcase_18 AC 14 ms
5,376 KB
testcase_19 AC 27 ms
5,376 KB
testcase_20 AC 108 ms
8,448 KB
testcase_21 AC 99 ms
8,448 KB
testcase_22 AC 101 ms
8,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int h = ri();
	int w = ri();
	int q = ri();
	std::map<int, int> used;
	int64_t res = (int64_t) h * w;
	for (int i = 0; i < q; i++) {
		int y = h - ri() + 1;
		int x = ri() - 1;
		res += used[x];
		res -= used[x] = std::max(used[x], y);
		printf("%" PRId64 "\n", res);
	}
	return 0;
}
0