제출 #690517

#제출 시각아이디문제언어결과실행 시간메모리
690517zeroesandones콤보 (IOI18_combo)C++17
0 / 100
1 ms208 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; using ll = long long; using vi = vector<long long>; #define pb emplace_back std::string guess_sequence(int N) { char start; if(press("A")) start = 'A'; else if (press("B")) start = 'B'; else if(press("X")) start = 'C'; else start = 'Y'; string res; res += start; set<char> moves{'A', 'B', 'X', 'Y'}; moves.erase(start); vector<char> left; for(auto x : moves) left.pb(x); for(int i = 1; i < N - 1; ++i) { string curr = res + left[0] + res + left[1] + left[0] + res + left[1] + left[1] + res + left[1] + left[2]; ll gain = press(curr); int X = res.size(); if(gain == X + 1) { res += (left[0]); } else if(gain == X + 2) { res += (left[1]); } else if(gain == X) { res += (left[2]); } } ll curr = press(res); for(auto i : left) { ll gain = press(res + i); if(gain > curr) { res += i; break; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...