Submission #75928

#TimeUsernameProblemLanguageResultExecution timeMemory
75928MilkiCombo (IOI18_combo)C++14
100 / 100
53 ms604 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; #define FOR(i, a, b) for(int i = a; i < b; ++i) #define REP(i, n) FOR(i, 0, n) #define _ << " " << #define sz(x) ((int) x.size()) #define pb(x) push_back(x) typedef long long ll; typedef pair<int, int> point; string guess_sequence(int N){ string sol = ""; vector <char> slova = {'A', 'B', 'X', 'Y'}; if(press("AB")){ if(press("A")) sol += 'A'; else sol += 'B'; } else{ if(press("X")) sol += 'X'; else sol += 'Y'; } if(N == 1) return sol; REP(i, 4) if(slova[i] == sol[0]){ slova.erase(slova.begin() + i); break; } assert(sz(slova) == 3); FOR(i, 1, N - 1){ string kopija = sol, go = sol; go += slova[1]; kopija += slova[2]; REP(j, 3) go += kopija + slova[j]; int val = press(go); if(val == i) sol += slova[0]; else if(val == i + 1) sol += slova[1]; else if(val == i + 2) sol += slova[2]; else assert(N == 0); } if(press(sol + slova[0]) == N) sol += slova[0]; else if(press(sol + slova[1]) == N) sol += slova[1]; else sol += slova[2]; return sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...