제출 #303468

#제출 시각아이디문제언어결과실행 시간메모리
303468re404d콤보 (IOI18_combo)C++11
100 / 100
42 ms664 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string s = "", temp; string l; int i, v, j; v = press("AB"); if (v) { v = press("A"); if (v) { s = "A"; l = "BXY"; } else { s = "B"; l = "AXY"; } } else { v = press("X"); if (v) { s = "X"; l = "ABY"; } else { s = "Y"; l = "ABX"; } } for (i = 2; i<N; i++) { temp = s + l[0]; for (j = 0; j<3; j++) temp = temp + s + l[1] + l[j]; v = press(temp); if (v == i-1) s = s + l[2]; else if (v == i) s = s + l[0]; else s = s + l[1]; } if (N > 1) { for (j = 0; j<2; j++) { temp = s + l[j]; v = press(temp); if (v == i) { s = s + l[j]; break; } } if (j == 2) s = s + l[j]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...