Submission #1221268

#TimeUsernameProblemLanguageResultExecution timeMemory
1221268hmms127Combo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include<iostream> #include<vector> #include<set> #include<algorithm> #include<stack> using namespace std; const int mod=1e9+7; string guess_sequence(int N); int press(string s); string l; string guess_sequence(int N) { string z; if(press("AB")) { if(press("A")) { z+='A'; l="BXY"; } else { z+='B'; l="AXY"; } } else { if(press("X")) { z+='X'; l="ABY"; } else { z+='Y'; l="ABX"; } } while(z.size()<N-1) { int cnt=press(z+l[0]+l[0]+z+l[0]+l[1]+z+l[0]+l[2]+z+l[1]); if(cnt==i) { z+=l[2]; } else if(cnt==i+1) { z+=l[1]; } else { z+=l[0]; } } if(z.size()==N-1) { if(press(z+l[0])) { z+=l[0]; } else if(press(z+l[1])) { z+=l[1]; } else { z+=l[2]; } } return z; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:35:17: error: 'i' was not declared in this scope
   35 |         if(cnt==i) {
      |                 ^