제출 #285423

#제출 시각아이디문제언어결과실행 시간메모리
285423Pichon5콤보 (IOI18_combo)C++17
97 / 100
40 ms652 KiB
#include "combo.h" #include <bits/stdc++.h> #define pb push_back using namespace std; string guess_sequence(int N){ vector<char>v; char arr[4]={'A','B','X','Y'}; int c=0; string s="",ss; if(press("X")==1){ s+='X'; }else{ if(press("Y")==1){ s+='Y'; }else{ if(press("A")==1){ s+='A'; }else{ s+='B'; } } } for(int i=0;i<4;i++){ if(arr[i]!=s[0]){ v.pb(arr[i]); } } for(int i=2;i<=N;i++){ ss=s; if(i==N){ ss+=v[0]; if(press(ss)==i){ s=ss; break; } ss=s+v[1]; if(press(ss)==i){ s=ss; break; } s+=v[2]; break; } ss=ss+v[0]+ss+v[1]+v[0]+ss+v[1]+v[1]+ss+v[1]+v[2]; int x=press(ss); if(x==i){ s+=v[0]; continue; } if(x==i+1){ s+=v[1]; continue; } s+=v[2]; } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:9: warning: unused variable 'c' [-Wunused-variable]
    8 |     int c=0;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...