Submission #1182904

#TimeUsernameProblemLanguageResultExecution timeMemory
1182904lioow콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" #define pb push_back #define repp(i,x,n) for(int i=x;i<=n;i++) #define rep(i,x,n) for(int i=x;i>=n;i--) using namespace std; string guess_sequence(int N){ string s=""; if(press("AB")){ if(press("A")) s+="A"; else s+="B"; } else { if(press("X")) s+="X"; else s+="Y"; } vector<char>v; char a[4]={'A','B','X','Y'}; repp(i,0,3){ if(s[0]!=a[i]) v.pb(a[i]); } repp(i,1,n-2){ int ah=press(s+v[0]+s+v[1]+v[0]+s+v[1]+v[1]+s+v[1]+v[2]); if(ah==(int)s.size()) s+=v[2]; else if(ah==(int)s.size()+2) s+=v[1]; else s+=v[0]; } if(press(s+v[0])==(int)s.size()+1) s+=v[0]; else if(press(s+v[1])==(int)s.size()+1) s+=v[1]; else s+=v[2]; return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:22:18: error: 'n' was not declared in this scope
   22 |         repp(i,1,n-2){
      |                  ^
combo.cpp:4:36: note: in definition of macro 'repp'
    4 | #define repp(i,x,n) for(int i=x;i<=n;i++)
      |                                    ^