Submission #118615

#TimeUsernameProblemLanguageResultExecution timeMemory
118615AutoratchCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include <bits/stdc++.h>
 #include "combo.h"
   using namespace std;
   
   string guess_sequence(int n)
   {
       string all = "ABXY",pos,ans;
       char f;
       for(int i = 0;i < 4;i++) if(press(""+all[i])) f = all[i]; else pos+=all[i];
       for(int i = 1;i < n;i++)
       {
           string tmp = ans+pos[0];
           for(int j = 0;j < 3;j++) tmp+=ans+pos[1]+pos[j];
           int ret = press(tmp);
           if(ret==0) ans+=pos[2];
           else if(ret==i) ans+=pos[0];
           else ans+=pos[1];
       }
       return ans;
   }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:13: warning: variable 'f' set but not used [-Wunused-but-set-variable]
    8 |        char f;
      |             ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...