Submission #28834

# Submission time Handle Problem Language Result Execution time Memory
28834 2017-07-17T09:34:07 Z aybala Race (IOI11_race) C++11
Compilation error
0 ms 0 KB
#include "race.h"

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

Compilation message

race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:13:10: error: 'solution' was not declared in this scope
    if(x==solution && ans>j-i+1)
          ^~~~~~~~
race.cpp:13:10: note: suggested alternative: 'union'
    if(x==solution && ans>j-i+1)
          ^~~~~~~~
          union