제출 #788200

#제출 시각아이디문제언어결과실행 시간메모리
788200APROHACK콤보 (IOI18_combo)C++17
97 / 100
25 ms536 KiB
#include <bits/stdc++.h> #include "combo.h" #define ll long long #define ff first #define ss second #define pb push_back using namespace std; std::string guess_sequence(int N) { string p = ""; string posi = "ABXY"; string ans = ""; string newPosi = ""; int best = 0, res = 0; for(int j = 0 ; j < 3 ; j ++){ p = ans; p+= posi[j]; int coin = press(p); if(coin > res){ res = coin; best = j; } } if(res == 0)best = 3; ans += posi[best]; for(auto i : posi)if(i != posi[best])newPosi += i; //for (auto i : newPosi)cout << i << endl; if(N==1)return ans; for(int i = 1 ; i < N-1 ; i ++){ p = ans; p+=newPosi[0]; for(int j = 0 ; j < 3 ; j ++){ p += ans; p += newPosi[1]; p += newPosi[j]; } int coin = press(p); //cout << " got " << coin << endl; if(coin == i){ ans += newPosi[2]; }else if(coin == i+1){ ans += newPosi[0]; }else{ ans += newPosi[1]; } } p = ans; p += newPosi[0]; if(press(p) == N){ ans += newPosi[0]; return ans ; } p = ans; p += newPosi[1]; if(press(p) == N){ ans += newPosi[1]; return ans; } //cout << ans << endl; ans += newPosi[2]; return ans ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...