QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#275608 | #7776. 超现实树 | chenxia25 | 100 ✓ | 599ms | 63416kb | C++20 | 13.7kb | 2023-12-04 21:26:32 | 2023-12-04 21:26:33 |
Judging History
answer
/**
* @author chenxia25
* @created 2023.10.17 09:42:58
*/
#include <bits/stdc++.h>
void ckmin(auto &x, const auto &y) { if (y < x) x = y; }
void ckmax(auto &x, const auto &y) { if (y > x) x = y; }
#define sz(x) int(x.size())
const int INF = 0x3f3f3f3f;
const int64_t INF64 = 0x3f3f3f3f3f3f3f3fLL;
template <class T>
struct y_combinator {
T f;
y_combinator(const T &_f) : f(_f) {}
template <class ...Ts>
auto operator()(Ts &&...args) const {
return f(*this, std::forward<Ts>(args)...);
}
};
template <class ...Ts>
struct recursion_t {
std::tuple<Ts&&...> tp;
recursion_t(Ts &&...args) : tp(std::forward<Ts>(args)...) {}
template <class ...Us>
auto operator()(Us &&...args) const {
return recursion_t<Us...>(std::forward<Us>(args)...);
}
};
template <class T, class ...Ts>
auto operator/(const T &f, const recursion_t<Ts...> &rec) {
const auto &func = y_combinator<T>(f);
if constexpr (sizeof...(Ts) == 0) return func;
else return std::apply(func, rec.tp);
}
recursion_t recursion;
template <class T, T _mod>
struct modint {
using type = T;
static constexpr T mod = _mod;
T x;
modint() : x(0) {}
template <class U>
modint(const U &val) : x(norm(val)) {}
operator T() { return x; }
template <class U>
static T norm(const U &x) {
if (x >= 0) {
if (x < mod) return x;
else return x % mod;
} else {
if (x >= -mod) return x + mod;
else return x % mod + mod;
}
}
// to be modified
modint inverse() const {
T u, v, d = [&](const auto &exgcd, T a, T b, T &x, T &y) {
if (!b) return x = 1, y = 0, a;
int d = exgcd(b, a % b, y, x);
return y -= a / b * x, d;
} / recursion(x, mod, u, v);
assert(d == 1);
return u;
}
};
#define mint modint<T, mod>
// addition
template <class T, T mod>
mint &operator+=(mint &x, const mint &y) {
if constexpr (mod <= std::numeric_limits<T>::max() / 2) {
if ((x.x += y.x) >= mod) x.x -= mod;
} else {
typename std::make_unsigned<T>::type res = x.x + y.x;
if (res >= mod) res -= mod;
x.x = res;
}
return x;
}
template <class T, T mod, class U>
mint &operator+=(mint &x, const U &y) { return x += mint(y); }
template <class T, T mod>
mint operator+(mint x, const mint &y) { return x += y; }
template <class T, T mod, class U>
mint operator+(const U &x, const mint &y) { return mint(x) + y; }
template <class T, T mod, class U>
mint operator+(const mint &x, const U &y) { return x + mint(y); }
// subtraction
template <class T, T mod>
mint &operator-=(mint &x, const mint &y) {
if ((x.x -= y.x) < 0) x.x += mod;
return x;
}
template <class T, T mod, class U>
mint &operator-=(mint &x, const U &y) { return x -= mint(y); }
template <class T, T mod>
mint operator-(mint x, const mint &y) { return x -= y; }
template <class T, T mod, class U>
mint operator-(const U &x, const mint &y) { return mint(x) - y; }
template <class T, T mod, class U>
mint operator-(const mint &x, const U &y) { return x - mint(y); }
// multiplication
template <class T, T mod>
mint &operator*=(mint &x, const mint &y) {
using U = typename std::conditional<std::is_same<T, int>::value, int64_t, __int128>::type;
x.x = mint::norm(U(x.x) * y.x);
return x;
}
template <class T, T mod, class U>
mint &operator*=(mint &x, const U &y) { return x *= mint(y); }
template<class T, T mod>
mint operator*(mint x, const mint &y) { return x *= y; }
template <class T, T mod, class U>
mint operator*(const U &x, const mint &y) { return mint(x) * y; }
template <class T, T mod, class U>
mint operator*(const mint &x, const U &y) { return x * mint(y); }
// division
template <class T, T mod>
mint &operator/=(mint &x, const mint &y) {
return x *= y.inverse();
}
template <class T, T mod, class U>
mint &operator/=(mint &x, const U &y) { return x /= mint(y); }
template<class T, T mod>
mint operator/(mint x, const mint &y) { return x /= y; }
template <class T, T mod, class U>
mint operator/(const U &x, const mint &y) { return mint(x) / y; }
template <class T, T mod, class U>
mint operator/(const mint &x, const U &y) { return x / mint(y); }
// quick power
template <class T, T mod, class U>
mint power(mint x, U e) {
assert(e >= 0);
mint res = 1;
for (; e; e >>= 1, x *= x) if (e & 1) res *= x;
return res;
}
// comparison
template <class T, T mod>
bool operator<(const mint &x, const mint &y) { return x.x < y.x; }
template <class T, T mod>
bool operator<=(const mint &x, const mint &y) { return x.x <= y.x; }
template <class T, T mod>
bool operator>(const mint &x, const mint &y) { return x.x > y.x; }
template <class T, T mod>
bool operator>=(const mint &x, const mint &y) { return x.x >= y.x; }
// input & output
template <class T, T mod, class U>
U &operator<<(U &stream, const mint &x) { return stream << x.x; }
template <class T, T mod, class U>
U &operator>>(U &stream, mint &x) { return stream >> x.x; }
#undef mint
struct hash_t {
int n;
std::vector<uint64_t> a;
void build(int _n) {
std::mt19937_64 rng(19171107);
n = _n;
a.resize(n);
for (auto &x : a) x = rng();
}
uint64_t operator()(int x) {
return a[x];
}
} hash;
struct info {
int must = -1;
uint64_t diff = 0;
int first = -1;
};
template <int mod, int g>
auto dft(auto a, int iv) {
using mint = modint<int, mod>;
int n = sz(a);
std::vector p(n, 0);
for(int i = 1; i < n; ++i) p[i] = p[i / 2] / 2 + i % 2 * n / 2;
for(int i = 0; i < n; ++i) if(i < p[i]) std::swap(a[i], a[p[i]]);
for(int i = 1; i < n; i *= 2) {
mint o = power(mint(g), (mod - 1) / (2 * i));
if (iv == -1) o = o.inverse();
std::vector w(i, mint(1));
for(int k = 1; k < i; ++k) w[k] = w[k - 1] * o;
for(int j = 0; j < n; j += 2 * i) for(int k = 0; k < i; ++k) {
mint x = a[j + k], y = w[k] * a[i + j + k];
a[j + k] = x + y, a[i + j + k] = x - y;
}
}
if(iv == -1) {
mint inv = mint(n).inverse();
for(int i = 0; i < n; ++i) a[i] = a[i] * inv;
}
return a;
}
template <int mod, int g>
auto mul(const auto &a, const auto &b) {
using mint = modint<int, mod>;
if (a.empty() || b.empty()) return std::vector<mint>();
int n = sz(a), m = sz(b), s = n + m - 1 == 1 ? 1 : 1 << std::__lg(n + m - 2) + 1;
std::vector<mint> A(a.begin(), a.end()), B(b.begin(), b.end());
A.resize(s), B.resize(s);
A = dft<mod, g>(A, 1), B = dft<mod, g>(B, 1);
for (int i = 0; i < s; ++i) A[i] *= B[i];
A = dft<mod, g>(A, -1);
A.resize(n + m - 1);
return A;
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, m;
std::cin >> n >> m;
std::string a;
std::cin >> a;
std::vector adj(n, std::vector<int>());
for (int i = 0; i < n - 1; ++i) {
int x, y;
std::cin >> x >> y;
--x, --y;
adj[x].push_back(y), adj[y].push_back(x);
}
hash.build(n);
std::vector ans(n - 1, 0LL);
std::vector vis(n, false);
std::vector size(n, 0), max_size(n, 0);
auto centroid = [&](auto ¢roid, int x, int tot, int fa) -> int {
size[x] = 1, max_size[x] = 0;
int res = -1;
for (int y : adj[x]) if (!vis[y] && y != fa) {
int t = centroid(y, tot, x);
if (res == -1 || max_size[t] < max_size[res]) res = t;
size[x] += size[y];
ckmax(max_size[x], size[y]);
}
ckmax(max_size[x], tot - size[x]);
if (res == -1 || max_size[x] < max_size[res]) res = x;
return res;
} / recursion;
[&](auto &solve, int root) -> void {
vis[root] = true;
static std::vector data(2, std::vector(n, info()));
static std::vector belong(n, 0);
std::vector<std::tuple<uint64_t, int, int>> all;
static std::vector subtree(n, all);
auto dfs = [&](auto &dfs, int type, int x, int fa) -> void {
static std::vector<int> stack(1), rest;
static uint64_t diff = 0;
static int must = -1;
if (type == 0) {
if (x == root || fa == root) belong[x] = x;
else belong[x] = belong[fa];
}
char ch = a[x];
if (type == 1 && ch != '|') ch ^= '{' ^ '}';
auto diff_copy = diff;
auto must_copy = must;
int stack_back = stack.back(), stack_size = sz(stack);
if (ch == '{') {
int cnt = stack.back();
if (sz(stack) == 1) {
stack[0] = 0;
rest.push_back(cnt);
diff += ((type == 0 ? 1 : -1) * (cnt - rest[0]) + n) * hash(sz(rest) - 1);
} else {
stack.pop_back();
if (must != -1 && must != cnt) must = INF;
else must = cnt;
}
} else if (ch == '|') {
++stack.back();
} else {
stack.push_back(0);
}
if (sz(stack) > 1 || stack[0] != 0 || must == INF) data[type][x] = {INF, 0, -1};
else {
data[type][x] = {must, diff, sz(rest) ? rest[0] : -1};
all.push_back(std::make_tuple(diff, type, x));
if (x != root) subtree[belong[x]].push_back(std::make_tuple(diff, type, x));
}
for (int y : adj[x]) if (!vis[y] && y != fa) {
dfs(type, y, x);
}
diff = diff_copy, must = must_copy;
if (ch == '{') {
if (stack_size == 1) {
stack[0] = stack_back;
rest.pop_back();
} else {
stack.push_back(stack_back);
}
} else if (ch == '|') {
--stack.back();
} else {
stack.pop_back();
}
} / recursion;
for (int x : adj[root]) if (!vis[x]) subtree[x].clear();
dfs(0, root, -1);
data[1][root] = info();
all.push_back(std::make_tuple(0ULL, 1, root));
for (int x : adj[root]) if (!vis[x]) {
dfs(1, x, root);
}
auto calc = [&](int coef, auto &order) {
std::sort(order.begin(), order.end());
std::vector first(sz(order), 0), must(sz(order), 0);
for (int i = 0; i < sz(order); ++i) {
auto [_, type, x] = order[i];
first[i] = data[type][x].first;
must[i] = data[type][x].must;
}
for (int l = 0, r; l < sz(order); l = r + 1) {
r = l;
while (r + 1 < sz(order) && std::get<0>(order[r + 1]) == std::get<0>(order[l])) ++r;
int mid = l - 1;
while (mid + 1 <= r && std::get<1>(order[mid + 1]) == 0) ++mid;
if (std::get<0>(order[l]) == 0) {
static std::vector cnt(n, 0);
for (int i = l; i <= mid; ++i) ++cnt[must[i]];
for (int i = mid + 1; i <= r; ++i) {
if (must[i] != -1) ans[must[i]] += coef * cnt[must[i]];
else {
for (int j = l; j <= mid; ++j) ans[must[j]] += coef;
}
}
for (int i = l; i <= mid; ++i) cnt[must[i]] = 0;
} else {
int maxl = 0, maxr = 0;
static std::vector cntl(n, 0), cntr(n, 0);
std::vector<int> vl, vr;
for (int i = l; i <= mid; ++i) if (must[i] == -1) {
if (!cntl[first[i]]) vl.push_back(first[i]);
++cntl[first[i]];
ckmax(maxl, first[i] + 1);
}
for (int i = mid + 1; i <= r; ++i) if (must[i] == -1) {
if (!cntr[first[i]]) vr.push_back(first[i]);
++cntr[first[i]];
ckmax(maxr, first[i] + 1);
}
for (int i = l; i <= mid; ++i) if (must[i] != -1) {
int want = must[i] - first[i];
if (want >= 0) ans[must[i]] += coef * cntr[want];
}
for (int i = mid + 1; i <= r; ++i) if (must[i] != -1) {
int want = must[i] - first[i];
if (want >= 0) ans[must[i]] += coef * cntl[want];
}
static std::vector gather(n, std::vector<int>());
std::vector<int> musts;
for (int i = l; i <= r; ++i) if (must[i] != -1) {
if (gather[must[i]].empty()) musts.push_back(must[i]);
gather[must[i]].push_back(i);
}
for (int mustv : musts) {
auto &v = gather[mustv];
static std::vector cnt(n, 0);
for (int i : v) {
if (i <= mid) ++cnt[first[i]];
else {
int want = mustv - first[i];
if (want >= 0) ans[mustv] += coef * cnt[want];
}
}
for (int i : v) cnt[first[i]] = 0;
v.clear();
}
if (std::get<0>(order[l]) == n * hash(0)) {
std::vector cl(cntl.begin(), cntl.begin() + maxl), cr(cntr.begin(), cntr.begin() + maxr);
static bool flag = false;
if (!flag) {
flag = true;
auto res1 = mul<1004535809, 3>(cl, cr);
auto res2 = mul<998244353, 3>(cl, cr);
assert(sz(res1) == sz(res2));
for (int i = 0; i < sz(res1); ++i) {
int64_t res = res1[i];
while (res % 998244353 != res2[i].x) res += 1004535809;
ans[i] += coef * res;
}
} else {
auto res = mul<1004535809, 3>(cl, cr);
for (int i = 0; i < sz(res); ++i) ans[i] += coef * int64_t(res[i]);
}
} else {
for (int il : vl) for (int ir : vr) {
ans[il + ir] += (int64_t)coef * cntl[il] * cntr[ir];
}
}
for (int i = l; i <= mid; ++i) cntl[first[i]] = 0;
for (int i = mid + 1; i <= r; ++i) cntr[first[i]] = 0;
}
}
};
calc(1, all);
for (int x : adj[root]) if (!vis[x]) calc(-1, subtree[x]);
for (int x : adj[root]) if (!vis[x]) {
solve(centroid(x, size[x], root));
}
} / recursion(centroid(0, n, -1));
for (int i = 0; i <= m; ++i) {
std::cout << ans[i] << " \n"[i == m];
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 6ms
memory: 4888kb
input:
4578 4576 |}}|}|{}{}|}|||{}}|}|||{|}||}}{}{{}|{{}|}}{}|{}{{}{{|{}}}|{||}||}}}}}|}}{||}|}{|{{}{}|{}{{}}}|{{}|}{}{}}}}}||}|}||||||{|}{}|}{|}{|}||}}}|}{{|}{{{}{}||{}}||}{}|}}{||{}}{}}|{|}{{|}}|{}||}}{}||}}|{|{{|}|{{}|{{{}}|||{}|||{{}}{||}{{|{{{{|{|}{|}{||}}}{{|}{}|{}}}{|}}{{|{|}{||{||||{|}}{{|}}{|||}}|...
output:
1736 642 213 88 42 16 8 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4577 tokens
Test #2:
score: 0
Accepted
time: 5ms
memory: 4908kb
input:
4598 4596 ||||||||}|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||{|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||{|||||||||||||||||||||||||||||||||||||||||||||||...
output:
1 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 4597 tokens
Test #3:
score: 0
Accepted
time: 13ms
memory: 6208kb
input:
4562 4560 }{}{{}{{{}}}}{{{{{}{{}{{{}}{{}{{{}}}{}{}}{}{{{{}}}{{}{{}}{{{{{{{{{{}}}{}}}}}{{{{{}}}}}{{}}{{}}{}{{}}{}{{}}}}}{{}}}}{{{}{}{}}{}{{{}}{{{{{{{}}}{}}}}}{}}{}{{}{}}}}{}{{{{}}}}{}{{}{}}}}{}}}{}}{{{}}}{{{{}}}}}}{}}{}}{}}{}{{{{}}}}{}{{{{{{{}}}{{{}}}}}{}{}}{}{}}}}{{{}}{}}}{{}}{}}{}}}}}{}}{{}}{}}}{{{...
output:
5094047 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4561 tokens
Test #4:
score: 0
Accepted
time: 11ms
memory: 5000kb
input:
4558 4556 ||{{}{}|{}||}}}{||}{{|{|{|||{|}|}|}}}{{}|}}}|}}|{{|||{{|{}}{||}|{}}||||{||{||}|}{|}{||{{{{}||{}}{{}}|||}{}||{|}|{{{}|{|{{}}|}|}}}}|{{|{|}|}|{|}{{}}{}||{}{}||}}|}}|}{|}|{}|}|{|{{{}}}|{|{{{{}}|}{{||{|{{||||}}{|}|{|||{}}}}{{{|{{{|||{{|{{}|{||||}}}||||}}}|{|}}|}{{|}{{{{}{|||}{{|}}{|}{}{{}}}}{}...
output:
2009 734 273 142 84 39 10 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4557 tokens
Test #5:
score: 0
Accepted
time: 7ms
memory: 5100kb
input:
4560 4558 {}{{}}}{{{}}{{}}{{{}{}}}}}{{{}{{{}}{{}{{{}}{{}{{}}{}}|{}{{{{}{{}}{}{}}}}{{}|}}}{{}{}}}{}{{}}{}{}|}{{}{{{{{}}}}{{{}}{{{}}}}}}{}}{{{}}}}}}{}}{{}}}{}{{}{{}{}{}}}}}}}{{}}}}}}}}{}{}}{}{}}{{}{}}}}{}}}}}}{}{{{}}}{{}{|}{}}}{{}}}}{}{}{{{{}}{}{{}{}{}{}{{{}}{}}{}{}}}}{}{}{}}{}{{{{{}{}{{}}{}{}{}{}{}}}...
output:
11100 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 4559 tokens
Test #6:
score: 0
Accepted
time: 3ms
memory: 5388kb
input:
4594 4592 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4593 tokens
Test #7:
score: 0
Accepted
time: 10ms
memory: 4952kb
input:
4561 4559 {}{{}{{}|{}{||}|}|{|{}|}}||{}||}}{||}}{{{{||}}}}|{|}}|||||{{|{|}}||{||{||{}}|{|{|{|}}||}{}{{}{|{}{{||}||||{|||}{}}}{}{{{{}}|}|}}}}|{}{|{|||{|||}{{{}}|}{}{{}{}|}}|{}|{|{}}{}{}}}|}|}{{}||{|}|}{}|}}}}|{}|}{{{}}{}|}}|}{{|{|}{{||{|}{|}}}}}{{||{}|{{{}{{|}}|{}}{}}}}}||}|{{{{{}}}||}||}|{{{{}}|}}{{...
output:
1828 565 244 83 27 11 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4560 tokens
Test #8:
score: 0
Accepted
time: 11ms
memory: 5000kb
input:
4579 4577 {}}}}}{{}}{{{}}{}{{{}}}}{{{{}{{{{{{{{{{{{{{{}{}{}{}{}{{}}}}{{{}}{}{}{}}}}{{}}{}{}}{{{{}{{{{{{}}{}{}{{{{}}}}}{}{}}}}{{{{{}}{}}}}}{{}}{}}{{}{}{}}{{{}{}{}}{{}{{{}}}{}}{{}{{{}}}}}}{}{}}{{{{}}{{{}}}{{{}}}{{{{}}}}{{}}{{}{{}}}{}{{{{}}}}}}{{{}{{{{}{{{}}{{}}}{{{}}{{}}{{{{}}{{}{}}{}{{}{}}{}{}}}{}}}}...
output:
26457 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4578 tokens
Test #9:
score: 0
Accepted
time: 7ms
memory: 5108kb
input:
4557 4555 {}}{{{}}}{}}{}}{}}}{{}}{{{}{}{}{}}}}{}{}}}{{}}{{{}}{}}}{{}{}}}{}{}}}}{{}{}{{}{{{{{}{{{{{}}{}}}}}{{{}{{}}{{{{{{{}{}}{{{}{}{{}}{{}{{{{{}{}{}}{{}}}}}{}{{{{}{}}{{}{}}}{{}{{{{{{}}{{}{}{{}{{{{}{}}}}{{{}{}}}{{{{{}}{}}{}{}{}{}}{}{{}{{}{{}{{}}}}}}}}{}}}}}}{{}{{}{}}}}}}{{{}{}{{}{}}{{}}{}}{{{}{{{}}}{...
output:
1411510 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4556 tokens
Test #10:
score: 0
Accepted
time: 4ms
memory: 4340kb
input:
4586 4584 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||...
output:
0 1 3 4 3 1 2 1 1 0 1 3 2 2 2 2 1 2 1 0 0 1 1 2 2 2 2 1 0 1 0 1 2 2 2 0 3 1 2 1 1 1 2 1 0 0 2 1 0 3 1 0 0 0 0 1 3 3 5 3 1 3 1 2 2 3 3 2 1 2 2 1 1 2 2 0 0 1 2 1 1 3 1 0 1 0 1 1 1 2 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1 0 0 0 0 0 1 1 0 1 0 0 0 0 1 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4585 tokens
Test #11:
score: 0
Accepted
time: 7ms
memory: 5416kb
input:
4596 4594 |}}}}|}}}|}}|}}}}|}}}}}|}|}|}}}}}|}}}||||}}|||}|}}|}}|||}|}|}|}|}|||||}}|}|}}|}|}}}}}}}}}}}}}}|}}}}}}||||}|||}}}}|}}}}|}|}|}|}}}|}|}}}}}||}}}}}|}||}}|}|}}}}||}}|}|}}|}||||||}}}}}||}||||}|}}}}||}}}}|||}|}|||}}}|||}}}}}|}}|||}|||}}}|}}||}|}}}}}||}}}||||}}|}|}|||}}}|}|}}|||||}}}|}}||}||}}||}}...
output:
0 0 2 0 1 3 0 0 2 0 0 1 2 0 0 1 1 1 0 1 1 0 2 0 2 3 1 1 2 3 0 2 1 2 1 0 0 0 3 1 4 4 1 5 2 2 1 1 0 3 0 1 0 0 1 0 0 0 0 1 2 0 2 4 1 1 5 1 2 3 1 4 1 1 3 0 0 2 0 3 1 0 3 1 0 2 0 2 1 0 1 3 0 3 1 2 3 1 0 0 2 0 0 5 3 0 1 0 4 0 0 2 1 2 1 1 1 2 1 1 0 1 1 0 2 0 2 2 2 1 1 0 1 2 0 2 1 3 2 0 0 0 1 1 0 0 2 0 0 3 ...
result:
ok 4595 tokens
Test #12:
score: 0
Accepted
time: 8ms
memory: 5372kb
input:
4562 4560 }|}}}|}}}}}|}}}}}}|}}}}}}}}}}}}}|}}}}}}}}}}}}}|}}}}|}}}}}}}}}}}}|}}}}}}}}}|}}}}|}}|}}}}}|}|||}}}}}|}}}}|}|}}|}}}}}}}}}|}}}}}}}}}}}}}}}}}}}}}}|}}|}}}}}}|}}}}|}}}}}|}}}|}}}}}}}}}}|}}|}}}}|}}}}|}}}}}}}}}}}}}}}}|}}|}}}}}}}}}}}}}|}}}|}}}}}}}}}}}}}}}}}}}}}}}}|}}}}}}}}}}}}}}}}}}}||}}}}}}}}}}}}}}}...
output:
9 4 7 10 9 7 6 9 12 16 1 8 12 7 10 12 2 3 10 6 8 12 12 17 10 10 5 6 7 10 12 9 12 2 7 12 1 6 9 11 6 9 9 12 10 10 7 10 7 7 5 8 5 2 5 9 13 7 4 7 10 6 6 3 5 13 7 13 10 7 7 8 5 9 10 8 9 10 10 7 3 13 6 9 8 9 6 6 6 7 10 7 7 7 7 12 9 8 6 9 7 6 5 9 4 10 11 7 8 10 11 8 8 7 8 9 13 8 8 6 7 6 9 7 9 2 6 5 5 11 14...
result:
ok 4561 tokens
Test #13:
score: 0
Accepted
time: 4ms
memory: 5036kb
input:
4578 4576 |}|||||||||||||||||||}|||||||}||||}}|||||||||||||||||||}||||||||||||||||}||}||}|||||||||||||||||||}||||||||||||||||||||||}}|||||||}}||||||||||||||||||||||||||||||||||||||||}||||||}||}||}|}||||}|||||}||||||||||||}||||||||||||}|||||||||||||||}|}|||||||}||||||||||||||||}||||||||||||||||}|||||...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 ...
result:
ok 4577 tokens
Test #14:
score: 0
Accepted
time: 3ms
memory: 4708kb
input:
4560 4558 }}}{}{{{{}{}{{}}{{{}{}}}}{{{{}}}{{{{}{{}{}{{{{{{}}}}}{}}{}|{{}{{}}{}{}}{{}{|{{{{}{{{{}{{}|{}|}}}{{{}}}}{}}}}}}}{{}}{{{{}}}{{}}{{}}|{}}{{}{{}}{}{}}}}}}{{}}|}{}}{}}}{{{}|{}{{}}}}}}}{}}}{{{}{{{{{{}{{{}}}|{}}}{{}}}}{{{}}}}}}}{}|}}{}{}{}|{{{{}{{{{}|{{}{}{}{}{}}{}}}{}}}}{{{|}}}}}}}}}{}}}{{{}{{{{...
output:
200 3999489 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4559 tokens
Test #15:
score: 0
Accepted
time: 9ms
memory: 4820kb
input:
4582 4580 {|}}{|{}}{|{}}|{}|{|}{||{{{|{|}}}{}}|{}}{{|{|}}{{||{{|}|{}|||{}||}{}{{{|{|||{}}{||{||}}{|{|{|{{|||}}}||{{{{{|}{}|}{{}{}{{|{}}{}||}}{}{{{}{|}|}}{{{}|}}}}{}}{|{}}}}}{||{{{{|{|}{{}||{||}{{}|{|}}}}|{|||}}||{|{{}|{|}}{}{{{|}|}|}||}|{|}{{|}|{}}{{{{|{|{{|{}}{{|}|{}||{|{||}{}{}}}|||{|{}{{{|||}{{{}...
output:
1782 724 245 89 41 15 6 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4581 tokens
Subtask #2:
score: 20
Accepted
Test #16:
score: 20
Accepted
time: 267ms
memory: 33924kb
input:
99981 99979 }|}{|}|}||{{{{|}}}{|}|}|}||||}}}|||||}|{{|||{|{}||}}{}}}}||{}{{}{{|{}{|}}}{|}||{|{}}|{{{|}{}{}}|}{}}{}||||}{|{{}{|{}}{}}|}}{|}{{}{{}|{|||{|{{}}{}{|}{||}}||}|}|}|{}{{}|}||}{{|{}{}}}||}}|}}||{||||||}}{}}}|}}|}}}}|}}}}||||{}}{{|{{}|}|{{}{|}||}{|}|}||{}}|}|{{{{{||{}}{}|{|}{{{|}|{|{|}}|{|}{}}...
output:
28892 8382 2558 832 288 88 39 4 4 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99980 tokens
Test #17:
score: 0
Accepted
time: 271ms
memory: 33856kb
input:
99955 99953 {}{||{}{||}||{}{{{{{{}}|||{{{{}}}}{{}|{{{}{|}{}}{|{||{{|{}|}|{||||{|{{{{}{|}{}{}{{}}{}}}{}{}{}{{|{|{{{}|}{{{||{}{}||}{|}{}||}|||{|{}{}}||{}}{{}|}}{{}{{}{|}{}{}}}{||}{|}{|}{||{{{{}{{|}|||{|||{{|}}|{{}{|}{|{{}{}|}{||}}}}|||}||{}{{||||}||}{}|{|{}||{{{}{{{||}}|}{||}}}|}{}{|||}}}|{|{}{|{{{|{|...
output:
28685 8565 2557 826 268 90 33 16 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 99954 tokens
Test #18:
score: 0
Accepted
time: 332ms
memory: 63276kb
input:
99981 99979 ||}|}|{}{{}{{{}}|{}}}|{{{}||{{||{{|}{}}}}{{|}{{}{}|}|{}}|}{{{}|}{}{{}}|}|}}|}{{||{{}{{||}|}}|}{|{|{{}{|{}|}|}}}{}|||{}}{|}{{{||||{{{|{{}}{{{{{{|}{}{}}}}||{|}}}||{}{{{{{}||{{|{}}|}{|}}|{}{{}|}||{{{{{|{|||}{|}}{}{{|}}|}{|{{|||||}|}|}}{{|{}|{{{}}|}}}}}|{}}||}{{{{|}{|{{}||}{||}{}}}|}|||{|}{}...
output:
2400167714 146 51 17 2 4 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 99980 tokens
Test #19:
score: 0
Accepted
time: 403ms
memory: 63068kb
input:
99967 99965 |{{{}{{}}}{{}}{}}}{{{||{}|}{|{{|}}}{{}{}{{{|}}}{||{|}|||}{{}|{||{|{{{|{}|}}}|{}}}{{}|}|||{}||}|}}{{||{}{{}}{||}||}}|}}{|{{||||}{|}}|}{}{}{|}|{|{{|}|{||{}{}|{{|}{{}||{||{{||}}{}||{{|}||}|||}|{}{}|{|}|{{{{}}|}}{}}}}}|||}}{{|}{|||||}{|{{}|}{}{||}{}{{}{{}}||{|{{|}|{|}|}|}|{}{|{}|{{}{{{}||{{}...
output:
641 159 52 13 5 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99966 tokens
Test #20:
score: 0
Accepted
time: 170ms
memory: 30412kb
input:
99964 99962 ||||||||{|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||...
output:
4 2 5 1 2 3 2 2 1 1 2 1 3 4 3 2 3 2 1 1 2 0 0 3 1 1 0 0 3 1 1 2 1 1 0 1 0 4 1 1 3 0 4 1 4 0 2 2 2 4 1 4 2 2 1 3 1 1 0 2 0 2 1 3 2 3 1 0 1 0 2 1 0 0 0 2 2 3 1 0 0 1 0 0 0 1 0 3 0 1 1 1 3 1 2 1 0 0 2 2 1 2 4 2 1 3 0 2 0 1 0 0 0 1 1 0 1 0 2 0 0 1 0 0 0 2 2 1 0 1 2 0 0 0 0 0 0 1 1 1 1 2 1 0 1 0 1 0 0 3 ...
result:
ok 99963 tokens
Test #21:
score: 0
Accepted
time: 286ms
memory: 37812kb
input:
99953 99951 }{{{}}{}{{{}{{{{}}}{{}}{{}}}}}{}}{{}}}}}}{{}}}}}{{{}}{}{}}}{}}}{}}{}}{{}}{}}{}{{}{{}{}}{}}}}}{{{{{{}}}{}}{}}}{{}{}}{}}}}}{{}}}}{}{{}}}}{}}{}}{{{{{{{}{{{}{}}}}{}|}}{}}}{}}}}}}}{{}}{}{}{{{{}}{}{}}{}{{{{{{{}}{}{{}{{{}{{{{{{}{}{}}}{{{{}}{{}{}{}}{}{{}{}{}}{}}{}}{}}}{{}}{}}}}}}{}}}{}{}}{}{{{{{...
output:
157106 355 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 99952 tokens
Test #22:
score: 0
Accepted
time: 194ms
memory: 30628kb
input:
99961 99959 {}{|}{||}{|||}{||||}{|||||}{||||||}{|||||||}{||||||||}{|||||||||}{||||||||||}{|||||||||||}{||||||||||||}{|||||||||||||}{||||||||||||||}{|||||||||||||||}{||||||||||||||||}{|||||||||||||||||}{||||||||||||||||||}{|||||||||||||||||||}{||||||||||||||||||||}{|||||||||||||||||||||}{||||||||||||...
output:
2016 461 122 42 13 4 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
ok 99960 tokens
Test #23:
score: 0
Accepted
time: 189ms
memory: 33652kb
input:
99964 99962 {}||{}}{{}{{{|}}}{|}|}{||{|}}{|{}||{|||}|}|{}{}}{{|{}}}||{}{}}}||{{|}}{}}{|{|{}{}{{|{|{|{||{}|{}{{{||}|{|}{{}}{||}}|||}|||}}{|}{}{|}}{|{|}{{{|{}}{}{}{}}{}|}{{}{}{}}{{{|}{{{}}}|{|{{{{|}|}{|}{}|{|{{||}|{}}}}{{||}{||}|}|}}{||{{}{{}|}|}{|}|}|}}}|}{}{{{||{|}}|{}||{}}}{}{}}{|}}}}{{}}}|}||||{}}...
output:
529 173 55 9 9 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 99963 tokens
Test #24:
score: 0
Accepted
time: 297ms
memory: 38872kb
input:
99977 99975 }}}}{}{}{{{{{{{{}}{}}{}}}{{{}}}{}}}{}{{{}{{}{}{}{}{}}}}{{{{{}}{}{}}{{{{{}{}{{}}}}}{{}{{}{{}}{}{}{}{}}}{{{{{}}{{}{{{{}}}}}{{{{}}}}}{{}}{}{}{}}{{}}}{}}}}{{{}{}{{{}{}{{{{}}}{{{{}}}{{{{{{}{}{}{{{}{}}{}}}{}}}}}}}{}{{{}}}}{{{}}{{{}{{{{}{}}}{{}}}}{{}}{{{}{}}}}}{{}}}{}{{{{{}{}}}{{{}{{{{{}{}}}{{}...
output:
198696 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 99976 tokens
Test #25:
score: 0
Accepted
time: 302ms
memory: 38844kb
input:
99955 99953 {{{}{}}{{{}{}}{{{{}{}}}{}}{{}}{{}}}{{}}}{}{{}{{}}{}{}}{{{}}{}{}{{{}{{}}}}{}{{}{}}}{}{{}{}{{}}{}}{}{{{{{}{}}}{{{}}{}}}}{{}{}{}{{}{{{{}{}{{}}{{{{{}{}{{{{{{{{}{{{{}}{{{{{{{{}{{{{}}}{{}}{{{}{}}}}{}}}{}}{}{{{{}{}}}{{}}}}}{}{}}}{{}}{}{}}}}}}{}}{}}{}}{{}}}{{{{}}{}}}}}{}{}}{{}}{}{{}{{{{}}{}}}}}}...
output:
299708 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 99954 tokens
Subtask #3:
score: 5
Accepted
Test #26:
score: 5
Accepted
time: 355ms
memory: 33772kb
input:
99990 0 }}}}{{{}{{{{}}}}}{{{{{}}{{}{}}}{}}}{}}}{{{}{{{{}{}}}{{}{{{}{}{}{{{}}{{}}{{{}}{{{{{}{}{}{}}{{{}{}{}{}}{}{}{{}}}{{{}{}{}}{}{}{}}}}}{}{{{}{{{}}{}}}}}{{}}{{{}}}{{}{{}{}{}}{}{}{{}}}}{}{{{}{}{{}{{}{{}}}{}}{{}{}}}}}}}}}}}}{{}}{}{}}}{{{{{}{{{}}{}}{}{{{{}}}{}}}{{}{}{{}{}}{}}}}{}{}{}}{{}}}{}{{}}{{{}}{...
output:
637900
result:
ok "637900"
Test #27:
score: 0
Accepted
time: 350ms
memory: 33700kb
input:
99976 0 {{{{}}{}{}{{}{}{}}{}{}}}{}}}}}{}{{{{{{}{{}}}}}}}{{}}{{{}}{{}{{}}{{{}{}{}}{}{{{}{}{{{{{}}}{{}}{}}}}{{}}{{}}{{}}{{}{{}{{}{{{}}{}{{}{{{}}{}{}}}}{{{{{}}{{{{}}{{{{}{{}{}{}{}}{}}{{}}}{{}{{}}}}{{{}{{{}}}{}{{}{{{{}{{{}{}}}{}{}}{}{{{{}}{{}}{{{{}{{{}{}}}}}{{}{{}}}{}}{}{{{}}{}{{{{{{}{{}}{}{{{}}{{{}{}}}...
output:
625351
result:
ok "625351"
Test #28:
score: 0
Accepted
time: 377ms
memory: 42648kb
input:
99994 0 }{}}{}{{{}{{}}}}{{}{{{}{{}}{{}{}}}}}{{}}}{{}}{{{}{}}}}}{}{}{{{}{{}{{{{{{{}{{{{{}{{{{}}}{}}{}{{{{{}{{}{{{}{}}{{{}}{}}{{}}}{{}}{{{{}}}}{}{}}{}{}{{}}{}{}}{{{{{}}}{}{}}}{}{}}{{{{}{}{}}{{}}}{{{{}{}}{{{{}}{{}{}{}{{{}{{}{}{{}{{}{}}}{{{{}}}}{}{}{}}{}{}}{}{}{}{}}{{}}{}{{}}{}}}}}{{}{{}}}{{{}{{{{{{{{{}...
output:
56331611
result:
ok "56331611"
Test #29:
score: 0
Accepted
time: 508ms
memory: 62912kb
input:
99962 0 {{{{}{{{{{{{}{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{...
output:
2614
result:
ok "2614"
Test #30:
score: 0
Accepted
time: 237ms
memory: 41968kb
input:
99955 0 }}{}{{{{}{}}}{}}}}{{}}}{{{}{}{}}{}}}{{}{}}}{{{{}}{}}}}{{}{}}{}{}}{{{{}}}}}{}{{}}{}{{}{}{{{}{}}{}{{}{{{{}{}{{{}{}}{}{}}}{}{}{{}}{}{{}{}{{{{}}{}}}}}}{{{{}}{}{}}}}}}{}{{{{}}{{{}{}{{}}}{}}{{}}{{}}}{{{{{}{}{{{{{{{{}{{{}}{{}{{{}}}{}}{}}{{}{}{}}}}{}}}{{}}}{}}{{}{{}}{{{{}{{}{}}}{}}{{}}}}{}}}}}}{}}}{...
output:
7871913
result:
ok "7871913"
Test #31:
score: 0
Accepted
time: 336ms
memory: 33712kb
input:
99950 0 }}{}{}{}{{}}{}{}}{}{{}{{{}}{}{}}}{{{}}}}}{}}}}}{{}}{{{}{{{}}{}}}{}{{}}}}{{}{}}}{}{}}}{}{{{{}{}{}}}{{}}{{{}{{{{{}{{{{}}}{}{{{{{}}}{}{}}{}{{}}}{}{{{{{}{}{}{}}}{{}}{}{{}}}}}}}}{}}}}{{}{{}{{}}{{}}}{{}{{{}{{}}}}{}}{{{{}{{}{}{{}{{}}{{{}}{}{}}}}{{}}{{}{{{{}{}{{{{{}{}{}{}}}{{{{{{}}{{}}{}}{}{}{}}}}}}...
output:
3425629
result:
ok "3425629"
Test #32:
score: 0
Accepted
time: 420ms
memory: 56188kb
input:
99961 0 {}{{{{{{}{{{{}{{{{{{{{{{{{{{{{{{}}{{}{}{{{{{{{}{{{{{{{{}}{{{{{{{{{{{{{{{}}{}{{}}{{{{}{{{{{{{}{}{{{}{{{}{{{{{{{}{{{{{{{}{{}}{{{{{{}{{{{{{{{{{{{{{}{{{{{{{{{{}{{{{{{{{{{{}}}}}{{{}{{{{}{{}{{{{{{{}{{{{{{{{{{{{{{{{{{{{{{}{{{{{{{}{{{{{{{{{{{{{{{}}{{{{{}{{{{{}{}{{{}{{{{{{{{}}{{{{{}{{{{{}{}{{{}{{{{{}...
output:
43885
result:
ok "43885"
Test #33:
score: 0
Accepted
time: 150ms
memory: 34592kb
input:
99975 0 {{{{{}{{{{{{{{}{}{}{{{{{{}{{{}{{{{{{{{{{}{}{{}{{{{{}}{{{}{{{}{}{{}{{{}}{}{{}}{{}{{{{{{{{{}{{}{{}{{{{}{}{}{{}{{}{}{}{{{}}{{{{}{{{}{{}{{{}{{}{{{{{{{{{{{{{{{}{{}{{{{}{}{{{{{{{{{{{{{{{{{{{{}{{{{{{{}{}{{}{{{{}{{{{{{{{{{}{{{{{{{{}}{{}{{{{{}{{{{{{{{{{{{{{{{{{}{{}}{{{{{{{{}}}{{{{{{}{{{}}{{{{}}{{{{{{...
output:
26290
result:
ok "26290"
Test #34:
score: 0
Accepted
time: 346ms
memory: 35780kb
input:
99982 0 {{{{{{{}}{}{}{{{{}{{{}}}{}}{{{{{}{{}{}}}{{{{}{}{}}}{}{}}}}{}}}{{{{}{}}{}{{{}}{{}{{}{{}}}{{{}}}}{{{}}}}}}}}{}}}}{{}{}}}{{}}{{{}}}{{}}{{{{}{{}}}}{{{}{}{}}{{{{}}{}{}{}{}}}}}{{{{}}{{}}{{{{}{}{{{{}{{}}}{}{}}}}{}{}{}{{}}}}{{{{{{{{}{}{}}{{}}{{}{}}{{}}}}{{}{{{}{}}}{{}{}{}}}{{{}}{{}}}}}}}{{}}}}{{}}{}...
output:
341295
result:
ok "341295"
Test #35:
score: 0
Accepted
time: 495ms
memory: 63416kb
input:
99989 0 {{}}{{{{}}{}{}{}}}{}{{}}}{}}{{}{}}}{{{}{}{{}{}}{}}{}}{{}}{}}{}{{}{}}}}}}{{}{{}}{}}}}{}{}{}}}}}}}}{{{{{}{{{{}}{}}}{{{}{{}{}{}{}}}{}{{{}}{}{}{{}{{}}{{}{{}}{}}}{{}{{{}}}}{{}{{{}{}{}{{{}{{{{}}{{{{}{{{{}{}}}{{}}{{}{}{{{}}{{{}}{{{{}{}{{}}{}{}{{}{}}{{}{}}{}}}}{}}}}{{}{{{{{}}}{{{{{}{}}}}{{{}{}}}}{{}...
output:
2376357467
result:
ok "2376357467"
Subtask #4:
score: 15
Accepted
Dependency #3:
100%
Accepted
Test #36:
score: 15
Accepted
time: 321ms
memory: 28192kb
input:
99962 3 }{{}}}|}{}}||{{||{{}}}}{}|{}|}}{|}}|||{{|{}{{{||{}|}{|||||}|{||{|{{}{}{}||}{}{|{||{|}|}|{{|}}{|}}}{|{{}{|}{{}|}}}|{}}|{|{{||{}{}}}|{{{{||}}|}|||}{}||}}|{}}{{|}}}{|}||{||}}}|{{}}}{|}|{}}|{}||{{{{}}{}|}||{}|||{{{}{||{||{|{}{}}{{||}|}}|}{{}}{|}||{{||}|}||{{}}{}{}}|}}{|}||}}||}{|{{|}|}}||}{|{{{{...
output:
37014 13518 4855 1819
result:
ok 4 tokens
Test #37:
score: 0
Accepted
time: 328ms
memory: 32268kb
input:
99980 3 }}|}}{|{{|}}||||}{{{}}{|||{|}{{|||{}{||}|||}||}}}{|}{{{}{|}}|{}}}}||}{}}||||{||{}|}{}{|}||}{}|{}}}{}{|||}}}}{}}|}}{{|}{{|}|{}}||}|{|}||{}|{||}}{{|{{|}}{}{||}|{|{|{}}|}|{||{{{}||}|{}{|{{}{{||{{{{|}|}}}|}{{{}||{{||{}{|{{||}{|{|||}}{}}|{{{{||}{||}}|{}|}|{|}|}{{|{{{|{{{||}}{}{{|{{}|||}|{}{|}||{|...
output:
48311 17859 6080 2702
result:
ok 4 tokens
Test #38:
score: 0
Accepted
time: 274ms
memory: 26876kb
input:
99958 3 {|}}}}{}|{}}{|{||}}}}}|{}||||{|{|}{{{}{}{}|{}{}{||{|{|}|||}}||{{}{}|}|{}|}{{|{}}}|}}{}{{||{|||{{}}}|}|}}|}}}|{{{|{{{{}}}|}}|{{{|}{{{|{{}}||||}||{{}}{{||}}}||{{}|}|{}{||}}{|}{{{{|}||}{||}}}}|{}}|||}||}{}{{}|}||{|{{{{}}{}|{|}{{}}{|}|||}{||||}}}}}}}{|}|}{|{{}{|}{||{}{}||||{{}|{|}}}}|{{{||}|}||{...
output:
39635 14384 5425 2004
result:
ok 4 tokens
Test #39:
score: 0
Accepted
time: 391ms
memory: 51432kb
input:
99996 3 |}|{{|{|}{{}}|}}}}{}}|}}}}{||{}{}}|}}{|}|{|{}{|{}|}|||}}}}{{{|{{{{|||}{|{}|{{}}{{{{}|{}||}}{{{||{}}|}|{{}{}}|{||{}|}}{}}|}{|||{{{|}|{{|{}|{|}}{|}{}}}}|}{}{{}{||}{{}}}}{}|{||{}}|}}}{{{{||{|}}}}|{{{}|}{|{|}{||{}{}{{}||||{|}|}|}{}}{{{{}}{|||||}{{|}{||}||{}|{|||}|||}}}{}}}|{}{}}|||{|}{}}||{{|{}}...
output:
1130 33893 8 0
result:
ok 4 tokens
Test #40:
score: 0
Accepted
time: 307ms
memory: 37136kb
input:
99987 3 }}}}{{}}{}{{{{{}}{{{{}}}}}{}}}{}}}{{}}{{{{}}{}{{{{{{}{{}{{{{}}{}}}}}{}{{{{}{}}{{}}}{{}}}}{}}}{{{{}}{}{{{}}}{}{}{{}{{}}}}{}}{}{{{}}{{}{{}}}}}{}}}{{{{{}}{}}}{{{{{}{{}{}{{}{}{}}{}}{{{{}}{}{{}{{{}}{{}}}}}}{}}}{}}}}}{}}{}}}{}}}}}{}{}{{{}}}{}{}{{}{{{{}}{{{{{}}{{}}{{{}{}}}}}}{{}}{}}}{{}}}}{}}}{{}{{...
output:
166216 260 2 1
result:
ok 4 tokens
Test #41:
score: 0
Accepted
time: 137ms
memory: 31184kb
input:
99997 3 }}}}{{{{{{}{}{{{{}}}}}{}{{{}}}{}}{}}{{{}}{{}}}}}{{}{}{}}}{{{{}}}}}}}}}}{}}{{{}{{}}}{{}{{{{}}{}}{{{{}{{{}{}{{}}}}{}{}{{{{}}{{{{}}{}{{}{}}}}{}}}}}{}{}{{{}{}{}}}{{{}{{}{}{}{{}{}}}{{{{{{{}{{{}}{{{{}{}}}}{{{{{{{{}{{{{{{{{{}{{{}{}{}}{{}}}{{}}}}{}}}{{}}}}}}}}{{}{}{{}{{}{}}}{}{}{{}{}}{}{}{}}{}}{{{{{...
output:
150236 60 1 0
result:
ok 4 tokens
Test #42:
score: 0
Accepted
time: 376ms
memory: 45100kb
input:
99979 3 {{{}}}|{}{|||}|||}}}}}}|}}||{|}}}||||{}}{|{|{{|{}}}{}}}{}|}{{}{||||{|}|}|{{|||{||||{{|{{}||{}|{{|{}}}|}|}}}{}}|}|{|{}}{|{}}}{|{|{}}|}{{}}}|}{}{}{|{}|||{{{}|}{|{{{}}{||}{{|{||{}||||}|{}{|||{|}|}}|}||}{{{|{}{}{{|}{{}}}|}|||}{}{}}{}{}|}{{}{||{{}{{{{{{{{{}|}}{}}|{||}{}|}|}{}}{}}}{|{}||||}|||{}}}...
output:
33207 547667770 0 0
result:
ok 4 tokens
Test #43:
score: 0
Accepted
time: 100ms
memory: 31108kb
input:
99975 3 {{}{{}}}}{{}{{{}|{}}}{}{}{{}{{{{}}{}{{}{{|}}{}{{{{{}{}}{}{{{{{}}}}}{}}}{}}}}{}{{{}{}}}}{}{}{{}{{}{{}}{}{}}}{{{{}}{{}{{{}{{}}{}{}{}{{{{{}{{}{}{}}{{}}}{}{}}}}}{{{{{}{}{{}}{}}{}}}}}}}}{}}{{{}{{{{}}{{}}{}{}{}{}}}{}}}}}{}}{}{{{}}}}{}}{}{}{|}}{{{{}{{}{{{}{}{{{}}}}{{{}}{}}{}}{}{{}}{}}}{}}{{}{{{{{}{...
output:
323 1 0 2448864192
result:
ok 4 tokens
Test #44:
score: 0
Accepted
time: 302ms
memory: 30560kb
input:
99979 3 ||}}|}{}{{{}|{}{{{}}|||}{{}{||||||{{{|{{}}|{}}|}{}}}|}{{{{}}|{{}||{}|}{}}}|{}{}||}{}{{{{{{{{{{}|||{}|||}||{}}|}}|{|||{}}|{{}|}|}|{|{|{||{{||{|||}}}|{||}}{{}{|{{|{{}|}|}|{{}}}{{}|{}}}{{{||||||{|{{|{{{{}{{{|{}|{{{{}{|{|}}}}{}|}{|}}}|{{}}|{}{||||||{|{||}}|}}{{{{|}{}}|}|}{|{}}|}{}}}|{{{{|{{{}{}}...
output:
35099 13404 5066 1642
result:
ok 4 tokens
Test #45:
score: 0
Accepted
time: 316ms
memory: 34516kb
input:
99981 3 {{}{}{{{}{{}{{}}}{}{{}{{{{{}}{{{}}}}{}{{{{}}|}{{{}}}{}}{{{{{{{{{{{{{}}}}{{}}{}{{}}}{{}{}}}{{}{}{}{{|}}{{{{}{{{}{{}}}{{}{}}{{}{}{}{{{{{{{{}{}}}}}}{{{}}}{}{}{{{}{{}{}}{}{}{{{{}{}{{{}{{{}{}{{}{{{{{}{}}{{{{}}{}{{{}}}}}}{}}{{{}}{{{}{{}}{}{}{}}}}{{}{}{}{}}}}}{{}}{}}}{{{{{}}{{{}{{}}{}{{}}}}{}|{{}{}...
output:
266389 496 14 0
result:
ok 4 tokens
Subtask #5:
score: 25
Accepted
Dependency #1:
100%
Accepted
Test #46:
score: 25
Accepted
time: 135ms
memory: 15680kb
input:
49951 49949 }|}|}|{{{|{|}{|||||}|{}{|{{{{}||}}{|{|}|}{{{|{}}|{|{||{}{{{}{}||||}||}{{{{|{||{|||}{{|}|{}{{{}|{}}||}{|}}}||}{}|||{{{{{}}{||}||}}||{}}{|}{}}{|{{|}|{}|{}|}}|}|{|{|}{{{}}{|{}|{}}||}}}{{{}}|{{||||||||}{|}}{}}}{{}}}{}{||{}}}}}}}{|||{|{{}|{{{{}|}||||{}}|{|||{||{|{|{|||}{}}|}{{{}|{{{|}|}{{|{}}...
output:
18354 6771 2539 1034 403 141 58 22 6 4 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 49950 tokens
Test #47:
score: 0
Accepted
time: 143ms
memory: 18024kb
input:
49986 49984 }}|}|}}{}}|{}{{{|{}||{|{||}}||}}||}}|{||||{|{}}{|{}|}{{||{|}}{{{||{|}{}}|}{{}{{||{}}{}|{{|||{||{}}}|{}}||}|{||}}{|{|{}|}}{}}}{|{{|}{|{}|{}{{|}}{{}}}{|{{{}|{|}||{|}}{}{}}}|}{}{}{}|}|||{|}|{{}|}}{||}|}{|}}|||{{}{|{}}|}}}|||}}}|{}|{}}{}{{|||||}}{|{|}||}}{|{{{{}}}||{|{|{{{}{{{|{{}{}{|}{||}{}...
output:
23672 8952 3214 1437 522 279 117 56 27 15 7 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 49985 tokens
Test #48:
score: 0
Accepted
time: 219ms
memory: 18340kb
input:
49995 49993 {|||||||||}||||||||||||||}|||||||||||||||||||||||||||}}|||||||||||||||||}|||||||{|||||||||||||||{|||||}|{||||||{|||||||||||||||||||||||}|||||||||||||{|||||||{||||||||||||||||||||||{||||}||||||||||{||||||||||||||||||||||{||||||}||||||{||||}}|||||||||{|||||||||||||{||||||||||||||||||||||||...
output:
0 37 62 72 73 63 77 69 62 53 58 59 79 74 60 58 71 66 86 72 76 61 74 87 70 85 63 72 67 67 68 80 62 69 61 92 74 57 72 67 74 56 81 80 69 61 74 80 66 81 64 68 70 85 55 64 67 58 63 67 78 64 62 64 68 67 64 80 60 74 70 71 85 78 79 65 76 64 74 64 77 52 59 71 78 64 64 72 69 100 73 57 88 70 79 60 73 70 75 67 ...
result:
ok 49994 tokens
Test #49:
score: 0
Accepted
time: 216ms
memory: 31712kb
input:
49995 49993 {{{{}}{}{}}}{}{{{{{}{}{}}}{{}}{{{}}{{}{{}{{{}}}}}}{}{{}{{}{{}{{}}}}{}}}{}{}{{{}{}{{}{}{{{{{{{}}}{{|}}}}}}{}}}{}{}{}{}}}{}}}}{|}}}}{{{{{{{}{}{{{}{}{}|{{{{}{{}}}}{}}}{}}}}}{}{{{{}{}{}{}}{{{{}{{{{}}{{{{}{}{{{}{}}}{{}{{{}{}{}}{}}}}}}}{}{}}}}{}}{}}}{}{}|}{}{{}}{}{{{{{{|}}}{}}}{{}}}}{}}{}|}}{{...
output:
543113744 31 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 49994 tokens
Test #50:
score: 0
Accepted
time: 71ms
memory: 17160kb
input:
49957 49955 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}|||||||||||||||||{||||||||||||||||||||||||||||||||{|||||||||||{|...
output:
0 2653 0 0 2 1 1 0 0 0 0 0 1 0 1 0 1 0 53 1 0 0 1 2 0 2 0 0 0 1 0 1 0 2 1 0 0 0 0 0 1 2 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0 0 2 0 1 1 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 49956 tokens
Test #51:
score: 0
Accepted
time: 272ms
memory: 18204kb
input:
49982 49980 |||||||}||||{|||||||||||||||||||{||||||||{||{|||||{|||||||||}|}|||||||||||}|{||{}||||{||{||||||}||||{|||||||||{|||}||||{|}|||}||||{{|||||||{||||||||||}|||}|||||||||||}||||}|||||||||||||||||||||||{||||||||||||||||||||{||||||||||}||||||||}{||||||||||}}|||||{|||{||||||||{}{}||||||||||||||||...
output:
238 252 483 467 502 499 498 458 462 446 471 451 481 470 478 439 453 475 461 489 480 510 471 454 448 489 451 479 500 415 464 451 455 482 488 509 511 457 436 472 479 486 500 467 464 460 456 478 490 453 465 501 488 472 478 477 496 487 485 448 452 472 472 471 477 490 451 482 495 458 493 491 454 505 451 ...
result:
ok 49981 tokens
Test #52:
score: 0
Accepted
time: 215ms
memory: 20676kb
input:
49958 49956 |}|||{}}{{{{|{|}{|{|}{}}}{|{{}|{{}}{}|{|||}{}}||{|||||||||||}||||{||}{{||{||}|{}}||{||||}||}}|{||{{|{}||||||||}|}}}||}|{||||}}}{}|}|{||||{|{}||||}|{{|{}}||{|||{||}{|||{}}|{}}|||{}|||}}}}}}|{}{|{}}||{}}}|||{|}|||||{|||||}}||}|||||}{|}|{||}}|}||||||}{||{|||}|}}|}{|{}{|{}|{|{}|{||}|}|}|||{}...
output:
6257 4550 7650 9341 9845 9935 10079 9824 10096 10029 10144 10161 10217 10093 10023 10000 10166 10168 10199 10109 9933 10104 10180 10039 10208 10110 10086 9817 10137 10028 10052 9851 9955 10240 10022 9831 9938 9856 9943 9988 10167 9993 9996 9951 9934 9953 9945 9918 10120 10103 10154 9797 9975 10097 1...
result:
ok 49957 tokens
Test #53:
score: 0
Accepted
time: 145ms
memory: 22568kb
input:
50000 49998 |{{{{|{|||{|{{{||||}|}}||{||{|}||}|}|||{}{}|||}|}}||||{}||}}}}}{|||}}|{|{}{{|}||||}}||{|||{}||||}|||||{{{}|}{||}{{||}{||}|||{}|}||{|||||{|||{|||}{}||{||{}|{|{{||}|||{||||{}||}}|{|}|{{|{{||}{}}}|}||{|{}|}}}{|}{|||||||}||||{|}|{{{|||{{|{{{}{{}||||{||||{{|}{|}}{|}|{{|{|{}|||||}}|{{{{}|{{|||...
output:
0 1221 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150...
result:
ok 49999 tokens
Test #54:
score: 0
Accepted
time: 138ms
memory: 18336kb
input:
50000 49998 |}|{}}|{{|{{{{}{}{}}}{}|{{{|{{{|}{{{{{|}{}}{{}{}}|{{{|{|{|{{|{|{{|}|}{{}}}||||{|{}|{}}}{{{}{||{}||{{}}{}}|}||{}}{}{{}||}|}||}{|{}}||}||{}{|{|{|{}}}|{{}}{{{{{{}|}{|}}}{||{{{|}}{{{|{{|{|}|{{||{|}}|}}}{{{{{}}{}{||{}|{{|}{}|||{}}}{}}{{}}|{{{||{{{|{|{{|{}}|{{|}{{{{{}{{||{}{|}{|}{}{{}||{|{|{}|...
output:
7129940 2252 1274 3182 212 106 57 46 50 57 54 52 60 58 63 75 68 71 85 76 90 90 88 85 95 105 108 100 108 124 132 204 143 141 147 138 126 136 117 124 132 134 145 149 148 143 161 170 124 165 167 171 186 170 176 204 186 187 191 176 189 195 173 182 201 203 201 201 221 218 204 214 178 217 179 158 204 172 ...
result:
ok 49999 tokens
Test #55:
score: 0
Accepted
time: 135ms
memory: 18712kb
input:
50000 49998 |||{}||}}}{}||{}}{{}|}||}|}{|}{}{|{}||{|{}|||{}{|||}|{|{{{}|{}{}}|{|||}|{|}{{{}|}||}||}|}}|}}}||}{{{}}}}|}}}{|}}{}|{}{{{|}}{|}||{{{{{{}|}}|{|}|{{}|}}{{{}}{|{||}{}}{}}}|{{{|}|}}{{{}}}{{{}}||{{}|}|{|}{{|}}{}}}}}}}}}{|{{|}{|}}|||{|{}|}{|{}}|{|{{}}|{}{}}|}{{}}{}}|{{}||}|}}}}|}}{{{|{|{|{}|}}}...
output:
1712460 4001791 1070 625 546 473 481 474 473 543 485 512 552 578 575 554 603 614 579 571 590 588 560 604 575 634 606 657 572 623 666 642 678 620 685 684 714 687 665 697 714 731 665 649 636 711 695 688 694 658 688 702 711 680 718 678 714 744 682 752 762 737 738 760 765 754 801 769 765 813 798 835 830...
result:
ok 49999 tokens
Subtask #6:
score: 30
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Test #56:
score: 30
Accepted
time: 297ms
memory: 33088kb
input:
100000 99998 }}|}}||}|{}}||}{}{{{{||}|}{{}}}|}{{}{}{}{{{}|{}{||{|{{{||}}|}}|{{}{}{{|}}{}{|{{{{{{{{}{||}|||{{|{{{}|{|}}|{}}|{}}}}{}|||}||}|}|{{{{{{}|{{{|{}}}}}|}|}{|{}}|{||{}}}|}{{{}}{|{{}}}|||{}}{}||}{{|}}{{}|}}{|}}{{{{}||||||{|}}|}{{}}}|}{|{|||{}}{||}|{|}{|{||}{}}|{{{}|}|||}{|||}|{|{}{|{{{}{}{}}|{{...
output:
8842400 4004043 2344 3807 759 579 538 520 524 600 539 564 612 636 638 629 671 685 665 647 680 678 648 689 670 739 714 757 680 747 798 846 821 761 832 822 840 824 782 821 846 865 810 798 784 854 856 858 818 823 855 873 897 850 894 882 901 931 873 928 951 932 911 942 966 957 1002 970 987 1031 1002 104...
result:
ok 99999 tokens
Test #57:
score: 0
Accepted
time: 599ms
memory: 33372kb
input:
99976 99974 |}||||||||{|}|||||||||||||||{||}||}||||||}||||{||||||||||||}||||||||||||{||||||||||||||||}||||||||||}|}||||{|||||}|||||||||||||||||}||||||||||||||}|}|||}|||||||||||||||||||||||||||||||||||||||||||||||{||||||||||||||||||||||||{|{||||||||||}|||||||{|}||||||{|||||||||||||||||||{|||||||}}|||...
output:
245 254 521 525 556 522 511 539 564 523 531 537 534 532 554 497 488 569 527 522 500 530 520 560 539 551 537 536 466 580 517 530 539 579 519 544 518 560 532 548 545 520 555 492 550 551 565 503 570 528 497 546 503 568 548 511 555 530 526 521 524 502 524 525 526 562 540 516 544 524 540 508 515 521 525 ...
result:
ok 99975 tokens
Test #58:
score: 0
Accepted
time: 552ms
memory: 33928kb
input:
99958 99956 |||||||}||||||||{{|||||{{{|||||}|||{|||||||{|||{|||}||}|||||||{|||||||||{|||||||||{|||||||||||||||||}|||}}||{||||||||||||{|{||||||||{||{|||||}||||||{|||||{||}|}|||||||||||||||||}||{||||||||}||||||||{||||||||||||{||{|{|||||{|}||||||}|||||||||||||{|||||{|||||||||||||}|}}|||||}|||||||}|||||...
output:
0 164 348 346 309 329 314 353 332 309 335 338 308 345 347 314 350 347 309 330 341 366 298 348 343 306 348 318 331 353 324 353 345 350 316 336 370 305 338 328 325 349 296 338 339 324 341 326 325 318 306 329 329 339 292 358 296 347 334 381 341 342 294 307 337 333 346 324 320 331 358 356 334 316 316 32...
result:
ok 99957 tokens
Test #59:
score: 0
Accepted
time: 419ms
memory: 38364kb
input:
99985 99983 |}||||{{{}|||}}||{}}{}}}|}{{}{}}}|{|{|}{|||}{{||{|||}{|}{{{||||}}{}}||}||{|{{}{{{{{}{||}|}|}||{|}}}}}|}|{{{|}|}}}{|}||||||{{}}}|{{}}{}|{|}|{||||||||{{{{}{|}}|{}}{}{}||{{|}||{}|}{||}||}}|{||||{|}||||}}|}{|}{}|{|{{{|||{|{{{|}|}|{{||{{}||}}{|}|||{|}|||{{{|}}{}}|}}}||{}{|{{}}|}}||}{{||{|}{||...
output:
15369 11044 17160 21266 22826 23346 23597 23622 23327 23138 23469 23516 23402 23380 23320 23205 23311 23366 23374 23249 23236 23214 23149 23228 23357 23514 23475 23152 23401 23356 23239 23584 23234 23014 23386 23215 23381 23177 23186 23378 23098 23345 23326 23043 23215 23131 23383 22950 23504 23605 ...
result:
ok 99984 tokens
Test #60:
score: 0
Accepted
time: 324ms
memory: 28096kb
input:
99957 99955 }}|||}{}{|{|{{{{|}{}}|||{|}{|||}}{}{{{|{|}}|{{{||}}|{}{}||{|{||}}{}}{}}}{|}}|}}{}}{|||{}{|}{{|{}|{}}{{}|{{{}|}}|{}}|{|}}}|||{}{|}}{{|{{|{|}}}}{|}|{|}|||||{{{|{}|{}}}}{{}||{|||}}}{{{|}{}}|||{}|{{}{|}{}|||||{}{|}}{}{|{||}|{}|}}}{{|}{|{}{}|{{|{{{||{}||}}}{}{|}{}}|}|{}{}|}}|}|||}{{}{{||{}}|}...
output:
37174 13247 4981 1918 754 216 111 31 20 6 4 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99956 tokens
Test #61:
score: 0
Accepted
time: 332ms
memory: 32312kb
input:
99995 99993 }{|{||}}{}{{{{||{{|{}{|{}|{}}{}}|{|{}}}{{{}{|{|}{|||}}}|}}{{|||{{}{}|}}{}}{}||}|{}}}}{{{}|{|}||{{}}}}|}}{{{{{|||{{{}}{}}}{}}}|||}||||{{{{}||{}{|}}|{|{{|}||}}|{|}|}||{}}|||{{{{||{}{}}}}{{|{|}}|}}}|}{{}}|}|}|{||||{{{{{||||{}}{{|{}|}{}|||{}|}|}|}}{|{{{||}}{||}}||}{{}|{}||{||{{||}}|{}{}{|{|}...
output:
46972 17215 6328 2761 1142 451 231 92 33 15 8 5 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99994 tokens
Test #62:
score: 0
Accepted
time: 112ms
memory: 30640kb
input:
99999 99997 {}}}}}{}{}}}}}}}}|{}{}}}{{{|{{}}}}{{}{{}}}{}}{{{{}{{{{}{}{|}{{{}}{}}{}{}{}}}{{{{}{}{{}}{}}}}}{{}}}{{{{}}{{{{}{}}{{}{{}}}}}{}}}{}{}{{{{|{}}}{}}}}}{}{}{{{{}{{}}}}{}{}{{}}}}}{}{}}}{{{}{{{{{}}}{}}}{}}{}{}}{}{{{}}{}{}}}|{{}}}{}}}{{}}}{}{}}}}}{{}{}}}{{}}}}{}{{}{}{}{{}}}{}{}}{{{{{{}}}}{{}{{}{}{...
output:
347 48495 511 48980 97517 97498 49011 480 48988 493 97519 97475 97484 49008 48988 97495 97530 97484 49008 97488 49000 49001 483 48983 48976 482 48986 97495 48992 491 508 49024 48988 483 48987 48940 49005 97486 97478 97485 500 97474 48999 97483 501 48977 48974 458 49021 484 97506 97481 49002 48994 48...
result:
ok 99998 tokens
Test #63:
score: 0
Accepted
time: 296ms
memory: 30592kb
input:
99958 99956 {{}{|}|||}||}}{}{{{|{{|}|||||}{}{}{|}}}|}|}{}|}|{}|}{}{}}{||{|{}|}}|{}{}|{{}}|||{{|{|}|}|}|{|}|{}||{|||}}||{}}{|{|{{{||}|{|{}}{||}{{{{{{|||}{|||{{|{{}}}{{}{{}}|}}||{}|}}{}{}}|{}}{|{{{}}{}}||}{|{}}{|}|{}{|}||}}{}}||}}}|}}|}{}{}}}||}{}}{|||{}}|||{{{{{|{|||{}{}{{{{}{|{|}{{|}}}{{}|{|}{{}|}{{...
output:
35896 13111 5293 1827 571 211 76 26 4 1 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99957 tokens
Test #64:
score: 0
Accepted
time: 330ms
memory: 42812kb
input:
100000 99998 {||}}||{|||||}|{{{{||||||{{||{|||||{{|||{|}||||||{{{||{||}|}{{||||}}|}{}}|{|{|{|||{}||}{||}|||||{||||}{|{}{}}{||}|||{||{}||{||||||{||{}{||}|||}}|}{{|{{{{||}|}||{||}{}||}|}|}|}||}{|}}|||||||||{|{{{||{}|{{|{||{|}{}{{||}{||{}{|{|{||}}|}|{}{{{}|{|{||}|{|||||||}|||}{|}|{|||||{||{|||{{}|}}}||...
output:
0 1296 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 1...
result:
ok 99999 tokens
Test #65:
score: 0
Accepted
time: 293ms
memory: 36764kb
input:
100000 99998 ||||{|||||{||||{||||||{|{|||||||{|{|{}}|||{||||}|||||||}|}||||{|{|}{||{}|||}|{|||{|||||||||}}||||||||}|||||}||||{||||}||||||||||{||}||}||}||||}||||}|||||}|||}|||}|||}|}}|{{|{|}|||||{|||||||}|{|||{}||}|||||||||}|}}{|{||{|||{|||||{{|||||}|||{||{|||}|{|{|||{||||}{|||||{||||||}{|||||||{||}{...
output:
3 9 14 18 23 30 34 42 51 61 72 79 87 94 100 105 109 112 114 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 ...
result:
ok 99999 tokens
Test #66:
score: 0
Accepted
time: 286ms
memory: 35908kb
input:
100000 99998 |}}}|{||||}||}||||{|}}|{}|||||||}|{||||}||||}|}}|||||}|||||{||}|||{|{||}|||{||||}|}|{||||}}||||||}{||}|}||}{|||}||{}||}|||{|}{|}{|}|{|||}|}}|}||||||||||||{}||}|}|{}}||||||||||{|{}|||}|||{|{}{||{||{|||}{||||{||||||||||||||||||||||||{}|}|{|}|}{}{|||{||||||{|{||}|||||{{||||||||{|}||||}||{|...
output:
4 8 12 16 21 28 33 41 50 60 71 83 96 110 125 141 158 176 195 215 236 257 280 304 329 355 377 400 422 443 463 482 500 517 533 548 562 575 587 598 608 617 625 632 638 643 647 650 652 653 653 654 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653 653...
result:
ok 99999 tokens
Test #67:
score: 0
Accepted
time: 316ms
memory: 35524kb
input:
100000 99998 {|||||{}||||||||{|}}}||||||}|||{|||}||||{|||{}||||||{|||{||}}|{||{||||}||||}|||}|}||}||||}||{{||{|||{}}{{}|}{|{||}||||||||{|}|}|||||}|||||{|||{||{{||}}||||{|}}|||{|}|{|||||}}|}}|{{}{|}|||{|{|{||}}|}{||{}||||||||{|||}||}{{}||}}|{||}|}||||||{|}||}|||}{|||||{{||||||||||{{|||||||||}|||}|}{|...
output:
3 7 10 14 19 25 32 40 49 59 70 82 95 109 124 140 157 175 194 214 235 257 280 304 329 355 382 410 439 469 500 532 565 599 635 671 708 746 785 825 866 908 951 995 1040 1086 1133 1181 1230 1280 1331 1378 1426 1473 1519 1564 1608 1651 1693 1734 1774 1813 1851 1888 1924 1959 1993 2026 2058 2089 2119 2148...
result:
ok 99999 tokens
Test #68:
score: 0
Accepted
time: 329ms
memory: 35248kb
input:
100000 99998 |||||||||||{}|||}|||||||{||||||{}||||||{|{{|{||||||||||||||||||||{||||}|||{||||||}{{{||||||{||||||||{|||||}}||||{||||{|||||||||}||||}||||||}}|||||}|{|||||||||||||{|}|||||||||{|||||||}|||{{}|{||||||||||||}||}||||||}||||}||{|{||||||}||||||||{||}|}|}|{||{|{|||||||||||}|||||||||||||{|||}|||...
output:
18 22 39 44 49 54 60 68 78 86 98 111 125 138 154 169 186 203 221 239 259 281 304 328 354 379 407 434 463 493 523 554 588 621 657 693 730 768 806 846 888 929 973 1014 1059 1105 1152 1202 1249 1298 1349 1400 1455 1507 1560 1616 1672 1730 1788 1849 1910 1972 2035 2099 2164 2229 2296 2363 2432 2502 2574...
result:
ok 99999 tokens
Test #69:
score: 0
Accepted
time: 312ms
memory: 30504kb
input:
100000 99998 ||}|||||||||||||||||||||||{||}||||||||{||||||}|||||||||||||{|}|||||||||{|||||||||||||||||||||||||{|}|||||||||||||||}{|||||{||||||||||||||||||||||||{||||}||||||||||||||||||||||{|||||}|||||}||||||||||||||||{||||}||||||||||||||||||||{|}||||||||||||||||{|||||||||||{{|}||||||||||||||||||||}|...
output:
5 15 23 28 32 37 44 50 59 68 78 90 103 115 131 148 166 182 197 215 231 247 264 283 300 317 335 353 371 388 403 419 434 451 470 486 503 520 538 556 571 591 608 621 638 655 672 690 707 724 742 759 776 794 810 826 842 859 875 894 910 926 943 962 978 995 1011 1028 1046 1061 1079 1096 1114 1130 1147 1165...
result:
ok 99999 tokens
Test #70:
score: 0
Accepted
time: 410ms
memory: 48732kb
input:
99950 99948 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{...
output:
616 5 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99949 tokens