제출 #142695

#제출 시각아이디문제언어결과실행 시간메모리
142695triplem5ds콤보 (IOI18_combo)C++14
100 / 100
54 ms636 KiB
#include "combo.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; vector<char> go = {'A','B','X','Y'}; std::string guess_sequence(int N) { std::string p = ""; vector<char> v; if(press("AB")){ if(press("A")==1)p="A"; else p = "B"; } else { if(press("X") == 1)p = "X"; else p = "Y"; } if(N==1)return p; go.erase(find(go.begin(),go.end(),p[0])); for(int i = 2; i < N; i++){ int x = press(p + go[0] + go[0] + p + go[0] + go[1] + p + go[0] + go[2] + p + go[1]); if(x == i + 1)p.push_back(go[0]); else if(x == i)p.push_back(go[1]); else if(x == i - 1)p.push_back(go[2]); } if(press(p + go[0]) == N)p.push_back(go[0]); else if(press(p + go[1]) == N)p.push_back(go[1]); else p.push_back(go[2]); return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...