結果
| 問題 |
No.24 数当てゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-01 21:19:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 898 bytes |
| コンパイル時間 | 781 ms |
| コンパイル使用メモリ | 78,536 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 13:16:13 |
| 合計ジャッジ時間 | 1,334 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_set>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
unordered_set<int> remain{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
for (int i = 0; i < n; ++i) {
vector<int> a(4);
string s;
cin >> a[0] >> a[1] >> a[2] >> a[3] >> s;
if (s == "YES") {
vector<int> vector1;
for (auto x:a) {
if (remain.find(x) != remain.end()) {
vector1.push_back(x);
}
}
remain.clear();
for (auto x:vector1) {
remain.insert(x);
}
} else {
for (auto x:a) {
remain.erase(x);
}
}
}
for (auto x:remain) {
cout << x << endl;
}
return 0;
}