제출 #291286

#제출 시각아이디문제언어결과실행 시간메모리
291286juggernaut콤보 (IOI18_combo)C++14
100 / 100
40 ms580 KiB
#include"combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int n){ string res; int i=2,q; char a='A',b='B',c='Y'; if(press("XY")) if(press("X"))res="X"; else res="Y",c='X'; else if(press("A"))res="A",a='X'; else res="B",b='X'; for(;i<n;i++){ q=press(res+a+res+b+a+res+b+b+res+b+c); if(q==i)res+=a; else if(q==i+1)res+=b; else res+=c; } if(i==n) if(press(res+a)==n)res+=a; else if(press(res+b)==n)res+=b; else res+=c; return res; }

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
   20 |     if(i==n)
      |       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...