QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#87677 | #5455. TreeScript | NYCU_Yamada | AC ✓ | 58ms | 27104kb | C++20 | 7.2kb | 2023-03-14 00:41:45 | 2023-03-14 00:41:47 |
Judging History
answer
#ifndef SorahISA
#define SorahISA
#include SorahISA __FILE__ SorahISA
void dfs(auto &adj, auto &dep, int now) {
int mx1 = 0, mx2 = 0;
for (int x : adj[now]) {
dfs(adj, dep, x);
if (dep[x] > mx1) mx2 = mx1, mx1 = dep[x];
else if (dep[x] > mx2) mx2 = dep[x];
}
dep[now] = max(mx1 - 1, mx2) + 1;
}
void solve() {
int N; cin >> N;
Vec<2, int> adj(N);
for (int i = 0, p; i < N; ++i) {
cin >> p, --p;
if (p >= 0) adj[p].eb(i);
}
vector<int> dep(N, 1);
dfs(adj, dep, 0);
cout << dep[0] << "\n";
}
int32_t main() {
fastIO();
int t = 1; cin >> t;
for (int _ = 1; _ <= t; ++_) {
// cout << "Case #" << _ << ": ";
solve();
}
return 0;
}
#else
#ifdef local
#define _GLIBCXX_DEBUG 1
#endif
#pragma GCC optimize("Ofast", "unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define double __float80
using pii = pair<int, int>;
template <typename T> using Prior = std::priority_queue<T>;
template <typename T> using prior = std::priority_queue<T, vector<T>, greater<T>>;
// #define X first
// #define Y second
#define eb emplace_back
#define ef emplace_front
#define ee emplace
#define pb pop_back
#define pf pop_front
#define ALL(x) begin(x), end(x)
#define RALL(x) rbegin(x), rend(x)
#define SZ(x) ((int)(x).size())
template <size_t D, typename T> struct Vec : vector<Vec<D-1, T>> {
static_assert(D >= 1, "Vector dimension must be greater than zero!");
template <typename... Args> Vec(int n = 0, Args... args) : vector<Vec<D-1, T>>(n, Vec<D-1, T>(args...)) {}
};
template <typename T> struct Vec<1, T> : vector<T> {
Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {}
};
template <class F>
inline constexpr decltype(auto) lambda_fix(F&& f) {
return [f = std::forward<F>(f)](auto&&... args) {
return f(f, std::forward<decltype(args)>(args)...);
};
}
#ifdef local
#define fastIO() void()
#define debug(...) \
_color.emplace_back("\u001b[31m"), \
fprintf(stderr, "%sAt [%s], line %d: (%s) = ", _color.back().c_str(), __FUNCTION__, __LINE__, #__VA_ARGS__), \
_do(__VA_ARGS__), _color.pop_back(), \
fprintf(stderr, "%s", _color.back().c_str())
deque<string> _color{"\u001b[0m"};
template <typename T> concept is_string = is_same_v<T, string&> or is_same_v<T, const string&>;
template <typename T> concept is_iterable = requires (T _t) {begin(_t);};
template <typename T> inline void _print_err(T &&_t);
template <typename T> inline void _print_err(T &&_t) requires is_iterable<T> and (not is_string<T>);
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(const tuple<U...> &);
template <size_t I = 0, typename ...U> inline typename enable_if<I < sizeof...(U), void>::type _print_err(const tuple<U...> &_t);
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(tuple<U...> &);
template <size_t I = 0, typename ...U> inline typename enable_if<I < sizeof...(U), void>::type _print_err(tuple<U...> &_t);
template <typename T, typename U> ostream& operator << (ostream &os, const pair<T, U> &_tu);
inline void _do() {cerr << "\n";};
template <typename T> inline void _do(T &&_t) {_print_err(_t), cerr << "\n";}
template <typename T, typename ...U> inline void _do(T &&_t, U &&..._u) {_print_err(_t), cerr << ", ", _do(_u...);}
#else
#define fastIO() ios_base::sync_with_stdio(0), cin.tie(0)
#define debug(...) void()
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int getRand(int L, int R) {
if (L > R) swap(L, R);
return (int)(rng() % ((uint64_t)R - L + 1) + L);
}
template <typename T, typename U> bool chmin(T &lhs, U rhs) {return lhs > rhs ? lhs = rhs, 1 : 0;}
template <typename T, typename U> bool chmax(T &lhs, U rhs) {return lhs < rhs ? lhs = rhs, 1 : 0;}
/// below are Fast I/O and _print_err templates ///
/*
/// Fast I/O by FHVirus ///
/// https://fhvirus.github.io/blog/2020/fhvirus-io/ ///
#include <unistd.h>
const int S = 65536;
int OP = 0;
char OB[S];
inline char RC() {
static char buf[S], *p = buf, *q = buf;
return p == q and (q = (p = buf) + read(0, buf, S)) == buf ? -1 : *p++;
}
inline int RI() {
static char c;
int a;
while (((c = RC()) < '0' or c > '9') and c != '-' and c != -1);
if (c == '-') {
a = 0;
while ((c = RC()) >= '0' and c <= '9') a *= 10, a -= c ^ '0';
}
else {
a = c ^ '0';
while ((c = RC()) >= '0' and c <= '9') a *= 10, a += c ^ '0';
}
return a;
}
inline void WI(int n, char c = '\n') {
static char buf[20], p;
if (n == 0) OB[OP++] = '0';
p = 0;
if (n < 0) {
OB[OP++] = '-';
while (n) buf[p++] = '0' - (n % 10), n /= 10;
}
else {
while (n) buf[p++] = '0' + (n % 10), n /= 10;
}
for (--p; p >= 0; --p) OB[OP++] = buf[p];
OB[OP++] = c;
if (OP > S-20) write(1, OB, OP), OP = 0;
}
/// Fast I/O by FHVirus ///
/// https://fhvirus.github.io/blog/2020/fhvirus-io/ ///
*/
#ifdef local
template <typename T> inline void _print_err(T &&_t) {cerr << _t;}
template <typename T> inline void _print_err(T &&_t) requires is_iterable<T> and (not is_string<T>) {
string _tmp_color = _color.back();
++_tmp_color[3], _color.emplace_back(_tmp_color);
cerr << _color.back() << "[";
for (bool _first = true; auto &_x : _t) {
if (!_first) cerr << ", ";
_print_err(_x), _first = false;
}
cerr << "]" << (_color.pop_back(), _color.back());
}
template <typename T, typename U> ostream& operator << (ostream &os, const pair<T, U> &_tu) {
string _tmp_color = _color.back();
++_tmp_color[3], _color.emplace_back(_tmp_color);
cerr << _color.back() << "(";
_print_err(_tu.first), cerr << ", ", _print_err(_tu.second);
cerr << ")" << (_color.pop_back(), _color.back());
return os;
}
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(const tuple<U...> &) {
cerr << ")" << (_color.pop_back(), _color.back());
}
template <size_t I = 0, typename ...U> inline typename enable_if<I < sizeof...(U), void>::type _print_err(const tuple<U...> &_t) {
if (!I) {
string _tmp_color = _color.back();
++_tmp_color[3], _color.emplace_back(_tmp_color);
cerr << _color.back();
}
cerr << (I ? ", " : "("), _print_err(get<I>(_t)), _print_err<I+1, U...>(_t);
}
template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(tuple<U...> &) {
cerr << ")" << (_color.pop_back(), _color.back());
}
template <size_t I = 0, typename ...U> inline typename enable_if<I < sizeof...(U), void>::type _print_err(tuple<U...> &_t) {
if (!I) {
string _tmp_color = _color.back();
++_tmp_color[3], _color.emplace_back(_tmp_color);
cerr << _color.back();
}
cerr << (I ? ", " : "("), _print_err(get<I>(_t)), _print_err<I+1, U...>(_t);
}
#endif
#endif
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3452kb
input:
2 3 0 1 2 7 0 1 2 2 1 4 1
output:
1 2
result:
ok 2 number(s): "1 2"
Test #2:
score: 0
Accepted
time: 26ms
memory: 3600kb
input:
1000 197 0 1 1 2 1 4 1 5 8 3 5 1 4 7 12 14 4 7 10 9 12 11 16 10 21 19 22 17 25 13 28 9 5 15 26 26 33 25 15 1 35 6 32 17 37 8 19 43 19 27 29 9 30 6 31 27 35 35 37 13 28 38 57 31 38 8 22 14 33 9 18 62 52 37 10 19 22 60 54 12 38 59 64 65 80 82 28 60 85 78 27 25 71 14 52 6 59 14 87 32 33 41 59 41 88 38 ...
output:
4 4 3 4 3 4 5 5 4 4 4 4 5 5 3 4 4 5 3 5 5 3 5 4 5 4 5 3 4 5 2 5 4 3 5 5 4 3 3 4 4 4 3 3 4 4 5 5 4 4 4 2 4 5 5 4 4 5 4 4 5 4 3 4 4 4 4 4 5 4 4 5 5 4 5 5 2 3 4 1 1 5 5 4 3 4 5 5 4 5 4 4 4 4 4 4 4 4 4 4 5 4 4 6 5 5 3 3 5 3 4 3 3 3 4 4 3 2 4 4 3 5 3 5 3 4 4 4 5 4 5 4 5 4 4 3 5 4 4 3 3 3 3 2 5 5 4 2 4 5 ...
result:
ok 1000 numbers
Test #3:
score: 0
Accepted
time: 50ms
memory: 13088kb
input:
1 200000 0 1 2 1 4 2 3 4 1 7 9 3 4 13 9 15 11 7 7 14 5 11 16 1 5 21 11 11 6 4 23 27 22 32 24 35 28 3 8 31 18 4 32 38 39 23 37 37 13 1 35 30 20 3 39 36 46 6 14 20 37 3 2 23 56 43 34 10 58 49 67 49 9 69 48 65 37 12 8 6 47 44 36 7 50 15 29 12 53 26 66 47 43 64 29 69 41 13 1 20 52 21 51 100 33 79 58 76 ...
output:
9
result:
ok 1 number(s): "9"
Test #4:
score: 0
Accepted
time: 28ms
memory: 5364kb
input:
10 14713 0 1 2 2 1 5 1 4 3 4 7 10 3 3 12 15 5 5 9 15 18 15 2 9 8 14 1 17 28 26 27 28 7 11 23 20 29 29 1 30 17 31 38 17 34 42 28 13 23 27 16 14 5 19 40 37 28 36 31 16 54 26 5 5 63 29 16 38 10 16 17 33 50 29 12 21 62 53 42 52 22 57 58 81 76 67 72 43 28 16 90 64 88 75 49 92 84 47 8 5 75 57 7 11 88 57 7...
output:
7 8 7 7 8 8 8 8 7 9
result:
ok 10 numbers
Test #5:
score: 0
Accepted
time: 21ms
memory: 3564kb
input:
10000 9 0 1 1 2 3 1 1 1 8 3 0 1 2 3 0 1 1 34 0 1 1 3 4 5 5 3 1 5 7 9 9 8 14 8 2 4 11 4 19 19 15 19 18 1 12 6 11 25 11 1 15 7 11 0 1 2 3 3 1 1 6 7 7 1 2 0 1 44 0 1 1 3 4 1 5 5 7 7 2 11 9 1 2 1 10 10 4 3 11 7 5 7 16 15 13 16 27 5 9 17 15 16 19 28 33 31 11 3 34 18 24 22 18 0 1 2 2 2 5 5 2 5 3 9 8 7 13 ...
output:
2 1 2 3 3 1 4 3 3 3 2 3 2 2 2 2 3 2 3 2 2 2 3 3 3 2 3 3 2 2 3 3 3 2 2 1 3 2 2 3 3 2 2 2 2 2 3 4 2 1 2 2 3 3 3 1 3 3 2 4 2 2 3 4 4 2 2 2 3 2 4 3 2 2 2 3 3 2 3 3 2 2 3 3 3 2 4 2 3 3 2 2 3 3 2 3 2 2 1 3 3 2 3 4 3 2 3 3 3 2 3 2 3 3 4 2 3 1 3 2 3 2 2 2 2 3 3 2 3 3 2 3 1 3 3 3 3 3 2 3 2 2 2 3 3 3 2 3 2 3 ...
result:
ok 10000 numbers
Test #6:
score: 0
Accepted
time: 19ms
memory: 3404kb
input:
20000 2 0 1 14 0 1 1 1 1 1 2 2 4 1 7 8 5 9 11 0 1 2 3 2 3 1 3 8 9 3 6 0 1 1 3 3 4 16 0 1 2 2 2 5 1 4 8 4 3 3 7 9 1 15 2 0 1 3 0 1 1 21 0 1 1 2 2 5 5 3 5 4 2 5 5 6 11 11 1 12 1 6 20 3 0 1 2 5 0 1 1 2 1 27 0 1 1 1 4 2 6 7 6 2 3 1 6 1 11 3 9 12 17 11 13 17 12 6 4 17 11 7 0 1 1 2 3 4 1 4 0 1 1 2 3 0 1 2...
output:
1 2 2 2 3 1 2 3 1 2 3 2 2 1 2 1 3 3 2 2 2 3 1 2 2 2 2 3 2 3 3 2 3 2 4 3 2 1 2 3 2 2 2 3 1 3 3 2 3 2 2 2 2 2 2 1 3 2 3 2 2 2 1 3 2 1 2 3 3 3 2 2 2 2 2 3 3 3 3 1 2 2 2 2 2 1 2 2 2 2 3 3 3 1 2 3 1 2 3 2 1 3 3 2 2 2 2 3 2 2 2 2 1 1 2 1 2 2 2 2 3 2 2 2 1 1 1 2 2 2 1 2 2 2 3 2 2 2 3 2 2 1 3 2 1 2 2 2 2 1 ...
result:
ok 20000 numbers
Test #7:
score: 0
Accepted
time: 2ms
memory: 3512kb
input:
1 2 0 1
output:
1
result:
ok 1 number(s): "1"
Test #8:
score: 0
Accepted
time: 2ms
memory: 3516kb
input:
2 3 0 1 1 3 0 1 2
output:
2 1
result:
ok 2 number(s): "2 1"
Test #9:
score: 0
Accepted
time: 2ms
memory: 3440kb
input:
6 4 0 1 1 1 4 0 1 1 2 4 0 1 1 3 4 0 1 2 1 4 0 1 2 2 4 0 1 2 3
output:
2 2 2 2 2 1
result:
ok 6 numbers
Test #10:
score: 0
Accepted
time: 1ms
memory: 3480kb
input:
24 5 0 1 1 1 1 5 0 1 1 1 2 5 0 1 1 1 3 5 0 1 1 1 4 5 0 1 1 2 1 5 0 1 1 2 2 5 0 1 1 2 3 5 0 1 1 2 4 5 0 1 1 3 1 5 0 1 1 3 2 5 0 1 1 3 3 5 0 1 1 3 4 5 0 1 2 1 1 5 0 1 2 1 2 5 0 1 2 1 3 5 0 1 2 1 4 5 0 1 2 2 1 5 0 1 2 2 2 5 0 1 2 2 3 5 0 1 2 2 4 5 0 1 2 3 1 5 0 1 2 3 2 5 0 1 2 3 3 5 0 1 2 3 4
output:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
result:
ok 24 numbers
Test #11:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
120 6 0 1 1 1 1 1 6 0 1 1 1 1 2 6 0 1 1 1 1 3 6 0 1 1 1 1 4 6 0 1 1 1 1 5 6 0 1 1 1 2 1 6 0 1 1 1 2 2 6 0 1 1 1 2 3 6 0 1 1 1 2 4 6 0 1 1 1 2 5 6 0 1 1 1 3 1 6 0 1 1 1 3 2 6 0 1 1 1 3 3 6 0 1 1 1 3 4 6 0 1 1 1 3 5 6 0 1 1 1 4 1 6 0 1 1 1 4 2 6 0 1 1 1 4 3 6 0 1 1 1 4 4 6 0 1 1 1 4 5 6 0 1 1 2 1 1 6 ...
output:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
result:
ok 120 numbers
Test #12:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
720 7 0 1 1 1 1 1 1 7 0 1 1 1 1 1 2 7 0 1 1 1 1 1 3 7 0 1 1 1 1 1 4 7 0 1 1 1 1 1 5 7 0 1 1 1 1 1 6 7 0 1 1 1 1 2 1 7 0 1 1 1 1 2 2 7 0 1 1 1 1 2 3 7 0 1 1 1 1 2 4 7 0 1 1 1 1 2 5 7 0 1 1 1 1 2 6 7 0 1 1 1 1 3 1 7 0 1 1 1 1 3 2 7 0 1 1 1 1 3 3 7 0 1 1 1 1 3 4 7 0 1 1 1 1 3 5 7 0 1 1 1 1 3 6 7 0 1 1 ...
output:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
result:
ok 720 numbers
Test #13:
score: 0
Accepted
time: 6ms
memory: 3448kb
input:
5040 8 0 1 1 1 1 1 1 1 8 0 1 1 1 1 1 1 2 8 0 1 1 1 1 1 1 3 8 0 1 1 1 1 1 1 4 8 0 1 1 1 1 1 1 5 8 0 1 1 1 1 1 1 6 8 0 1 1 1 1 1 1 7 8 0 1 1 1 1 1 2 1 8 0 1 1 1 1 1 2 2 8 0 1 1 1 1 1 2 3 8 0 1 1 1 1 1 2 4 8 0 1 1 1 1 1 2 5 8 0 1 1 1 1 1 2 6 8 0 1 1 1 1 1 2 7 8 0 1 1 1 1 1 3 1 8 0 1 1 1 1 1 3 2 8 0 1 1...
output:
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
result:
ok 5040 numbers
Test #14:
score: 0
Accepted
time: 22ms
memory: 12556kb
input:
1 200000 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 5...
output:
17
result:
ok 1 number(s): "17"
Test #15:
score: 0
Accepted
time: 23ms
memory: 12352kb
input:
1 197497 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 5...
output:
17
result:
ok 1 number(s): "17"
Test #16:
score: 0
Accepted
time: 10ms
memory: 9312kb
input:
1 131072 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 5...
output:
17
result:
ok 1 number(s): "17"
Test #17:
score: 0
Accepted
time: 9ms
memory: 9328kb
input:
1 131073 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 5...
output:
17
result:
ok 1 number(s): "17"
Test #18:
score: 0
Accepted
time: 2ms
memory: 3380kb
input:
1 256 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 5...
output:
8
result:
ok 1 number(s): "8"
Test #19:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
1 63 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31
output:
6
result:
ok 1 number(s): "6"
Test #20:
score: 0
Accepted
time: 2ms
memory: 3512kb
input:
1 40 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20
output:
5
result:
ok 1 number(s): "5"
Test #21:
score: 0
Accepted
time: 17ms
memory: 9580kb
input:
1 140000 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 5...
output:
17
result:
ok 1 number(s): "17"
Test #22:
score: 0
Accepted
time: 11ms
memory: 11300kb
input:
1 200000 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
3
result:
ok 1 number(s): "3"
Test #23:
score: 0
Accepted
time: 12ms
memory: 11132kb
input:
1 200000 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
3
result:
ok 1 number(s): "3"
Test #24:
score: 0
Accepted
time: 14ms
memory: 11452kb
input:
1 200000 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
4
result:
ok 1 number(s): "4"
Test #25:
score: 0
Accepted
time: 16ms
memory: 11764kb
input:
1 200000 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 3 2 1 1 1 1 2 1 1 1 1 1 4 1 1 1 2 1 1 2 1 1 1 1 1 2 1 2 1 2 1 1 1 1 1 1 4 1 2 1 1 1 2 1 1 1 1 2 3 1 1 2 1 1 1 1 1 1 1 1 2 1 3 2 2 2 2 1 1 1 2 2 1 1 1 2 1 2 1 1 1 2 7 4 1 2...
output:
5
result:
ok 1 number(s): "5"
Test #26:
score: 0
Accepted
time: 30ms
memory: 12036kb
input:
1 200000 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 4 3 1 2 2 1 1 2 1 7 2 5 7 3 3 3 4 1 4 1 2 3 4 2 5 2 4 5 9 3 1 3 1 2 2 1 4 10 1 1 3 6 11 3 2 2 6 7 1 6 4 1 4 7 10 16 6 5 4 3 1 13 3 2 7 2 10 4 4 3 34 5 10 10 1 9 4 14 17 4 11 21 18 5 4 1 12 5 8 9 2 13 14 15 28 7 7 18 20 8 2 14 6 10 11 6 35 12 20 2 4 20 2 15 4 ...
output:
7
result:
ok 1 number(s): "7"
Test #27:
score: 0
Accepted
time: 38ms
memory: 12844kb
input:
1 200000 0 1 2 2 3 3 1 3 4 1 1 3 2 1 5 3 10 12 7 7 4 4 14 15 1 8 3 18 8 13 8 7 25 3 2 8 7 35 30 1 35 22 21 5 13 41 24 3 8 36 1 19 18 42 7 2 29 8 22 21 5 15 15 12 3 53 16 51 44 41 50 33 38 38 38 19 24 58 38 11 53 5 35 31 77 1 46 67 41 29 9 29 38 18 69 69 26 28 47 38 81 28 26 14 36 69 73 25 35 80 49 1...
output:
9
result:
ok 1 number(s): "9"
Test #28:
score: 0
Accepted
time: 38ms
memory: 27104kb
input:
1 200000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1...
output:
4
result:
ok 1 number(s): "4"
Test #29:
score: 0
Accepted
time: 36ms
memory: 17072kb
input:
1 200000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1...
output:
6
result:
ok 1 number(s): "6"
Test #30:
score: 0
Accepted
time: 40ms
memory: 14068kb
input:
1 200000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1...
output:
9
result:
ok 1 number(s): "9"
Test #31:
score: 0
Accepted
time: 58ms
memory: 13676kb
input:
1 200000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 28 30 31 32 33 34 35 36 37 38 39 40 41 42 41 43 45 46 47 47 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 65 68 69 71 72 73 74 75 76 76 78 79 80 81 80 83 82 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 9...
output:
10
result:
ok 1 number(s): "10"
Test #32:
score: 0
Accepted
time: 55ms
memory: 13552kb
input:
1 200000 0 1 2 3 4 5 6 7 8 8 10 11 12 13 14 15 13 16 16 19 20 21 22 22 19 23 26 24 28 25 27 30 29 33 34 31 32 36 37 37 40 36 42 40 41 45 39 46 44 48 45 44 52 52 54 44 51 57 58 59 57 59 57 62 54 61 66 59 67 64 67 65 72 71 72 57 75 69 78 75 80 80 79 80 84 84 76 82 87 66 74 90 91 74 92 67 82 51 87 73 9...
output:
11
result:
ok 1 number(s): "11"