제출 #1085125

#제출 시각아이디문제언어결과실행 시간메모리
1085125TlenekWodoru콤보 (IOI18_combo)C++17
5 / 100
1 ms344 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; vector<char>Y={'A','B','X','Y'}; void usun(int u) { swap(Y[u],Y[Y.size()-1]); Y.pop_back(); } string guess_sequence(int n) { string odp; if(press("AB")==0) { if(press("X")==0) {///y odp.push_back('Y'); usun(3); } else {///x odp.push_back('X'); usun(2); } } else { if(press("A")==0) {///b odp.push_back('B'); usun(1); } else {///a odp.push_back('A'); usun(0); } } for(int i=2;i<n;i++) { string zap; zap+=odp; zap.push_back(Y[0]); zap.push_back(Y[0]); zap+=odp; zap.push_back(Y[0]); zap.push_back(Y[1]); zap+=odp; zap.push_back(Y[0]); zap.push_back(Y[2]); zap+=odp; zap.push_back(Y[1]); int u=press(zap); if(u==(int)odp.size()+2) { odp.push_back(Y[0]); } else if(u==(int)odp.size()+1) { odp.push_back(Y[1]); } else if(u==(int)odp.size()+0) { odp.push_back(Y[2]); } } string zap; zap+=odp; zap.push_back(Y[0]); zap+=odp; zap.push_back(Y[1]); if(press(zap)==(int)odp.size()) { odp.push_back(Y[2]); } else { zap.clear(); zap+=odp; zap.push_back(Y[0]); if(press(zap)==(int)odp.size()) { odp.push_back(Y[1]); } else { odp.push_back(Y[0]); } } return odp; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...