結果

問題 No.11 カードマッチ
ユーザー hirokazu1020hirokazu1020
提出日時 2015-04-21 23:35:08
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 736 bytes
コンパイル時間 552 ms
コンパイル使用メモリ 80,624 KB
実行使用メモリ 7,752 KB
最終ジャッジ日時 2024-04-20 01:00:23
合計ジャッジ時間 1,159 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 3 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 3 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 4 ms
7,752 KB
testcase_09 AC 4 ms
7,640 KB
testcase_10 AC 3 ms
7,628 KB
testcase_11 AC 3 ms
6,948 KB
testcase_12 AC 3 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 3 ms
7,728 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0