제출 #385842

#제출 시각아이디문제언어결과실행 시간메모리
385842ismoilov콤보 (IOI18_combo)C++14
5 / 100
2 ms200 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int n) { string s, c = "ABXY"; int f, x; f = press("AB"); if(f > 0) { x = press("A"); if(x > 0) s = "A"; else s = "B"; } else { x = press("X"); if(x > 0) s = "X"; else s = "Y"; } f = 1; c.erase(c.find(s), 1); for(int i = 1; i < n-1; i ++) { //cout << f << " " << s << " // "; string v = s + c[1] + s + c[0] + c[0] + s + c[0] + c[1] + s + c[0] + c[2]; x = press(v); if(x == f) { s += c[2]; f ++; continue; } if(x - f == 1) { s += c[1]; f ++; continue; } s += c[0]; f ++; } x = press(s + c[0]); if(x == n) return s+c[0]; x = press(s + c[1]); if(x == n) return s+c[1]; return s+c[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...