제출 #237404

#제출 시각아이디문제언어결과실행 시간메모리
237404dannber_BR콤보 (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string Btns[] = {"A","B","X","Y"}; string guess_sequence(int N) { string s = ""; int p = 0; int long_gues = 0; if (press(Btns[0]) == 1) { s += Btns[0]; p = 0; long_gues++; } else if (press(Btns[1]) == 1) { s += Btns[1]; p = 1; long_gues++; } else if (press(Btns[2]) == 1){ s += Btns[2]; p = 2; long_gues++; } else if (press(Btns[3]) == 1) { s += Btns[3]; p = 3; long_gues++; } if (N == 1) { return s; } int last_one = 0; for(int i = long_gues + 1;i <= N;i++) { bool fact = false; if (press(s + Btns[last_one]) == i) { s += Btns[last_one]; fact = true; long_gues++; } else if (fact == false) { int k = 0; for(int j = 0;j <= 3;j++) { if(k == p) k++; if(k > 3) k = 0; if(j != p) { if(press(s + Btns[j] + Btns[k]) > i) { s += Btns[j] + Btns[k]; i++; } else if (press(s + Btns[j]) == i) { s += Btns[j]; } else if(press(s + Btns[k]) == i) { s += Btns[j]; } k++; } } } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...