結果
問題 | No.24 数当てゲーム |
ユーザー |
|
提出日時 | 2023-02-20 10:18:54 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 5,000 ms |
コード長 | 844 bytes |
コンパイル時間 | 924 ms |
コンパイル使用メモリ | 80,144 KB |
最終ジャッジ日時 | 2025-02-10 19:12:51 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>bool is_possible(int &x,std::vector<std::pair<std::vector<int>, bool>> &data) {for (const auto &[V, R]: data) {bool exist = std::any_of(V.begin(), V.end(), [&x](int v) { return v == x; });if (exist != R) { return false; }}return true;}int main() {int N;std::cin >> N;std::vector<std::pair<std::vector<int>, bool>> data(N);for (int i = 0; i < N; i++) {std::vector<int> V(4);for (int j = 0; j < 4; j++) {std::cin >> V.at(j);}std::string R;std::cin >> R;bool flag = (R == "YES");data.at(i) = {V, flag};}for (int x = 0; x < 10; x++) {if (is_possible(x, data)){std::cout << x << std::endl;}}}