Submission #61952

# Submission time Handle Problem Language Result Execution time Memory
61952 2018-07-27T06:23:48 Z 김현수(#2139) popa (BOI18_popa) C++11
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include"popa.h"

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(N);
	for(int i=1;i<N;i++) {
		int P = 0;
		while(!S.empty()) {
			int T = S.back();
			if(Right[T] != -1) continue;
			if(query(T, T, T, i)) {
				Right(T) = i;
				break;
			}
			else S.pop_back();
		}
		if(S.empty()) {
			Left[i] = P;
		}
		S.push_back(i);
	}
}

Compilation message

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:8:2: error: 'vector' was not declared in this scope
  vector<int> S;
  ^~~~~~
popa.cpp:8:2: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86,
                 from popa.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:216:11: note:   'std::vector'
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
popa.cpp:8:9: error: expected primary-expression before 'int'
  vector<int> S;
         ^~~
popa.cpp:9:2: error: 'S' was not declared in this scope
  S.push_back(N);
  ^
popa.cpp:16:12: error: 'Right' cannot be used as a function
     Right(T) = i;
            ^
popa.cpp:26:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^