Submission #148544

#TimeUsernameProblemLanguageResultExecution timeMemory
148544등수만큼 신재웅 생일빵 때림 (10대) (#200)List of Unique Integers (FXCUP4_unique)C++17
0 / 100
6 ms384 KiB
#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); 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 timeMemoryGrader output
Fetching results...