Submission #64467

# Submission time Handle Problem Language Result Execution time Memory
64467 2018-08-04T15:32:20 Z TadijaSebez popa (BOI18_popa) C++11
0 / 100
11 ms 512 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;
         ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 252 KB not a binary tree
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 376 KB not a binary tree
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 512 KB not a binary tree
2 Halted 0 ms 0 KB -