답안 #402464

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
402464 2021-05-11T17:47:07 Z Victor List of Unique Integers (FXCUP4_unique) C++17
100 / 100
1 ms 460 KB
#include "unique.h"

#include <bits/stdc++.h>

using namespace std;

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define per(i, a, b) for (int i = b - 1; i >= (a); --i)
#define trav(a, x) for (auto& a : x)

#define all(x) x.begin(), x.end()
#define sz(x) x.size()
#define pb push_back

#define umap unordered_map
#define uset unordered_set

typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef long long ll;

const int INF = 1000000007;

vector<int> PickUnique(int n) {
    vi ans(n);
    int cur, prev = 0;
    rep(i, 0, n) {
        cur = UniqueCount(0, i);
        ans[i] = prev < cur;
        prev = cur;
    }
    prev = 0;

    per(i, 0, n) {
        cur = UniqueCount(i, n-1);
        ans[i] &= prev < cur;
        prev = cur;
    }

    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Correct : C = 4
2 Correct 1 ms 204 KB Correct : C = 10
3 Correct 1 ms 332 KB Correct : C = 50
4 Correct 1 ms 308 KB Correct : C = 100
5 Correct 1 ms 332 KB Correct : C = 100
6 Correct 1 ms 332 KB Correct : C = 154
7 Correct 1 ms 332 KB Correct : C = 200
8 Correct 1 ms 332 KB Correct : C = 300
9 Correct 1 ms 460 KB Correct : C = 356
10 Correct 1 ms 460 KB Correct : C = 400
11 Correct 1 ms 460 KB Correct : C = 400
12 Correct 1 ms 460 KB Correct : C = 400
13 Correct 1 ms 460 KB Correct : C = 400
14 Correct 1 ms 460 KB Correct : C = 400
15 Correct 1 ms 460 KB Correct : C = 400