結果

問題 No.11 カードマッチ
ユーザー battamon
提出日時 2014-11-09 12:35:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 439 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 62,632 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-11 19:10:53
合計ジャッジ時間 1,151 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string.h>
#include <set>
using namespace std;

int main()
{
	int W, H, N;
	while( cin >> W ){
		set< int > S, K;
		cin >> H;
		cin >> N;
		for( int i = 0; i < N; ++i ){
			int s, k;
			cin >> s >> k;
			S.insert( s );
			K.insert( k );
		}
		int ans = 0;
		ans += S.size() * H;
		ans += K.size() * W;
		ans -= S.size() * K.size();
		ans -= N;

		cout << ans << endl;
	}
	return 0;
}
0