제출 #305459

#제출 시각아이디문제언어결과실행 시간메모리
305459juggernautCombo (IOI18_combo)C++14
100 / 100
38 ms556 KiB
#include"combo.h" #include<bits/stdc++.h> using namespace std; #ifdef _static-libgcc #include"combo.cpp" #endif 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:4:15: warning: extra tokens at end of #ifdef directive
    4 | #ifdef _static-libgcc
      |               ^
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
   23 |     if(i==n)
      |       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...