Submission #1199615

#TimeUsernameProblemLanguageResultExecution timeMemory
1199615lizaRace (IOI11_race)C++20
Compilation error
0 ms0 KiB
#include "race.h" #include <bits/stdc++.h> int best_path(int N, int K, int H[][2], int L[]) { long long sum=0; int j =0; long long rez=1e18; for(int i = 0; i < N-1; i++) { s[i]+=L[i]; while(sum > K) { sum-=L[j]; j++; } if(sum==K) { if(i-j < rez) rez = i-j+1; // rez=min(rez, i-j); } } if(rez==1e18) return 1; return rez; }

Compilation message (stderr)

race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:11:9: error: 's' was not declared in this scope
   11 |         s[i]+=L[i];
      |         ^