結果
問題 | No.11 カードマッチ |
ユーザー |
👑 ![]() |
提出日時 | 2020-09-27 12:58:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 430 bytes |
コンパイル時間 | 1,540 ms |
コンパイル使用メモリ | 172,392 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 11:58:37 |
合計ジャッジ時間 | 2,314 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include<bits/stdc++.h> using namespace std; using LL = long long; using ULL = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) LL W, H; set<int> CW; set<int> CH; int main() { cin >> W >> H; LL N; cin >> N; rep(i, N) { LL w, h; cin >> w >> h; CW.insert(w); CH.insert(h); } LL ans = W * H - (W - CW.size()) * (H - CH.size()) - N; cout << ans << endl; return 0; }