結果

問題 No.1338 Giant Class
ユーザー leaf_1415leaf_1415
提出日時 2021-01-15 21:39:15
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 942 bytes
コンパイル時間 1,176 ms
コンパイル使用メモリ 88,032 KB
実行使用メモリ 9,880 KB
最終ジャッジ日時 2023-08-17 16:25:35
合計ジャッジ時間 4,564 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 45 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 86 ms
7,284 KB
testcase_07 AC 122 ms
8,948 KB
testcase_08 AC 73 ms
7,264 KB
testcase_09 AC 69 ms
6,808 KB
testcase_10 AC 133 ms
9,540 KB
testcase_11 AC 10 ms
4,376 KB
testcase_12 AC 81 ms
6,464 KB
testcase_13 AC 72 ms
6,944 KB
testcase_14 AC 18 ms
4,464 KB
testcase_15 AC 27 ms
4,796 KB
testcase_16 AC 9 ms
4,376 KB
testcase_17 AC 74 ms
7,020 KB
testcase_18 AC 18 ms
4,380 KB
testcase_19 AC 33 ms
5,068 KB
testcase_20 AC 144 ms
9,688 KB
testcase_21 AC 140 ms
9,632 KB
testcase_22 AC 147 ms
9,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#include <complex>
#define rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define all(x) (x).begin(),(x).end()
#define inf 1e18
#define mod 1000000007

using namespace std;

typedef long long llint;
typedef long long ll;
typedef pair<llint, llint> P;

ll h, w, Q;
map<ll, ll> mp;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> h >> w >> Q;
	ll ans = h*w, x, y;
	rep(i, 1, Q){
		cin >> y >> x;
		if(mp.count(x) == 0) mp[x] = h;
		ans -= mp[x];
		chmin(mp[x], y-1);
		ans += mp[x];
		cout << ans  << "\n";
	}
	flush(cout);
	
	return 0;
}
0