Submission #917963

# Submission time Handle Problem Language Result Execution time Memory
917963 2024-01-29T08:04:34 Z PM1 Lottery (CEOI18_lot) C++17
45 / 100
819 ms 16132 KB
#include <bits/stdc++.h>
using namespace std;
const int mxn=2000+5;
int dif[mxn][mxn],n,q,a[mxn],l;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>l;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	for(int i=1;i<=n-l+1;i++){
		for(int j=1;j<=n-l+1;j++){
			for(int k=0;k<l;k++){
				if(a[i+k]!=a[j+k])dif[i][j]++;
			}
		}
	}
	cin>>q;
	for(int i=1;i<=q;i++){
		int x;
		cin>>x;
		for(int j=1;j<=n-l+1;j++){
			int res=0;
			for(int k=1;k<=n-l+1;k++)
				res+=(dif[j][k]>x || j==k)?0:1;
			cout<<res<<" ";
		}
		cout<<'\n';
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2904 KB Output is correct
8 Correct 4 ms 2396 KB Output is correct
9 Correct 3 ms 2396 KB Output is correct
10 Correct 4 ms 2648 KB Output is correct
11 Correct 4 ms 4700 KB Output is correct
12 Correct 4 ms 2636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2904 KB Output is correct
8 Correct 4 ms 2396 KB Output is correct
9 Correct 3 ms 2396 KB Output is correct
10 Correct 4 ms 2648 KB Output is correct
11 Correct 4 ms 4700 KB Output is correct
12 Correct 4 ms 2636 KB Output is correct
13 Correct 45 ms 16132 KB Output is correct
14 Correct 819 ms 12948 KB Output is correct
15 Correct 738 ms 13140 KB Output is correct
16 Correct 496 ms 15188 KB Output is correct
17 Correct 613 ms 15232 KB Output is correct
18 Correct 614 ms 15008 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2904 KB Output is correct
8 Correct 4 ms 2396 KB Output is correct
9 Correct 3 ms 2396 KB Output is correct
10 Correct 4 ms 2648 KB Output is correct
11 Correct 4 ms 4700 KB Output is correct
12 Correct 4 ms 2636 KB Output is correct
13 Correct 45 ms 16132 KB Output is correct
14 Correct 819 ms 12948 KB Output is correct
15 Correct 738 ms 13140 KB Output is correct
16 Correct 496 ms 15188 KB Output is correct
17 Correct 613 ms 15232 KB Output is correct
18 Correct 614 ms 15008 KB Output is correct
19 Incorrect 0 ms 348 KB Output isn't correct
20 Halted 0 ms 0 KB -