Submission #396686

#TimeUsernameProblemLanguageResultExecution timeMemory
396686abdzagLottery (CEOI18_lot)C++17
25 / 100
3076 ms568 KiB
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=int(a);i<int(b);i++) #define rrep(i,a,b) for(int i=int(a);i>int(b); i--); #define all(v) v.begin(),v.end() #define trav(a,v) for(auto&a:v) using namespace std; const long long inf = 1e15; typedef long long ll; int main(){ cin.sync_with_stdio(false); ll n,L; cin >> n >> L; vector<ll> v(n); rep(i, 0, n) cin >> v[i]; ll q; cin >> q; rep(o, 0, q) { ll k; cin >> k; rep(i, 0, n - L + 1) { ll l = i, r = i + L; ll ans = 0; rep(j, 0, n - L + 1) { if (j == i)continue; ll val = 0; rep(z, 0, L) { if (v[j + z] != v[i + z])val++; } if (val <=k)ans++; } cout << ans << " "; } cout << endl; } return 0; }

Compilation message (stderr)

lot.cpp: In function 'int main()':
lot.cpp:25:7: warning: unused variable 'l' [-Wunused-variable]
   25 |    ll l = i, r = i + L;
      |       ^
lot.cpp:25:14: warning: unused variable 'r' [-Wunused-variable]
   25 |    ll l = i, r = i + L;
      |              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...