結果
問題 | No.11 カードマッチ |
ユーザー | data9824 |
提出日時 | 2015-06-09 01:35:09 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 509 bytes |
コンパイル時間 | 546 ms |
コンパイル使用メモリ | 66,388 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 19:49:38 |
合計ジャッジ時間 | 1,277 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include <iostream>#include <vector>#include <set>using namespace std;int main() {int w, h, n;cin >> w >> h >> n;vector<int> s(n), k(n);for (int i = 0; i < n; ++i) {cin >> s[i] >> k[i];}set<int> marks, numbers;for (int i = 0; i < n; ++i) {marks.insert(s[i]);numbers.insert(k[i]);}int markMatched = marks.size() * h;int numberMatched = numbers.size() * w;int result = markMatched + numberMatched- marks.size() * numbers.size() - n;cout << result << endl;return 0;}