제출 #1199615

#제출 시각아이디문제언어결과실행 시간메모리
1199615lizaRace (IOI11_race)C++20
컴파일 에러
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;
}

컴파일 시 표준 에러 (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];
      |         ^