제출 #783263

#제출 시각아이디문제언어결과실행 시간메모리
783263sadsa콤보 (IOI18_combo)C++17
10 / 100
40 ms448 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; using vi = vector<int>; using ii = pair<int, int>; using vii = vector<ii>; using i64 = int64_t; using vl = vector<i64>; using ll = pair<i64, i64>; using vll = vector<ll>; constexpr int iINF = numeric_limits<int>::max(); constexpr i64 lINF = numeric_limits<i64>::max(); #define RANGE(x) begin(x), end(x) template <typename... T> void DBG(T&&... args) { ((cerr << args << ' '), ...) << '\n'; } template <typename T> ostream &operator<<(ostream &out, const vector<T> &vec) { out << '{'; for (size_t i = 0; i < vec.size()-1; ++i) out << vec[i] << ", "; out << vec.back() << '}'; return out; } template <typename T1, typename T2> ostream &operator<<(ostream &out, const pair<T1, T2> &pr) { out << '(' << pr.first << ", " << pr.second << ')'; return out; } std::string guess_sequence(int N) { vector<char> chars{'A', 'B', 'X', 'Y'}; string p; for (char c : chars) { p = string(1, c); if (press(p)) { break; } } chars.erase(find(RANGE(chars), p[0])); char o = chars.back(); chars.pop_back(); for (int i = 1; i < N; ++i) { bool f=false; for (char c : chars) { if (press(p + c) == i+1) { p += c; f=true; break; } } if (!f) p += o; } DBG(p); return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...