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