Submission #65178

# Submission time Handle Problem Language Result Execution time Memory
65178 2018-08-07T00:19:10 Z spencercompton popa (BOI18_popa) C++14
0 / 100
61 ms 440 KB
#include <bits/stdc++.h>
#include "popa.h"
using namespace std;
// int query(int a, int b, int c, int d){
// 	return 1;
// }
vector<int> le;
vector<int> ri;
int f(int l, int r){
	if(l>r){
		return -1;
	}
	if(l==r){
		le[l] = -1;
		ri[r] = -1;
		return l;
	}
	for(int i = l; i<=r; i++){
		if(query(l,r,i,i)==1){
			le[l] = f(l,i-1);
			ri[r] = f(i+1,r);
			return i;
		}
	}
	assert(false);
	return -69;
}

int solve(int n, int* left, int *right){
	le.resize(n);
	ri.resize(n);
	int ret = f(0,n-1);
	for(int i = 0; i<n; i++){
		left[i] = le[i];
		right[i] = ri[i];
	}
	return ret;
}
// int main(){

// }
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 376 KB not a binary tree
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 61 ms 440 KB not a binary tree
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 440 KB too many queries
2 Halted 0 ms 0 KB -