Submission #1138511

#TimeUsernameProblemLanguageResultExecution timeMemory
1138511bestbestCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define en '\n' #define sp ' ' typedef long long ll; #define Linux ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define pii pair<int,int> #include "combo.h" string guess_sequence(int N) { string S = "",a; if(press("A")==1){ S+='A'; a="BXY"; } else if(press("B")==1){ S+='B'; a="AXY"; } else if(press("X")==1){ S+='X'; a="ABY"; } else { S+='Y'; a="ABX"; } int coins; string p=S,o=S; if(n==1)return S; for(int i=1;i+1<N;i++){ p=o+a[0]+a[0]+o+a[0]+a[1]+o+a[0]+a[2]+o+a[1]; //cout << p << sp << p.size() << sp; coins=press(p); if(coins==o.size()+2)o+=a[0]; else if(coins==o.size()+1)o+=a[1]; else if(coins==o.size())o+=a[2]; //else cout << "Bruh"; //cout<< sp << coins << sp << o.size() << sp << o << en; } if(press(o+a[0])==N){ o+=a[0]; } else if(press(o+a[1])==N){ o+=a[1]; } else o+=a[2]; //cout << o << en; return o; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:35:6: error: 'n' was not declared in this scope
   35 |   if(n==1)return S;
      |      ^