제출 #1324366

#제출 시각아이디문제언어결과실행 시간메모리
1324366silence25경주 (Race) (IOI11_race)C++20
컴파일 에러
0 ms0 KiB
#include "race.h"
#include "bits/stdc++.h"

using namespace std;

const int INF = 1e9 + 7;
const int N = 105;
ll pref[N];

int best_path(int n,int k,int h[][2],int l[]){
	int m = n - 1;
	for(int i = 1;i<=m;++i)
		pref[i] = pref[i - 1] + l[i - 1];
	int ans = INF;
	for(int l = 1;l<=m;++l)
		for(int r = l;r<=m;++r)
			if(pref[r] - pref[l - 1] == k)
				ans = min(ans,r - l + 1);
	if(ans == INF)
		ans = -1;
	return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

race.cpp:8:1: error: 'll' does not name a type
    8 | ll pref[N];
      | ^~
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:13:17: error: 'pref' was not declared in this scope
   13 |                 pref[i] = pref[i - 1] + l[i - 1];
      |                 ^~~~
race.cpp:17:28: error: 'pref' was not declared in this scope
   17 |                         if(pref[r] - pref[l - 1] == k)
      |                            ^~~~