제출 #910010

#제출 시각아이디문제언어결과실행 시간메모리
910010vjudge1Race (IOI11_race)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int best_path(int N,int K,int H[][2],int L[]){ for (int i =1; i<n; i++){ int sum; for (int ii = 0; ii <n-i;ii++){ for (int j = 0; j<i;j++){ sum += L[j+ii]; } if (sum == K)return ii; sum = 0; } } }

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

race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:5:19: error: 'n' was not declared in this scope
    5 |  for (int i =1; i<n; i++){
      |                   ^