# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230705 | jzh | List of Unique Integers (FXCUP4_unique) | C++17 | 5 ms | 512 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "unique.h"
#include<bits/stdc++.h>
using namespace std;
int UniqueCount(int x, int y);
std::vector<int> PickUnique(int N) {
int i,a[N],b[N],x1,y1,x2,y2;
for (i=0;i<N;i++){
a[i] = UniqueCount(0,i);
b[i] = UniqueCount(i,N-1);
}
vector<int>ans;
for (i=0;i<N;i++){
if (i>0) x1 = a[i-1];
else x1 = 0;
x2 = a[i];
if (i<N-1) y1 = b[i+1];
else y1 = 0;
y2 = b[i];
if (x1+1 == x2 && y1+1 == y2){
ans.push_back(1);
}
else {
ans.push_back(0);
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |