답안 #1101727

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1101727 2024-10-16T17:28:50 Z rayan_bd List of Unique Integers (FXCUP4_unique) C++17
100 / 100
1 ms 596 KB
#include "unique.h"
using namespace std;
std::vector<int> PickUnique(int N){
    vector<int> ans(N,0),pref(N+5,0),suff(N+5,0);
    for(int i=1;i<=N;++i){
        pref[i]=UniqueCount(0,i-1);
        suff[i]=UniqueCount(i-1,N-1);
    }
    for(int i=1;i<=N;++i){
        if(pref[i-1]<pref[i]&&suff[i]>suff[i+1]){
            ans[i-1]=1;
        }
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Correct : C = 4
2 Correct 1 ms 340 KB Correct : C = 10
3 Correct 1 ms 340 KB Correct : C = 50
4 Correct 1 ms 340 KB Correct : C = 100
5 Correct 1 ms 340 KB Correct : C = 100
6 Correct 1 ms 340 KB Correct : C = 154
7 Correct 1 ms 340 KB Correct : C = 200
8 Correct 1 ms 340 KB Correct : C = 300
9 Correct 1 ms 596 KB Correct : C = 356
10 Correct 1 ms 596 KB Correct : C = 400
11 Correct 1 ms 596 KB Correct : C = 400
12 Correct 1 ms 596 KB Correct : C = 400
13 Correct 1 ms 596 KB Correct : C = 400
14 Correct 1 ms 596 KB Correct : C = 400
15 Correct 1 ms 596 KB Correct : C = 400