Submission #148813

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1488132019-09-01 05:09:57이 대회 미분 되나요? (#200)List of Unique Integers (FXCUP4_unique)C++17
0 / 100
5 ms256 KiB
#include "unique.h"
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
std::vector<int> PickUnique(int N) {
//UniqueCount(0, N-1);
//UniqueCount(1, N-2);
vector<int> ret(N, 0);
int l = 1, r = UniqueCount(1, N-1);
for (int i = 2; i < N; i++) {
int nl = UniqueCount(0, i-1);
int nr = UniqueCount(i, N-1);
if (nl == l+1 && nr == r-1) {
ret[i-1] = 1;
}
//printf("%d / l: %d, nl: %d / r: %d, nr: %d\n", i, l, nl, r, nr);
l = nl; r = nr;
}
for (int i= 0; i < N; i++) printf("%d ", ret[i]);
return ret;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...