Submission #139908

#TimeUsernameProblemLanguageResultExecution timeMemory
139908hakimovCombo (IOI18_combo)C++14
10 / 100
98 ms2244 KiB
//author: Hakimov Rahimjon //nickname: //e-mail: [email protected] #include <bits/stdc++.h> #include "combo.h" #define fin(x) freopen(x, "r", stdin) #define fout(x) freopen(x, "w", stdout) #define LL long long #define LD long double #define pb(x) push_back(x) #define pf(x) push_front(x) #define Pb pop_back #define Pf pop_front #define fi first #define se second using namespace std; int TN = 1; /*int press(string p) { cout << p << "\n"; int x; cin >> x; return x; } */ string guess_sequence(int N) { int cur = 1; string cr = ""; if (N==0) return ""; vector <char> st; if (press("A")) { cr += "A"; st = {'B', 'X', 'Y'}; } else if (press("B")) { cr += "B"; st = {'A', 'X', 'Y'}; } else if (press("X")) { cr += "X"; st = {'A', 'B', 'Y'}; } else { cr += "Y"; st = {'A', 'B', 'X'}; } for (int i = 0; i < N-1; i++) { if (press(cr+st[0]) > cur) { cr += st[0]; cur += 1; }else if (press(cr+st[1]) > cur) { cr += st[1]; cur += 1; }else if (press(cr+st[2]) > cur) { cr += st[2]; cur += 1; }else break; }return cr; } /*int solution() { cout << guess_sequence(20); return 0; } int main() { //cin >> TN; //fin("input.txt");fout("output.txt"); for (int i = 0; i < TN; i++) solution(); return 0; } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...