Submission #377810

# Submission time Handle Problem Language Result Execution time Memory
377810 2021-03-15T07:29:49 Z penguin133 List of Unique Integers (FXCUP4_unique) C++17
100 / 100
1 ms 492 KB
#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> PickUnique(int N) {
	vector<int>v;
	int L[200], R[201];
	R[200] = UniqueCount(0, N-1);
	for(int i=0;i<N-1;i++){
		L[i] = UniqueCount(0, i);
		R[i] = UniqueCount(i+1, N-1);
	}
	int cnt = 0, cnt2 = R[200];
	for(int i=0;i<N-1;i++){
		if(L[i] == cnt + 1 && R[i] == cnt2 - 1)v.push_back(1);
		else v.push_back(0);
		cnt = L[i];
		cnt2 = R[i];
	}
	if(cnt == R[200]-1 && cnt2 == 1)v.push_back(1);
	else v.push_back(0);
	return v;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Correct : C = 3
2 Correct 1 ms 364 KB Correct : C = 9
3 Correct 1 ms 364 KB Correct : C = 49
4 Correct 1 ms 364 KB Correct : C = 99
5 Correct 1 ms 492 KB Correct : C = 99
6 Correct 1 ms 364 KB Correct : C = 153
7 Correct 1 ms 364 KB Correct : C = 199
8 Correct 1 ms 492 KB Correct : C = 299
9 Correct 1 ms 492 KB Correct : C = 355
10 Correct 1 ms 492 KB Correct : C = 399
11 Correct 1 ms 492 KB Correct : C = 399
12 Correct 1 ms 492 KB Correct : C = 399
13 Correct 1 ms 492 KB Correct : C = 399
14 Correct 1 ms 492 KB Correct : C = 399
15 Correct 1 ms 492 KB Correct : C = 399