結果
| 問題 |
No.11 カードマッチ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-18 18:03:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 324 bytes |
| コンパイル時間 | 556 ms |
| コンパイル使用メモリ | 61,912 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 20:04:26 |
| 合計ジャッジ時間 | 1,306 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <iostream>
#include <set>
using namespace std;
int w, h, n;
set<int> wm, hm;
int main()
{
cin >> w >> h >> n;
for ( int i = 0; i < n; i++ ) {
int s, k;
cin >> s >> k;
wm.insert(s);
hm.insert(k);
}
cout << ((long long)wm.size() * h + (long long)hm.size() * (w - wm.size()) - n) << endl;
return 0;
}