#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 time |
Memory |
Grader output |
1 |
Correct |
6 ms |
256 KB |
Correct : C = 4 |
2 |
Incorrect |
5 ms |
384 KB |
Wrong |
3 |
Halted |
0 ms |
0 KB |
- |