Submission #824939

#TimeUsernameProblemLanguageResultExecution timeMemory
824939VadimKLottery (CEOI18_lot)C++17
0 / 100
31 ms65536 KiB
#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)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...