# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
824939 | VadimK | Lottery (CEOI18_lot) | C++17 | 31 ms | 65536 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |