# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148626 | 본인 방금 올솔하는 상상함 (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 640 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"
int dp[220][220];
int ask(int s, int e){
if(dp[s][e]!=-1) return dp[s][e];
return dp[s][e]=UniqueCount(s,e);
}
std::vector<int> PickUnique(int N) {
std::vector<int> ret(N);
for(int i=0;i<N;i++){
for(int j=0;j<N;j++) dp[i][j]=-1;
}
for(int i=0;i<N;i++){
if(i==0){
int a = ask(1,N-1);
int b = ask(0,N-1);
if(a+1==b) ret[i]=1;
}
else if(i==N-1){
int a = ask(0,N-2);
int b = ask(0,N-1);
if(a+1==b) ret[i]=1;
}
else{
int a = ask(0,i-1);
int aa = ask(0,i);
int b = ask(i+1,N-1);
int bb = ask(i,N-1);
if(a+1==aa&&b+1==bb) ret[i]=1;
}
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |