제출 #379901

#제출 시각아이디문제언어결과실행 시간메모리
379901sad콤보 (IOI18_combo)C++14
97 / 100
57 ms552 KiB
#include "combo.h" #include<bits/stdc++.h> #define ll long long #define fi first #define se second using namespace std; char w; void go () { string s; s+='A'; if(press(s)){ w='A';return; } s[0]='B'; if(press(s)){ w='B';return; } s[0]='X'; if(press(s)){ w='X';return; } w='Y'; return; } string guess_sequence(int n) { go(); string s; s+=w; if(n==1)return s; string t; if(w!='A')t+='A'; if(w!='B')t+='B'; if(w!='X')t+='X'; if(w!='Y')t+='Y'; int re=1; for(int i=1;i<n-1;i++) { string ss=s+t[0]+s+t[1]+t[0]+s+t[1]+t[1]+s+t[1]+t[2]; int x=press(ss); if(x==i)s+=t[2]; else if(x==i+1)s+=t[0]; else s+=t[1]; } string s0=s+t[0]; string s1=s+t[1]; if(press(s0)==n) s+=t[0]; else if(press(s1)==n)s+=t[1]; else s+=t[2]; return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:36:7: warning: unused variable 're' [-Wunused-variable]
   36 |   int re=1;
      |       ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...