Submission #1305858

#TimeUsernameProblemLanguageResultExecution timeMemory
1305858farica콤보 (IOI18_combo)C++20
0 / 100
1 ms400 KiB
#include "combo.h" #include <bits/stdc++.h> typedef long long ll; using namespace std; using vi = vector<int>; using pi = pair<int,int>; string guess_sequence(int N) { string ans = ""; int tmp = press("AB"); if(!tmp) { tmp = press("XAXBXY"); if(tmp == 1) ans = "Y"; else ans = "X"; } else { tmp = press("ABAXAY"); if(tmp == 1) ans = "B"; else ans = "A"; } int prev = 1; char c[4] = {'A', 'B', 'X', 'Y'}; for(int i=1; i<N; ++i) { for(char ch: c) { tmp = press(ans + ch); if(tmp == prev+1) { ans += ch; ++prev; break; } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...