#include <bits/stdc++.h>
using namespace std;
#define eb emplace_back
#define pb push_back
#define ppb pop_back
#define ub upper_bound
#define lb lower_bound
#define bs binary_search
#define cl(a,s) memset((a),0,sizeof((a)[0])*(s))
#define all(x) (x).begin() , (x).end()
#define fi first
#define se second
#define int int
using pii = pair<int,int>;
using ll = long long;
const int maxn = 10005;
const int maxq = 105;
const int inf = 1e9;
const int mod = 1e9+7;
int n,a[maxn],l,q,k;
int ans[maxn];
map<vector<int>,int> mp;
int32_t main () {
//freopen("in","r",stdin); freopen("out","w",stdout);
ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0);
cin >> n >> l;
for(int i=1;i<=n;i++) cin >> a[i];
cin >> q;
for(int i=1;i<=q;i++) cin >> k;
vector<int> vec(l);
for(int i=1;i+l-1<=n;i++) {
for(int j=i;j<=i+l-1;j++) vec[j-i] = a[j];
mp[vec]++;
}
for(int i=1;i+l-1<=n;i++) {
for(int j=i;j<=i+l-1;j++) vec[j-i] = a[j];
cout << mp[vec]-1 << " ";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
492 KB |
Output is correct |
2 |
Correct |
4 ms |
492 KB |
Output is correct |
3 |
Correct |
5 ms |
492 KB |
Output is correct |
4 |
Correct |
37 ms |
2540 KB |
Output is correct |
5 |
Runtime error |
184 ms |
65540 KB |
Execution killed with signal 9 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
492 KB |
Output is correct |
2 |
Correct |
4 ms |
492 KB |
Output is correct |
3 |
Correct |
5 ms |
492 KB |
Output is correct |
4 |
Correct |
37 ms |
2540 KB |
Output is correct |
5 |
Runtime error |
184 ms |
65540 KB |
Execution killed with signal 9 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |