Submission #1167245

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11672452025-03-15 16:24:55SmuggingSpunLottery (CEOI18_lot)C++20
80 / 100
490 ms20232 KiB
#include<bits/stdc++.h>
#define taskname "C"
using namespace std;
const int lim = 1e4 + 5;
int n, len, q, a[lim];
namespace sub1{
void solve(){
vector<vector<int>>cnt(n - len + 2, vector<int>(len + 1, 0));
for(int i = 1; i + len - 1 <= n; i++){
for(int j = i + 1; j + len - 1 <= n; j++){
int s = 0;
for(int k = 0; k < len; k++){
if(a[i + k] != a[j + k]){
s++;
}
}
cnt[i][s]++;
cnt[j][s]++;
}
}
for(int i = 1; i + len - 1 <= n; i++){
for(int j = 1; j <= len; j++){
cnt[i][j] += cnt[i][j - 1];
}
}
for(int _ = 0; _ < q; _++){
int k;
cin >> k;
for(int i = 1; i + len - 1 <= n; i++){
cout << cnt[i][k] << " ";
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

lot.cpp: In function 'int main()':
lot.cpp:138:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  138 |                 freopen(taskname".inp", "r", stdin);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...