Submission #61957

# Submission time Handle Problem Language Result Execution time Memory
61957 2018-07-27T06:28:52 Z 김현수(#2139) popa (BOI18_popa) C++11
0 / 100
16 ms 516 KB
#include<bits/stdc++.h>
#include"popa.h"
using namespace std;

int solve (int N, int *Left, int *Right) {
	for(int i=0;i<N;i++) {
		Left[i] = Right[i] = -1;
	}
	vector<int> S;
	S.push_back(0);
	for(int i=1;i<N;i++) {
		int T;
		while(!S.empty()) {
			T = S.back();
			if(Right[T] == -1 && query(T, T, T, i)) {
				Right[T] = i;
				break;
			}
			else S.pop_back();
		}
		if(S.empty()) {
			Left[i] = T;
		}
		S.push_back(i);
	}
	return S[0];
}

Compilation message

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:22:12: warning: 'T' may be used uninitialized in this function [-Wmaybe-uninitialized]
    Left[i] = T;
    ~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB not a valid solution
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 384 KB not a valid solution
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 516 KB not a valid solution
2 Halted 0 ms 0 KB -