結果
問題 |
No.11 カードマッチ
|
ユーザー |
|
提出日時 | 2015-01-20 03:09:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 435 bytes |
コンパイル時間 | 799 ms |
コンパイル使用メモリ | 67,532 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 19:36:50 |
合計ジャッジ時間 | 1,504 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <utility> #include <set> using namespace std; int main() { int w, h, n; cin >> w >> h >> n; set<int> used_w, used_h; int s, k; for (int i = 0; i < n; i++) { cin >> s >> k; used_w.insert(s); used_h.insert(k); } long long total = (long long) w * h - (w - used_w.size()) * (h - used_h.size()) - n; cout << total << endl; return 0; }