제출 #118347

#제출 시각아이디문제언어결과실행 시간메모리
118347alexandra_udristoiu콤보 (IOI18_combo)C++14
5 / 100
1 ms256 KiB
#include<iostream> #include "combo.h" using namespace std; string guess_sequence(int n){ int i, j; string s, sol; char c[5] = "ABXY"; s = c[0]; s += c[1]; if(press(s) > 0){ s = c[1]; if(press(s) == 1){ swap(c[0], c[1]); } } else{ s = c[2]; if(press(s) == 1){ swap(c[0], c[2]); } else{ swap(c[0], c[3]); } } sol = c[0]; for(i = 2; i < n; i++){ s = sol; s += c[1]; for(j = 1; j < 4; j++){ s += sol; s += c[2]; s += c[j]; } int x = press(s); if(x == i - 1){ sol += c[3]; } else{ if(x == i){ sol += c[1]; } else{ sol += c[2]; } } } s = sol; s += c[1]; if(press(s) == n){ sol += c[1]; } else{ s = sol; s += c[2]; if(press(s) == n){ sol += c[2]; } else{ sol += c[3]; } } return sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...