結果
問題 |
No.11 カードマッチ
|
ユーザー |
![]() |
提出日時 | 2016-07-17 18:58:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 1,026 bytes |
コンパイル時間 | 906 ms |
コンパイル使用メモリ | 102,792 KB |
実行使用メモリ | 814,208 KB |
最終ジャッジ日時 | 2024-10-15 15:25:31 |
合計ジャッジ時間 | 6,509 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 MLE * 1 -- * 14 |
ソースコード
#include <iostream> #include <sstream> #include <string> #include <vector> #include <functional> #include <tuple> #include <climits> #include <algorithm> #include <queue> #include <unordered_map> #include <unordered_set> #include <set> #include <iomanip> using namespace std; int main() { int W, H, N; cin >> W >> H >> N; vector<int> S(N), K(N); set<tuple<int, int>> hand; set<tuple<int, int>> match; enum { suit = 0, number = 1 }; for(int i=0; i<N; i++) { cin >> S[i] >> K[i]; hand.insert(make_tuple(S[i], K[i])); } for(const auto &h : hand) { for(int i=1; i<=W; i++) { if(hand.count(make_tuple(i, get<number>(h))) == 0) { match.insert(make_tuple(i, get<number>(h))); } } for(int i=1; i<=H; i++) { if(hand.count(make_tuple(get<suit>(h), i)) == 0) { match.insert(make_tuple(get<suit>(h), i)); } } } cout << match.size() << endl; }