結果

問題 No.11 カードマッチ
ユーザー Dadarithm
提出日時 2015-10-04 23:26:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 511 bytes
コンパイル時間 576 ms
コンパイル使用メモリ 66,236 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-11 19:55:41
合計ジャッジ時間 1,284 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long ll;

int main()
{
	int W, H, N; vector<int> S, K;
	cin >> W >> H >> N;
	S.resize(N); K.resize(N);
	for (int i = 0; i < N; ++i)
		cin >> S[i] >> K[i];

	sort(S.begin(), S.end());
	auto it = unique(S.begin(), S.end());
	S.erase(it, S.end());
	sort(K.begin(), K.end());
	it = unique(K.begin(), K.end());
	K.erase(it, K.end());

	cout << (S.size() * H + K.size() * W) - S.size() * K.size() - N << endl;

	return 0;
}
0