結果

問題 No.11 カードマッチ
ユーザー keikei
提出日時 2016-08-19 22:34:34
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 615 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 61,556 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-25 08:28:30
合計ジャッジ時間 1,109 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 6 ms
11,008 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main() {
	long long W, H, N, Ans = 0;
	long long Use = 0,True_num = 0;
	cin >> W >> H >> N;
	vector<long long> S(N), K(N);
	vector<long long> use_mark(W,0);
	vector<bool> use_num(H, false);

	for (int i = 0; i < N;i++) {
		cin >> S[i] >> K[i];
		if (use_mark[S[i] - 1] == 0) { Use++; }
		use_mark[S[i] - 1]++;
		if (use_num[K[i] - 1] != true) {
			use_num[K[i] - 1] = true;
			True_num++;
		}
	}
	for (int i = 0; i < N;i++) {
		if (use_mark[i] != 0) {
			Ans += (H - use_mark[i]);
		}
	}
	Ans += (W - Use) * True_num;
	cout << Ans << endl;
	return 0;
}
0