제출 #800106

#제출 시각아이디문제언어결과실행 시간메모리
800106jasmin콤보 (IOI18_combo)C++17
0 / 100
1 ms256 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string find_single(int n, string mom){ int l=mom.size(); string ask = ""; string ans = ""; ask = mom + "A" + mom + "B"; int coins = press(ask); if(0 < coins-l){ ask= mom + "A"; coins = press(mom); if(0 < coins-l){ ans = "A"; } else{ ans = "B"; } } else{ ask = mom + "X"; coins = press(ask); if(0 < coins-l){ ans = "X"; } else{ ans = "Y"; } } return ans; } string guess_sequence(int n) { string ans=""; ans = find_single(n, ans); set<string> opt = {"A", "B", "X", "Y"}; opt.erase(ans); string a = *opt.begin(); string b = *next(opt.begin()); string c = *next(next(opt.begin())); for(int i=1; i<n-1; i++){ string ask = ans +a +a; ask += ans + a +b; ask += ans + a +c; ask += ans + b; int coins=press(ask); if(coins >= i+2){ ans += a; } else if(coins >= i+1){ ans += b; } else{ ans += c; } } ans += find_single(n, ans); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...