Submission #148557

# Submission time Handle Problem Language Result Execution time Memory
148557 2019-09-01T04:39:25 Z 등수만큼 신재웅 생일빵 때림 (10대)(#3628, kjp4155, GodTe, JWoong148) List of Unique Integers (FXCUP4_unique) C++17
100 / 100
6 ms 512 KB
#include "unique.h"
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repp(i, s, e) for (int i = (s); i < (e); i++)
#define all(x) x.begin(), x.end()

#define endl "\n"

void use_cio() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}

template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto x : V) os << x << ", ";
  return os << "]";
}
template <typename... Args>
void dbg(Args... args) {
  ((cerr << args << " "), ...);
  cerr << "\n";
}
std::vector<int> PickUnique(int N) {
  vector<int> va(N, 0), vb(N, 0);
  vector<int> diff_1(N, 0), diff_2(N, 0);
  vector<int> ans(N, 0);

  rep(i, N) va[i] = UniqueCount(0, i);
  rep(i, N) vb[i] = UniqueCount(i, N - 1);
  diff_1[0] = diff_2[N - 1] = 1;
  for (int i = 1; i < N; i++) diff_1[i] = va[i] - va[i - 1];
  for (int i = 0; i < N - 1; i++) diff_2[i] = vb[i] - vb[i + 1];
  rep(i, N) ans[i] = (diff_1[i] == 1) and (diff_2[i] == 1);
  return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Correct : C = 4
2 Correct 5 ms 384 KB Correct : C = 10
3 Correct 6 ms 384 KB Correct : C = 50
4 Correct 5 ms 256 KB Correct : C = 100
5 Correct 5 ms 384 KB Correct : C = 100
6 Correct 5 ms 384 KB Correct : C = 154
7 Correct 6 ms 384 KB Correct : C = 200
8 Correct 5 ms 256 KB Correct : C = 300
9 Correct 5 ms 512 KB Correct : C = 356
10 Correct 5 ms 384 KB Correct : C = 400
11 Correct 6 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 6 ms 512 KB Correct : C = 400