제출 #385598

#제출 시각아이디문제언어결과실행 시간메모리
385598ismoilov콤보 (IOI18_combo)C++14
30 / 100
45 ms276 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int N) { int n = N; string s, c = "ABXY"; for(int i = 0; i < 4; i ++) { for(int j = 0; j < n; j ++) s += c[i]; int x = press(s); if(x > 0) break; s = ""; } c.erase((c.find(s[0])), 1); int f = 1, i = 1, j = 0; while(f != n) { for(int k = i; k < n; k ++) s[k] = c[j]; int x = press(s); if(x == f) j ++, j %= 3; else { i += x - f, f = x, j = (j + 1)%3; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...