Submission #998560

# Submission time Handle Problem Language Result Execution time Memory
998560 2024-06-14T08:13:40 Z 12345678 List of Unique Integers (FXCUP4_unique) C++17
100 / 100
1 ms 856 KB
#include "unique.h"
#include <bits/stdc++.h>

using namespace std;

std::vector<int> PickUnique(int N) {
	int p=0;
	vector<int> cnt(N), res(N);
	for (int i=0; i<N; i++)
	{
		int c=UniqueCount(0, i);
		if (c>p) cnt[i]++;
		p=c;
	}
	p=0;
	for (int i=N-1; i>=0; i--)
	{
		int c=UniqueCount(i, N-1);
		if (c>p) cnt[i]++;
		p=c;
	}
	for (int i=0; i<N; i++) res[i]=cnt[i]==2;
	return res;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Correct : C = 4
2 Correct 0 ms 344 KB Correct : C = 10
3 Correct 0 ms 348 KB Correct : C = 50
4 Correct 0 ms 348 KB Correct : C = 100
5 Correct 0 ms 348 KB Correct : C = 100
6 Correct 0 ms 600 KB Correct : C = 154
7 Correct 0 ms 348 KB Correct : C = 200
8 Correct 0 ms 348 KB Correct : C = 300
9 Correct 0 ms 856 KB Correct : C = 356
10 Correct 1 ms 444 KB Correct : C = 400
11 Correct 0 ms 600 KB Correct : C = 400
12 Correct 0 ms 604 KB Correct : C = 400
13 Correct 0 ms 604 KB Correct : C = 400
14 Correct 0 ms 420 KB Correct : C = 400
15 Correct 1 ms 604 KB Correct : C = 400