Submission #824939

# Submission time Handle Problem Language Result Execution time Memory
824939 2023-08-14T12:09:18 Z VadimK Lottery (CEOI18_lot) C++17
0 / 100
31 ms 65536 KB
#include <bits/stdc++.h>

using namespace std;

int main() {
    int n,l;
    cin>>n>>l;
    int arr[n+1];
    int sim[n+1][n+1];
    for (int i=1; i<=n; i++)
     for (int j=1; j<=n; j++)
      sim[i][j]=0;
    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 ans=0;
       for (int x=j; x<=j+l-1; x++)
        if (arr[x]!=arr[i+x-j]) ans++;
    for (int k=ans; k<=l; k++)
    {
     sim[i][k]++;
     sim[j][k]++;
    }
     }
    }
    int q;
    cin>>q;
    while (q--)
    {
        int k;
        cin>>k;
        for (int i=1; i<=n-l+1; i++)
         cout<<sim[i][k]<<" ";
         cout<<"\n";
    }
}

Compilation message

lot.cpp: In function 'int main()':
lot.cpp:35:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   35 |         for (int i=1; i<=n-l+1; i++)
      |         ^~~
lot.cpp:37:10: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   37 |          cout<<"\n";
      |          ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 31 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 31 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -