結果
| 問題 |
No.11 カードマッチ
|
| コンテスト | |
| ユーザー |
hirokazu1020
|
| 提出日時 | 2015-04-21 23:35:08 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 5,000 ms |
| コード長 | 736 bytes |
| コンパイル時間 | 756 ms |
| コンパイル使用メモリ | 79,152 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 19:47:46 |
| 合計ジャッジ時間 | 1,341 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include<sstream>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())
#define indexOf(v,x) (find(all(v),x)-v.begin())
int a[1000000],b[1000000];
int s[100],k[100];
int main(){
int w,h,n,c=0;
cin>>w>>h>>n;
rep(i,n){
cin>>s[i]>>k[i];
s[i]--;k[i]--;
a[s[i]]++;
if(b[k[i]]++==0)c++;
}
long long ans=(long long)w*h-n;
rep(i,w)if(a[i]==0){
ans-=h-c;
}
cout<<ans<<endl;
return 0;
}
hirokazu1020