Submission #908738

#TimeUsernameProblemLanguageResultExecution timeMemory
908738AiperiiiCombo (IOI18_combo)C++14
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string s=""; string x=""; x=s; x+='A';x+=s;x+='B'; int res1=press(x); if(res1==1){ x=s;x+='A'; if(press(x)==1)s+='A'; else s+='B'; } else{ x=s;x+='X'; if(press(x)==1)s+='X'; else s+='Y'; } string t="ABXY"; string d=""; for(int i=0;i<t.size();i++){ if(t[i]!=s[0])d+=t[i]; } for(int j=1;j<N;j++){ x=s; x+=d[0];x+=s;x+=d[1]; int res1=press(x); if(res1==j+1){ x=s;x+=d[0]; if(press(x)==j+1)s+=d[0]; else s+=d[1]; } else{ s+=d[2]; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:22:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |     for(int i=0;i<t.size();i++){
      |                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...