Submission #139443

#TimeUsernameProblemLanguageResultExecution timeMemory
139443redaRace (IOI11_race)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std ;
int best_path(int N,int K,vector<vector<int>> H,vector<int>L)
{
            int start = -1;
	        int endr = -1;
	        int mn = 1e9+7;

	        for(int i = 0; i < L.size(); i++) {

	            int currentSum = 0;
            for(int j = i; j < L.size()&& (j-i+1) < mn; j++) {
                currentSum += L[j];
                if(currentSum == K) {
	                    start = i;
	                    endr = j;
	                    mn = endr- start + 1;
	                    break;
}	            }
        }
 return mn;

}

Compilation message (stderr)

race.cpp: In function 'int best_path(int, int, std::vector<std::vector<int> >, std::vector<int>)':
race.cpp:9:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          for(int i = 0; i < L.size(); i++) {
                         ~~^~~~~~~~~~
race.cpp:12:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int j = i; j < L.size()&& (j-i+1) < mn; j++) {
                            ~~^~~~~~~~~~
/tmp/cc9mWEEC.o: In function `main':
grader.cpp:(.text.startup+0x20): undefined reference to `best_path(int, int, int (*) [2], int*)'
collect2: error: ld returned 1 exit status