Submission #1023889

# Submission time Handle Problem Language Result Execution time Memory
1023889 2024-07-15T08:42:47 Z 12345678 Lottery (CEOI18_lot) C++17
45 / 100
411 ms 9300 KB
#include <bits/stdc++.h>

using namespace std;

const int nx=2e3+5;

int n, l, q, x, a[nx], dp[nx][nx];

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>n>>l;
    for (int i=1; i<=n; i++) cin>>a[i];
    for (int i=1; i+l-1<=n; i++)
    {
        for (int j=i+1; j+l-1<=n; j++)
        {
            int cnt=0;
            for (int k=0; k<l; k++) cnt+=(a[i+k]!=a[j+k]);
            dp[i][cnt]++, dp[j][cnt]++;
        }
        for (int j=1; j<=l; j++) dp[i][j]+=dp[i][j-1];
    }
    cin>>q;
    while (q--)
    {
        cin>>x;
        for (int i=1; i+l-1<=n; i++) cout<<dp[i][x]<<' ';
        cout<<'\n';
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 604 KB Output is correct
2 Correct 1 ms 720 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 0 ms 600 KB Output is correct
7 Correct 0 ms 604 KB Output is correct
8 Correct 2 ms 1116 KB Output is correct
9 Correct 2 ms 1116 KB Output is correct
10 Correct 1 ms 1628 KB Output is correct
11 Correct 2 ms 1628 KB Output is correct
12 Correct 4 ms 1372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 604 KB Output is correct
2 Correct 1 ms 720 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 0 ms 600 KB Output is correct
7 Correct 0 ms 604 KB Output is correct
8 Correct 2 ms 1116 KB Output is correct
9 Correct 2 ms 1116 KB Output is correct
10 Correct 1 ms 1628 KB Output is correct
11 Correct 2 ms 1628 KB Output is correct
12 Correct 4 ms 1372 KB Output is correct
13 Correct 11 ms 8536 KB Output is correct
14 Correct 411 ms 9284 KB Output is correct
15 Correct 403 ms 9300 KB Output is correct
16 Correct 258 ms 9040 KB Output is correct
17 Correct 332 ms 9300 KB Output is correct
18 Correct 318 ms 9296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 604 KB Output is correct
2 Correct 1 ms 720 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 0 ms 600 KB Output is correct
7 Correct 0 ms 604 KB Output is correct
8 Correct 2 ms 1116 KB Output is correct
9 Correct 2 ms 1116 KB Output is correct
10 Correct 1 ms 1628 KB Output is correct
11 Correct 2 ms 1628 KB Output is correct
12 Correct 4 ms 1372 KB Output is correct
13 Correct 11 ms 8536 KB Output is correct
14 Correct 411 ms 9284 KB Output is correct
15 Correct 403 ms 9300 KB Output is correct
16 Correct 258 ms 9040 KB Output is correct
17 Correct 332 ms 9300 KB Output is correct
18 Correct 318 ms 9296 KB Output is correct
19 Incorrect 1 ms 344 KB Output isn't correct
20 Halted 0 ms 0 KB -