結果

問題 No.11 カードマッチ
ユーザー sggkshiosggkshio
提出日時 2016-11-13 23:38:44
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 670 bytes
コンパイル時間 1,572 ms
コンパイル使用メモリ 81,128 KB
実行使用メモリ 8,328 KB
最終ジャッジ日時 2023-08-17 04:29:46
合計ジャッジ時間 5,161 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
8,032 KB
testcase_01 AC 5 ms
8,072 KB
testcase_02 AC 5 ms
8,020 KB
testcase_03 AC 4 ms
8,008 KB
testcase_04 RE -
testcase_05 AC 5 ms
8,328 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 5 ms
8,036 KB
testcase_16 AC 5 ms
8,148 KB
testcase_17 AC 5 ms
8,120 KB
testcase_18 AC 5 ms
8,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

	
0