Submission #1210816

#TimeUsernameProblemLanguageResultExecution timeMemory
1210816islam_2010경주 (Race) (IOI11_race)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize("O3") #include "race.h" #include <bits/stdc++.h> using namespace std; const int sz = 1e5+5; int best_path(int n, int k, int h[][2], int l[]){ int s = 0; int mn = INT_MAX; int le = 0; for(int i = 0; i < n-1; i++){ s+=l[i]; while(s>k){ s-=l[le++]; }if(sum == k){ mn = min(mn, i-le+1); } }return (mn == INT_MAX ? -1 : mn); }

Compilation message (stderr)

race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:16:13: error: 'sum' was not declared in this scope
   16 |         }if(sum == k){
      |             ^~~