제출 #532121

#제출 시각아이디문제언어결과실행 시간메모리
532121ohohorz콤보 (IOI18_combo)C++14
30 / 100
51 ms664 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 for(int i = 1;i < N;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); char lst = lmao.back(); for(int j = 0;j < 2;j++){ char c = lmao[j]; string p; p += s; p += c; if(press(p) == (i + 1)){ lst = c; break; } } s += lst; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...