제출 #282797

#제출 시각아이디문제언어결과실행 시간메모리
282797sofapuden콤보 (IOI18_combo)C++14
100 / 100
40 ms684 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N){ string ans; vector<char> v; if(N == 1){ if(press("A"))return "A"; if(press("B"))return "B"; if(press("X"))return "X"; return "Y"; } if(press("AB")){ if(press("A")){ ans = "A"; v = {'B', 'X', 'Y'}; } else{ ans = "B"; v = {'A', 'X', 'Y'}; } } else if(press("X")){ ans = "X"; v = {'A', 'B', 'Y'}; } else { ans = "Y"; v = {'A', 'B', 'X'}; } for(int i = 2; i < N; ++i){ int coins = press(ans+v[0]+ans+v[1]+v[0]+ans+v[1]+v[1]+ans+v[1]+v[2]); if(coins == i-1)ans+=v[2]; else if(coins == i)ans+=v[0]; else ans+=v[1]; } if(press(ans+v[0]) == N)ans+=v[0]; else if(press(ans+v[1]) == N)ans+=v[1]; else ans+=v[2]; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...