結果
問題 | No.11 カードマッチ |
ユーザー | hashiryo |
提出日時 | 2020-06-14 20:00:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 565 bytes |
コンパイル時間 | 1,494 ms |
コンパイル使用メモリ | 171,188 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 20:49:11 |
合計ジャッジ時間 | 2,726 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include <bits/stdc++.h>#define debug(x) cerr << #x << ": " << x << endl#define debugArray(x, n) \for (long long hoge = 0; (hoge) < (n); ++(hoge)) \cerr << #x << "[" << hoge << "]: " << x[hoge] << endlusing namespace std;signed main() {cin.tie(0);ios::sync_with_stdio(false);long long W, H, N;cin >> W >> H >> N;set<int> Sw, Sh;for (int i = 0; i < N; i++) {int S, K;cin >> S >> K;Sw.insert(S);Sh.insert(K);}cout << W * H - (W - Sw.size()) * (H - Sh.size()) - N << endl;return 0;}