제출 #737788

#제출 시각아이디문제언어결과실행 시간메모리
737788Elvin_Fritl콤보 (IOI18_combo)C++17
10 / 100
64 ms452 KiB
#include <bits/stdc++.h> using namespace std; #include "combo.h" string guess_sequence(int n) { string s; vector<char>v; int toto=press("AB"),toto2=press("AX"),k=1; if(toto==1 && toto2==1){ s+='A'; v.push_back('B'); v.push_back('Y'); v.push_back('X'); } else if(toto==0 && toto2==0){ s+='Y'; v.push_back('B'); v.push_back('A'); v.push_back('X'); } else if(toto==2){ s+="AB"; k=2; v.push_back('B'); v.push_back('Y'); v.push_back('X'); } else if(toto2==2){ s+="AX"; k=2; v.push_back('B'); v.push_back('Y'); v.push_back('X'); } else if(toto==1){ s+='B'; v.push_back('A'); v.push_back('Y'); v.push_back('X'); } else{ s+='X'; v.push_back('B'); v.push_back('Y'); v.push_back('A'); } for(int i=k;i<n;i++){ for(char j:v){ if(press(s+j)==i+1){ s+=j; break; } } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...