Submission #156403

#TimeUsernameProblemLanguageResultExecution timeMemory
156403InfiniteJestCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include <fstream> #include <vector> #include <queue> #include <algorithm> #include <math.h> #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; ifstream in("input.txt"); ofstream out("output.txt"); typedef long long ll; int press(string p); int n; string s; vector<string> p; string guess_sequence(int N){ n=N; if(press("AB")>=1){ if(press("A")>=1)s[0]='A'; else s[0]='B'; } else{ if(press("X")>=1)s[0]='X'; else s[0]='Y'; } if(s[0]!='A')p.pb("A"); if(s[0]!='B')p.pb("B"); if(s[0]!='X')p.pb("X"); if(s[0]!='Y')p.pb("Y"); for(int i=1;i<=n-2;i++){ int k=press(s+p[0]+s+p[1]+p[0]+s+p[1]+p[2]+s+p[1]+p[1]); if(k==i+1){ s+=p[0]; } else if(k>i+1){ d+=p[1]; } else{ s+=p[2]; } } if(press(s+p[0]+s+p[1])==n){ if(press(s+p[0])==n)s+=p[0]; else s+=p[1]; } else{ s+=p[2]; } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:43:7: error: 'd' was not declared in this scope
   43 |       d+=p[1];
      |       ^