Submission #473979

# Submission time Handle Problem Language Result Execution time Memory
473979 2021-09-16T13:56:02 Z ZaZo_ Lottery (CEOI18_lot) C++14
45 / 100
355 ms 16844 KB
#include <bits/stdc++.h>
#define ZAZO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//#define int long long
const int N = 2010;
using namespace std;
int n , l ,q;
int v[N][N];
int ans[N],arr[N];
int32_t main() {
  ZAZO
  cin >> n >> l ;
  for(int i = 0 ; i < n ; i ++)
    cin >> arr[i];
  for(int i = 0 ; i < n-l+1 ; i ++)
  {
    for(int j = i+1 ; j < n-l+1 ; j ++)
    {
      int cur=0;
      for(int p = 0 ; p < l ; p ++)  if(arr[i+p] != arr[j+p] ) cur++;
      v[i][j]=v[j][i]=cur;
    }
  }
  cin>>q;
  while(q--){
  int k;
  cin>>k;
  for(int i = 0 ; i < n-l+1 ; i ++)
  {
    ans[i]=-1;
    for(int j = 0 ; j < n-l+1 ; j++)
    {
      if(v[i][j]<=k) ans[i]++;
    }
    cout<<ans[i]<<" ";
  }
  cout<<'\n';
  }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 588 KB Output is correct
3 Correct 1 ms 588 KB Output is correct
4 Correct 1 ms 460 KB Output is correct
5 Correct 1 ms 460 KB Output is correct
6 Correct 1 ms 716 KB Output is correct
7 Correct 1 ms 588 KB Output is correct
8 Correct 3 ms 972 KB Output is correct
9 Correct 3 ms 972 KB Output is correct
10 Correct 4 ms 1740 KB Output is correct
11 Correct 4 ms 1740 KB Output is correct
12 Correct 4 ms 1608 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 588 KB Output is correct
3 Correct 1 ms 588 KB Output is correct
4 Correct 1 ms 460 KB Output is correct
5 Correct 1 ms 460 KB Output is correct
6 Correct 1 ms 716 KB Output is correct
7 Correct 1 ms 588 KB Output is correct
8 Correct 3 ms 972 KB Output is correct
9 Correct 3 ms 972 KB Output is correct
10 Correct 4 ms 1740 KB Output is correct
11 Correct 4 ms 1740 KB Output is correct
12 Correct 4 ms 1608 KB Output is correct
13 Correct 63 ms 16052 KB Output is correct
14 Correct 354 ms 10840 KB Output is correct
15 Correct 355 ms 10856 KB Output is correct
16 Correct 311 ms 14428 KB Output is correct
17 Correct 335 ms 13456 KB Output is correct
18 Correct 330 ms 13624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 32 ms 16844 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 32 ms 16844 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 588 KB Output is correct
3 Correct 1 ms 588 KB Output is correct
4 Correct 1 ms 460 KB Output is correct
5 Correct 1 ms 460 KB Output is correct
6 Correct 1 ms 716 KB Output is correct
7 Correct 1 ms 588 KB Output is correct
8 Correct 3 ms 972 KB Output is correct
9 Correct 3 ms 972 KB Output is correct
10 Correct 4 ms 1740 KB Output is correct
11 Correct 4 ms 1740 KB Output is correct
12 Correct 4 ms 1608 KB Output is correct
13 Correct 63 ms 16052 KB Output is correct
14 Correct 354 ms 10840 KB Output is correct
15 Correct 355 ms 10856 KB Output is correct
16 Correct 311 ms 14428 KB Output is correct
17 Correct 335 ms 13456 KB Output is correct
18 Correct 330 ms 13624 KB Output is correct
19 Runtime error 32 ms 16844 KB Execution killed with signal 11
20 Halted 0 ms 0 KB -