Submission #1191861

#TimeUsernameProblemLanguageResultExecution timeMemory
1191861p4r4d0_xCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; #define pb push_back string guess_sequence(int N) { vector<char> a = {'A', 'B', 'X', 'Y'}; string s = ""; for(int i = 0; i < 4; ++i){ s += a[i]; if(press(s) == 1){ break; } else s = ""; } vector<char> b; for(int i = 0; i < 4; ++i){ if(a[i] != s[0]){ b.pb(a[i]); } } vector<string> vs; sort(begin(b), end(b)); do{ string st = ""; for(int i = 0; i < 3; ++i){ st += b[i]; } vs.pb(st); } while(next_permutation(begin(b), end(b))); ll cnt = 1; while(cnt != N){ if(cnt + 3 <= N){ for(auto &x : vs){ if(press(s + x) == cnt + 3){ s += x; cnt += 3; break; } } } else{ for(int i = 0; i < 4; ++i){ if(press(s + a[i]) == cnt + 1){ s += a[i]; cnt++; break; } } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:32:3: error: 'll' was not declared in this scope
   32 |   ll cnt = 1;
      |   ^~
combo.cpp:33:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   33 |   while(cnt != N){
      |         ^~~
      |         int