結果

問題 No.1338 Giant Class
ユーザー zlnzln
提出日時 2021-01-15 22:22:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 1,062 bytes
コンパイル時間 1,222 ms
コンパイル使用メモリ 130,120 KB
実行使用メモリ 9,636 KB
最終ジャッジ日時 2023-08-17 17:40:33
合計ジャッジ時間 4,184 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 32 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 55 ms
7,300 KB
testcase_07 AC 85 ms
9,132 KB
testcase_08 AC 52 ms
7,180 KB
testcase_09 AC 47 ms
6,724 KB
testcase_10 AC 99 ms
9,472 KB
testcase_11 AC 8 ms
4,376 KB
testcase_12 AC 58 ms
6,600 KB
testcase_13 AC 55 ms
6,936 KB
testcase_14 AC 12 ms
4,380 KB
testcase_15 AC 19 ms
4,820 KB
testcase_16 AC 7 ms
4,380 KB
testcase_17 AC 53 ms
7,136 KB
testcase_18 AC 13 ms
4,380 KB
testcase_19 AC 23 ms
5,176 KB
testcase_20 AC 100 ms
9,628 KB
testcase_21 AC 102 ms
9,588 KB
testcase_22 AC 106 ms
9,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <random>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
struct FIO{FIO(){std::cin.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::fixed<<std::setprecision(15);}}fIO;
template<typename T> using V = std::vector<T>;
template<typename T> void fill(V<T>&v) { for(T&e:v) std::cin >> e; }
/*-*/

int main() {
	lnt h,w,q;
	std::cin >> h >> w >> q;
	std::map<lnt,lnt> map;
	lnt ans=h*w;
	rep(qq,q) {
		lnt y,x;
		std::cin >> y >> x;
		lnt yy=h+1;
		if(map.count(x)) {
			yy=map[x];
		}
		if(yy>y) {
			ans-=yy-y;
			map[x]=y;
		}
		print(ans);
	}
}
0