Submission #1323728

#TimeUsernameProblemLanguageResultExecution timeMemory
1323728Trisanu_DasRace (IOI11_race)C++17
Compilation error
0 ms0 KiB
#include "race.h"
#include <bits/stdc++.h>
using namespace std;

int best_path(int N, int K, int H[][2], int L[]) {
	int ans = N + 1;
	for(int i = 0; i < N - 1; i++){
		for(int j = i + 1; j < N; j++){
			int cur = 0;
			for(int k = i; k < j; k++) cur += L[k];
			if(x == K) ans = min(ans, j - i);
		}
	}
	if(ans == N + 1) return -1;
	return ans;
}

Compilation message (stderr)

race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:11:28: error: 'x' was not declared in this scope
   11 |                         if(x == K) ans = min(ans, j - i);
      |                            ^