Submission #1028803

# Submission time Handle Problem Language Result Execution time Memory
1028803 2024-07-20T08:54:38 Z dimasnbayu Lottery (CEOI18_lot) C++14
45 / 100
483 ms 41308 KB
#include<bits/stdc++.h>
using namespace std;
const int MAX_N=10000+5;
int arr[MAX_N],much[MAX_N][MAX_N];
int main(){
    int n,l; cin>>n>>l;
    for(int i=1;i<=n;i++) cin>>arr[i];
    for(int i=1;i<=n-l+1;i++){
        for(int j=i+1;j<=n-l+1;j++){
            int cnt=0;
            for(int k=0;k<l;k++){
                if(arr[i+k]!=arr[j+k]) cnt++;
            }
            much[i][cnt]++;
            much[j][cnt]++;
        }
    }
    for(int i=1;i<=n-l+1;i++){
        for(int j=0;j<=l;j++){
            // cout<<much[i][j]<<" ";
            much[i][j]+=much[i][j-1];
        }
        // cout<<endl;
    }
    int q; cin>>q;
    while(q--){
        int x; cin>>x;
        for(int i=1;i<=n-l+1;i++) cout<<much[i][x]<<" ";
        cout<<endl;
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 700 KB Output is correct
3 Correct 1 ms 604 KB Output is correct
4 Correct 1 ms 604 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 1 ms 704 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 2 ms 1064 KB Output is correct
9 Correct 3 ms 1116 KB Output is correct
10 Correct 2 ms 1628 KB Output is correct
11 Correct 2 ms 1624 KB Output is correct
12 Correct 2 ms 1368 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 700 KB Output is correct
3 Correct 1 ms 604 KB Output is correct
4 Correct 1 ms 604 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 1 ms 704 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 2 ms 1064 KB Output is correct
9 Correct 3 ms 1116 KB Output is correct
10 Correct 2 ms 1628 KB Output is correct
11 Correct 2 ms 1624 KB Output is correct
12 Correct 2 ms 1368 KB Output is correct
13 Correct 18 ms 8536 KB Output is correct
14 Correct 443 ms 9216 KB Output is correct
15 Correct 483 ms 9288 KB Output is correct
16 Correct 303 ms 9296 KB Output is correct
17 Correct 387 ms 9312 KB Output is correct
18 Correct 309 ms 9296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 398 ms 41308 KB Memory limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 398 ms 41308 KB Memory limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 700 KB Output is correct
3 Correct 1 ms 604 KB Output is correct
4 Correct 1 ms 604 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 1 ms 704 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 2 ms 1064 KB Output is correct
9 Correct 3 ms 1116 KB Output is correct
10 Correct 2 ms 1628 KB Output is correct
11 Correct 2 ms 1624 KB Output is correct
12 Correct 2 ms 1368 KB Output is correct
13 Correct 18 ms 8536 KB Output is correct
14 Correct 443 ms 9216 KB Output is correct
15 Correct 483 ms 9288 KB Output is correct
16 Correct 303 ms 9296 KB Output is correct
17 Correct 387 ms 9312 KB Output is correct
18 Correct 309 ms 9296 KB Output is correct
19 Runtime error 398 ms 41308 KB Memory limit exceeded
20 Halted 0 ms 0 KB -