Submission #114442

#TimeUsernameProblemLanguageResultExecution timeMemory
114442MeloricLottery (CEOI18_lot)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++> #define pb push_back #define X first #define Y second #define pii pair<int, int> #define lb lower_bound using namespace std; int n, len, q; vector<int> in, stupid; vector<pii> place; vector<vector<int>> ans, pref; vector<int> dif(int l){ vector<int> ret(q); ret[0]--; for(int i = 0; i< n-len+1; i++){ int cur = 0; for(int j = 0; j < len; j++){ if(in[i+j]!=in[l+j]){ cur++; } } if(cur<stupid[0]){ ret[0]++; } /* int ind = lb(stupid.begin(), stupid.end(), cur)-stupid.begin(); if(ind == q)continue; ret[ind]++;*/ } for(int i = 1; i < q; i++){ ret[i]+=ret[i-1]; } return ret; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> len; for(int i=0; i < n; i++){ int c; cin >> c; in.pb(c); } cin >> q; for(int i =0; i < q; i++){ int c; cin >> c; place.pb({c, i}); stupid.pb(c); } sort(place.begin(), place.end()); sort(stupid.begin(), stupid.end()); ans.assign(q, vector<int>()); pref.assign(n-len+1, vector<int>()); for(int i = 0; i < n-len+1; i++){ pref[i] = dif(i); } for(int i =0; i< q; i++){ for(int j = 0; j < n-len+1; j++){ ans[place[i].Y].pb(pref[j][i]); } } for(int i = 0; i< q; i++){ for(int j=0; j < n-len+1; j++){ cout << ans[i][j] << ' '; } cout << '\n'; } return 0; }

Compilation message (stderr)

lot.cpp:1:10: fatal error: bits/stdc++: No such file or directory
 #include <bits/stdc++>
          ^~~~~~~~~~~~~
compilation terminated.