結果

問題 No.11 カードマッチ
ユーザー btk
提出日時 2015-05-03 18:46:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 653 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 84,980 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 17:40:20
合計ジャッジ時間 1,275 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
bool mark[1000001],num[1000001];
#define LL long long
int main(void){
	LL H, W, h = 0, w = 0;int  N;
	cin >> H >> W >> N;
	for (int i = 0; i < N; i++)
	{
		int a, b;
		cin >> a >> b;
		if (mark[a] == false)h++;
		if (mark[b] == false)w++;
		mark[a] = mark[b] = true;
	}
	cout << h*W + w*H - h*w - N << endl;;
	return 0;
}
0