제출 #532185

#제출 시각아이디문제언어결과실행 시간메모리
532185ohohorz콤보 (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { string gg = "ABX"; char fi = 'Y'; for(char c:gg){ string p; p += c; // cout <<"inside " << p << "\n"; if(press(p) == 1){ fi = c; break; } } string s = ""; s += fi; // <= 3 queries used // left : = n - 1 // 3 + n - 2 = n-1 used for(int i = 1;i < N-1;i ++){ set<char> lol; lol.insert('A'); lol.insert('B'); lol.insert('X'); lol.insert('Y'); lol.erase(fi); vector<char> lmao; for(char c:lol) lmao.push_back(c); string p; p += s; p += lmao[0]; p += lmao[0]; p += s; p += lmao[0]; p += lmao[1]; p += s; p += lmao[0]; p += lmao[2]; p += s; p += lmao[1]; p += lmao[0]; int coins = press(p); if(coins == i){ s += lmao[2]; }else if(coins==i+1){ s += lmao[1]; }else{ s += lmao[0]; } } set<char> lol; lol.insert('A'); lol.insert('B'); lol.insert('X'); lol.insert('Y'); lol.erase(fi); vector<char> lmao; for(char c:lol) lmao.push_back(c); char lst = lmao.back(); for(int i = 0;i<2;i++){ string p; p += s; p += lmao[i]; if(press(p) == N){ return p; } } s+=lst; return s; } /* s+c1+c1 s+c1+c2 s+c1+c3 s+c2+c1 if coins = 0: s += c3 elif coins == 1: s += c2 else: s += c1 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...