結果
| 問題 | No.11 カードマッチ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-11-13 23:38:44 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 670 bytes | 
| コンパイル時間 | 665 ms | 
| コンパイル使用メモリ | 86,512 KB | 
| 実行使用メモリ | 8,132 KB | 
| 最終ジャッジ日時 | 2024-11-25 22:07:12 | 
| 合計ジャッジ時間 | 3,374 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 9 RE * 10 | 
ソースコード
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>
//#include<bits/stdc++.h>
using namespace std;
set<int>x[100005];
bool f[100005];
int main() {
	int w,h,n;
	cin>>w>>h>>n;
	
	
	
	int y=0;
	
	for(int i=0;i<n;i++){
		int a,b;
		cin>>a>>b;
		if(!f[b])y++;
		
		f[b]=1;
		x[a].insert(b);
	}
	long long int res=0;
	for(int i=1;i<=w;i++){
		if(x[i].size())res+=h-x[i].size();
		if(!x[i].size())res+=y;
		
	//cout<<res<<endl;
	}
	cout<<res<<endl;
	
	
	
	
	return 0;
}
	
            
            
            
        