Submission #151425

# Submission time Handle Problem Language Result Execution time Memory
151425 2019-09-02T20:58:21 Z ioilolcom List of Unique Integers (FXCUP4_unique) C++17
Compilation error
0 ms 0 KB
#include "unique.h"
#include<bits/stdc++.h>
using namespace std;
std::vector<int> PickUnique(int N) {
	UniqueCount(0, N-1);
  vector<int> ans(N,1);
	vector<int> p1(N,0),p2(N,0);
	p1[0]=1;
	  for(int i=1;i<N;i++){
			 p1[i]=UniqueCount(0,i);
		}
		  p2[N-1]=1;
		  for(int i=N-2;i>=0;i--){
				  p2[i]=UniqueCount(i,N-1);
			}
			  for(int i=1;i<N;i++){
				#include "unique.h"
#include<bits/stdc++.h>
using namespace std;
std::vector<int> PickUnique(int N) {
	UniqueCount(0, N-1);
  vector<int> ans(N,1);
	vector<int> p1(N,0),p2(N,0);
	p1[0]=1;
	  for(int i=1;i<N;i++){
			 p1[i]=UniqueCount(0,i);
		}
		  p2[N-1]=1;
		  for(int i=N-2;i>=0;i--){
				  p2[i]=UniqueCount(i,N-1);
			}
			  for(int i=1;i<N;i++){
					 if(p1[i]<=p1[i-1]){
						  ans[i]=0;
					 }
				}
				  for(int i=N-2;i>=0;i--){
						  if(p2[i]<=p2[i+1]){
								 ans[i]=0;
							}
					}
					  return ans;
}
	 if(p1[i]<=p1[i-1]){
						  ans[i]=0;
					 }
				}
				  for(int i=N-2;i>=0;i--){
						  if(p2[i]<=p2[i+1]){
								 ans[i]=0;
							}
					}
					  return ans;
}

Compilation message

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:20:36: error: a function-definition is not allowed here before '{' token
 std::vector<int> PickUnique(int N) {
                                    ^