Submission #61940

# Submission time Handle Problem Language Result Execution time Memory
61940 2018-07-27T05:58:05 Z koosaga(#1793) popa (BOI18_popa) C++11
0 / 100
3 ms 308 KB
#include <bits/stdc++.h>
#include "popa.h"
using namespace std;
typedef pair<int, int> pi;
typedef long long lint;

int solve(int N, int *l, int *r){
	for(int i=0; i<N; i++) l[i] = r[i] = -1;
	int cur_root = 0;
	for(int i=1; i<N; i++){
		vector<int> v;
		for(int j=cur_root; j!=-1; j=r[j]){
			v.push_back(j);
		}
		while(v.size()){
			int pos = v.back();
			while(l[pos] != -1) pos = l[pos];
			if(query(l[pos], i, v.back(), v.back()) == 1){
				break;
			}
			else v.pop_back();
		}
		if(v.empty()){
			l[i] = cur_root;
			cur_root = i;
		}
		else{
			r[v.back()] = i;
		}
	}
}

Compilation message

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB invalid argument
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 308 KB invalid argument
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 308 KB invalid argument
2 Halted 0 ms 0 KB -