Submission #534565

#TimeUsernameProblemLanguageResultExecution timeMemory
534565Abdulmohsen1284콤보 (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include"bits/stdc++.h" using namespace std; std::string guess_sequence(int N) { string g,s; g="AB"; long long ans=press(g); if(ans==1) { g="A"; ans=press(g); if(ans==1) s="A"; else s="B"; } else { g="X"; ans=press(g); if(ans==1) s="X"; else s="Y"; } string a; long long cur=0; string chek="ABXY"; for(int i=0;i<(int)chek.size();i++) { if(s[0]!=chek[i]) { a+=chek[i]; } } chek=a; for(int i=1;i<N-1;i++) { string rn; rn=s+chek[0]; for(int j=0;j<3;j++) rn+=s+chek[1]+chek[j]; ans=press(rn); if(ans==(long long)s.size()) { s+=chek[2]; } else if(ans==(long long)s.size()+1) { s+=chek[0]; } else { s+=chek[1]; } } if(N!=1) { string rn=s+chek[0]; ans=press(rn); if(ans==(long long)s.size()+1) { rn=s+chek[0]; } else { rn=s+chek[1]; ans=press(rn); if(ans==(long long)s.size()+1) s+=chek[1]; else s+=chek[2]; } } return s; }

Compilation message (stderr)

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