結果
| 問題 |
No.11 カードマッチ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-10-29 20:47:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 455 bytes |
| コンパイル時間 | 1,322 ms |
| コンパイル使用メモリ | 164,748 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-19 08:11:10 |
| 合計ジャッジ時間 | 2,043 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef DEBUG
std::ifstream in("/home/share/inputf.in");
std::cin.rdbuf(in.rdbuf());
#endif
int64_t W, H, N;
cin >> W >> H >> N;
set<int64_t> w, h;
for(int i = 0; i < N; i++) {
int64_t S, K;
cin >> S >> K;
w.insert(S), h.insert(K);
}
int64_t ans = W * H - (W - w.size()) * (H - h.size()) - N;
cout << ans << endl;
return 0;
}