# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
230705 | jzh | List of Unique Integers (FXCUP4_unique) | C++17 | 5 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |