답안 #64465

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
64465 2018-08-04T15:31:48 Z TadijaSebez popa (BOI18_popa) C++11
컴파일 오류
0 ms 0 KB
#include "popa.h"
#include <stdio.h>
const int N=1050;
int S[N],c;
int Solve(int n, int *l, int *r)
{
	int i;
	int root;
	for(i=0;i<n;i++)
	{
		while(c && query(S[c],i,i,i))
		{
			l[i]=S[c];
			r[S[c]]=r[i];
			c--;
		}
		if(!c) root=i;
		else r[S[c]]=i;
		S[++c]=i;
	}
	return root;
}

Compilation message

popa.cpp: In function 'int Solve(int, int*, int*)':
popa.cpp:21:9: warning: 'root' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return root;
         ^~~~
/tmp/ccO5C2dk.o: In function `main':
grader.cpp:(.text.startup+0xd9): undefined reference to `solve(int, int*, int*)'
collect2: error: ld returned 1 exit status