Submission #769297

#TimeUsernameProblemLanguageResultExecution timeMemory
769297Mery2005Combo (IOI18_combo)C++14
94 / 100
24 ms632 KiB
#include "combo.h" #include <iostream> #include <algorithm> #include <queue> #include <cmath> #include <vector> #include <list> #include <string> #include <unordered_map> #include <map> #include <set> #include <stack> #include <string> #include <iomanip> #include <fstream> using namespace std; void fastio() { ios_base::sync_with_stdio(false); cin.tie(0); } const long long mod = 1e9+7; const int N = 3e6+5; int a[N] , dp[N]; string guess_sequence(int N){ string s; if(press("A")){ s = "A"; } if(press("B")){ s = "B"; } if(press("X")){ s = "X"; } if(press("Y")){ s = "Y"; } if(N == 1){ return s; } string chars; for (char c : "ABXY") { if (c != s[0]) chars += c; } for (int i = 0; i < N - 2; i++) { int x = press( s + chars[0] + chars[0] + s + chars[0] + chars[1] + s + chars[0] + chars[2] + s + chars[1]); if (x == (int)s.size()) { s += chars[2]; } else if (x == (int)s.size() + 1) { s += chars[1]; } else { s += chars[0]; } } int x = press(s + chars[0] + s + chars[1]); if (x == N) { x = press(s + chars[0]); if (x == N) { return s + chars[0]; } else { return s + chars[1]; } } else { return s + chars[2]; } } // int main() { // return 0; // }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...