結果
| 問題 | No.11 カードマッチ | 
| コンテスト | |
| ユーザー |  kei | 
| 提出日時 | 2016-08-19 22:34:34 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 615 bytes | 
| コンパイル時間 | 644 ms | 
| コンパイル使用メモリ | 61,272 KB | 
| 実行使用メモリ | 11,136 KB | 
| 最終ジャッジ日時 | 2024-11-07 18:54:47 | 
| 合計ジャッジ時間 | 1,551 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 WA * 13 | 
ソースコード
#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;
}
            
            
            
        