답안 #148599

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148599 2019-09-01T04:45:09 Z 팀명못정해서15시간째고민중인팀(#3792, onjo0127, sg1774) List of Unique Integers (FXCUP4_unique) C++17
100 / 100
6 ms 512 KB
#include "unique.h"
#include <bits/stdc++.h>
using namespace std;

int A[100009], B[100009];

vector<int> PickUnique(int N) {
    vector<int> ans(N, 0);
    int p = 0;
    for(int i=0; i<N; i++) {
        int t = i+1 - UniqueCount(0, i);
        if(t == p) A[i] = 1;
        p = t;
    }
    p = 0;
    for(int i=N-1; i>=0; i--) {
        int t = (N-i) - UniqueCount(i, N-1);
        if(t == p) B[i] = 1;
        p = t;
    }
    for(int i=0; i<N; i++) {
        if(A[i] && B[i]) ans[i] = 1;
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Correct : C = 4
2 Correct 5 ms 384 KB Correct : C = 10
3 Correct 5 ms 384 KB Correct : C = 50
4 Correct 6 ms 384 KB Correct : C = 100
5 Correct 6 ms 384 KB Correct : C = 100
6 Correct 5 ms 384 KB Correct : C = 154
7 Correct 5 ms 384 KB Correct : C = 200
8 Correct 6 ms 508 KB Correct : C = 300
9 Correct 6 ms 472 KB Correct : C = 356
10 Correct 6 ms 512 KB Correct : C = 400
11 Correct 5 ms 512 KB Correct : C = 400
12 Correct 6 ms 512 KB Correct : C = 400
13 Correct 6 ms 512 KB Correct : C = 400
14 Correct 5 ms 512 KB Correct : C = 400
15 Correct 5 ms 512 KB Correct : C = 400