Submission #227621

# Submission time Handle Problem Language Result Execution time Memory
227621 2020-04-28T07:24:26 Z bensonlzl List of Unique Integers (FXCUP4_unique) C++17
100 / 100
6 ms 512 KB
#include <bits/stdc++.h>
#include "unique.h"

using namespace std;

vector<int> PickUnique(int n) {
	int pref[205], suff[205];
	vector<int> u;
	u.resize(n,0);
	for (int i = 0; i <= n+1; ++i){
		pref[i] = suff[i] = 0;
	}
	for (int i = 1; i <= n; ++i){
		pref[i] = UniqueCount(0, i-1);
		suff[i] = UniqueCount(i-1, n-1);
	}
	for (int i = 1; i <= n; ++i){
		if (pref[i] > pref[i-1] && suff[i] > suff[i+1]) u[i-1] = 1;
		else u[i-1] = 0;
	}
	return u;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Correct : C = 4
2 Correct 5 ms 384 KB Correct : C = 10
3 Correct 5 ms 384 KB Correct : C = 50
4 Correct 5 ms 384 KB Correct : C = 100
5 Correct 5 ms 384 KB Correct : C = 100
6 Correct 6 ms 456 KB Correct : C = 154
7 Correct 6 ms 384 KB Correct : C = 200
8 Correct 5 ms 512 KB Correct : C = 300
9 Correct 5 ms 432 KB Correct : C = 356
10 Correct 5 ms 512 KB Correct : C = 400
11 Correct 5 ms 512 KB Correct : C = 400
12 Correct 5 ms 512 KB Correct : C = 400
13 Correct 5 ms 512 KB Correct : C = 400
14 Correct 5 ms 512 KB Correct : C = 400
15 Correct 6 ms 512 KB Correct : C = 400