Submission #379247

# Submission time Handle Problem Language Result Execution time Memory
379247 2021-03-17T15:15:26 Z huangqr List of Unique Integers (FXCUP4_unique) C++17
100 / 100
1 ms 492 KB
#include "unique.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
std::vector<int> PickUnique(int N) {
	vector<int>v;
	for(int i=0;i<N;i++)v.push_back(1);
	ll pre=0;
	for(int i=0;i<N;i++){
		ll cur=UniqueCount(0,i);
		v[i]&=max(cur-pre,0ll);
		pre=cur;
	}
	pre=0;
	for(int i=N-1;i>=0;i--){
		ll cur=UniqueCount(i,N-1);
		v[i]&=max(cur-pre,0ll);
		pre=cur;
	}
	return v;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Correct : C = 4
2 Correct 1 ms 364 KB Correct : C = 10
3 Correct 1 ms 364 KB Correct : C = 50
4 Correct 1 ms 364 KB Correct : C = 100
5 Correct 1 ms 492 KB Correct : C = 100
6 Correct 1 ms 364 KB Correct : C = 154
7 Correct 1 ms 364 KB Correct : C = 200
8 Correct 1 ms 492 KB Correct : C = 300
9 Correct 1 ms 492 KB Correct : C = 356
10 Correct 1 ms 492 KB Correct : C = 400
11 Correct 1 ms 492 KB Correct : C = 400
12 Correct 1 ms 492 KB Correct : C = 400
13 Correct 1 ms 492 KB Correct : C = 400
14 Correct 1 ms 492 KB Correct : C = 400
15 Correct 1 ms 492 KB Correct : C = 400