Submission #1182893

#TimeUsernameProblemLanguageResultExecution timeMemory
1182893lioow콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define pb push_back #define int long long #define repp(i,x,n) for(int i=x;i<=n;i++) #define rep(i,x,n) for(int i=x;i>=n;i--) #define cy cout<<"YES"<<endl #define cn cout<<"NO"<<endl #define r0 return 0 #define fi first #define se second #define liow ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define jelek cout<<"jelek"<<endl #define pii pair<int,int> #define all(v) v.begin(),v.end() #define pi pair<pair<int,int>,pair<int,int>> #define p3 pair<int,pair<int,int>> #define p2 #define tp tuple<int,int,int> #define fl fflush(stdout) #define lb long double #define p5 pair<int,pair<pair<int,int>,pair<int,int>>> #pragma GCC optimize ("O2") #pragma GCC optimize ("unroll-loops") using namespace std; int dx[4]={-1,0,1,0}; int dy[4]={0,-1,0,1}; using namespace __gnu_pbds; typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset; const int mod=1e9+7,maxn=1e5+5,N=5e5+5,INF=1e18; const int MOD=998244353; //const int MOD=1e6+3; mt19937_64 rng((unsigned int) chrono::steady_clock::now().time_since_epoch().count()); pii dir[8]={{-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1}}; 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; } signed main(){ liow; int t=1; // cin>>t; while(t--){ solve(); } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(long long int)':
combo.cpp:39:12: error: 'press' was not declared in this scope
   39 |         if(press("AB")){
      |            ^~~~~
combo.cpp:52:24: error: 'press' was not declared in this scope
   52 |                 int ah=press(s+v[0]+s+v[1]+v[0]+s+v[1]+v[1]+s+v[1]+v[2]);
      |                        ^~~~~
combo.cpp:57:12: error: 'press' was not declared in this scope
   57 |         if(press(s+v[0])==(int)s.size()+1) s+=v[0];
      |            ^~~~~
combo.cpp: In function 'int main()':
combo.cpp:68:9: error: 'solve' was not declared in this scope
   68 |         solve();
      |         ^~~~~