Submission #1272815

#TimeUsernameProblemLanguageResultExecution timeMemory
1272815quanduongxuan12콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define name "combo" #define MAXN 8008 #define pb push_back #define pf push_front #define ll long long #define ii pair<int, int> #define fs first #define sc second #define ill pair<int, ll> #define lli pair<ll, int> #define llll pair<ll, ll> #define all(v) v.begin(),v.end() #define uni(v) v.erase(unique(all(v)),v.end()) #define bit(n,i) (((n)>>(i))&1) #define FOR(i,a,b) for (int i=(a),_b=(b); i<=_b; i++) #define FORD(i,a,b) for (int i=(a),_b=(b); i>=_b; i--) #define MASK(i) (1LL<<(i)) const int INF=1e9; const int MOD=1e9+7; void add(int &u, int v){ u+=v; if (u>=MOD) u-=MOD; } void sub(int &u, int v){ u-=v; if (u<0) u+=MOD; } void minimize(int &u, int v){ u=min(u,v); } void maximize(int &u, int v){ u=max(u,v); } long long Rand(long long l, long long r){ ll tmp=0; FOR(i,1,4) tmp=((tmp<<15)^(((1<<15)-1)&rand())); return l+tmp%(r-l+1); } #include <combo.h> /* int kmp[MAXN],match[MAXN]; string st; int n; int press(string p){ p=" "+p; int k=0,res=0; FOR(i,1,(int)p.size()-1){ while (k>0&&p[i]!=st[k+1]) k=kmp[k]; match[i]=(p[i]==st[k+1]?++k:0); maximize(res,match[i]); } return res; } */ string s[4]={"A","B","X","Y"}; string guess_sequence(int N){ string kq=""; ///find 1st letter string tmp=""; tmp=s[0]+s[1]; int u=-1; if (press(tmp)>0){ if (press(s[0])>0){ kq+=s[0]; u=0; } else{ kq+=s[1]; u=1; } } else{ if (press(s[2])>0){ u=2; kq+=s[2]; } else{ u=3; kq+=s[3]; } } swap(s[0],s[u]); u=0; ///2nd to (N-1)th FOR(i,2,N-1){ tmp=""; FOR(j,1,3){ tmp+=kq+s[1]+s[j]; } tmp+=kq+s[2]+s[0]; // cout<<tmp<<" "; int x=press(tmp); // cout<<x<<" "; if (x==i-1+2){ kq+=s[1]; } else if (x==i-1+1){ kq+=s[2]; } else{ kq+=s[3]; } //cout<<kq<<"\n"; } ///Nth tmp=kq+s[1]; if (press(tmp)==N){ kq+=s[1]; } else{ tmp=kq+s[2]; if (press(tmp)==N){ kq+=s[2]; } else kq+=s[3]; } return kq; } /* int main() { cin>>n; cin>>st; st=" "+st; kmp[1]=0; int k=0; FOR(i,2,n){ while (k>0&&st[i]!=st[k+1]) k=kmp[k]; kmp[i]=(st[i]==st[k+1]?++k:0); } cout<<guess_sequence(n); return 0; } */

Compilation message (stderr)

combo.cpp:41:10: fatal error: combo.h: No such file or directory
   41 | #include <combo.h>
      |          ^~~~~~~~~
compilation terminated.