Submission #1323726

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

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:10:28: error: 'x' was not declared in this scope
   10 |                         if(x == K) ans = min(ans, j - i);
      |                            ^
race.cpp:10:42: error: 'min' was not declared in this scope; did you mean 'std::min'?
   10 |                         if(x == K) ans = min(ans, j - i);
      |                                          ^~~
      |                                          std::min
In file included from /usr/include/c++/13/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from race.cpp:2:
/usr/include/c++/13/bits/stl_algo.h:5785:5: note: 'std::min' declared here
 5785 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~