답안 #604159

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
604159 2022-07-24T19:27:28 Z SamAnd Jail (JOI22_jail) C++17
100 / 100
1135 ms 86580 KB
#include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
typedef long long ll;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);
const int N = 150005;

int n;
vector<int> g[N];

int p0[N];
int q[N];
void dfs0(int x, int p)
{
    p0[x] = p;
    q[x] = 1;
    for (int i = 0; i < g[x].size(); ++i)
    {
        int h = g[x][i];
        if (h == p)
            continue;
        dfs0(h, x);
        q[x] += q[h];
    }

    for (int i = 0; i < g[x].size(); ++i)
    {
        int h = g[x][i];
        if (h == p)
        {
            swap(g[x][i], g[x].back());
            g[x].pop_back();
            break;
        }
    }
    for (int i = 0; i < g[x].size(); ++i)
    {
        int h = g[x][i];
        if (q[h] > q[g[x][0]])
            swap(g[x][i], g[x][0]);
    }
}

int tin[N], tout[N], ti;
int f[N];
void dfs1(int x)
{
    tin[x] = ++ti;
    for (int i = 0; i < g[x].size(); ++i)
    {
        int h = g[x][i];
        if (i == 0)
        {
            f[h] = f[x];
            dfs1(h);
        }
        else
        {
            f[h] = h;
            dfs1(h);
        }
    }
    tout[x] = ti;
}

bool c[N];

int t[N * 4];
set<int> st[N * 4];
void ubd(int tl, int tr, int x, int y, int pos)
{
    if (tl == tr)
    {
        if (y > 0)
        {
            st[pos].insert(y);
        }
        else
        {
            y *= -1;
            assert(st[pos].find(y) != st[pos].end());
            st[pos].erase(y);
        }
        if (st[pos].empty())
            t[pos] = 0;
        else
            t[pos] = *st[pos].begin();
        return;
    }
    int m = (tl + tr) / 2;
    if (x <= m)
        ubd(tl, m, x, y, pos * 2);
    else
        ubd(m + 1, tr, x, y, pos * 2 + 1);
    t[pos] = max(t[pos * 2], t[pos * 2 + 1]);
}

int qry(int tl, int tr, int l, int r, int pos)
{
    if (l > r)
        return 0;
    if (tl == l && tr == r)
        return t[pos];
    int m = (tl + tr) / 2;
    return max(qry(tl, m, l, min(m, r), pos * 2),
               qry(m + 1, tr, max(m + 1, l), r, pos * 2 + 1));
}

int qryy(int x, int y)
{
    while (f[x] != f[y])
    {
        if (tin[f[x]] < tin[f[y]])
            swap(x, y);
        int ans = qry(1, n, tin[f[x]], tin[x], 1);
        if (ans)
            return ans;
        x = p0[f[x]];
    }
    if (tin[x] < tin[y])
        swap(x, y);
    return qry(1, n, tin[y], tin[x], 1);
}

vector<int> t2[N * 4];
void ubd2(int tl, int tr, int l, int r, int y, int pos)
{
    if (l > r)
        return;
    if (tl == l && tr == r)
    {
        t2[pos].push_back(y);
        return;
    }
    int m = (tl + tr) / 2;
    ubd2(tl, m, l, min(m, r), y, pos * 2);
    ubd2(m + 1, tr, max(m + 1, l), r, y, pos * 2 + 1);
}

void ubdd2(int x, int y, int z)
{
    assert(z > 0);
    while (f[x] != f[y])
    {
        if (tin[f[x]] < tin[f[y]])
            swap(x, y);
        ubd2(1, n, tin[f[x]], tin[x], z, 1);
        x = p0[f[x]];
    }
    if (tin[x] < tin[y])
        swap(x, y);
    return ubd2(1, n, tin[y], tin[x], z, 1);
}

int qry2(int tl, int tr, int x, int pos)
{
    while (!t2[pos].empty() && c[t2[pos].back()])
        t2[pos].pop_back();
    if (tl == tr)
    {
        if (!t2[pos].empty())
            return t2[pos].back();
        return 0;
    }
    int m = (tl + tr) / 2;
    if (!t2[pos].empty())
    {
        if (x <= m)
            return max(t2[pos].back(), qry2(tl, m, x, pos * 2));
        return max(t2[pos].back(), qry2(m + 1, tr, x, pos * 2 + 1));
    }
    if (x <= m)
        return qry2(tl, m, x, pos * 2);
    return qry2(m + 1, tr, x, pos * 2 + 1);
}

int m;
pair<int, int> b[N];

vector<int> v;
void dfs(int i)
{
    c[i] = true;
    ubd(1, n, tin[b[i].fi], -i, 1);
    while (1)
    {
        int h = qryy(b[i].fi, b[i].se);
        if (!h)
            break;
        dfs(h);
    }
    while (1)
    {
        int h = qry2(1, n, tin[b[i].se], 1);
        if (!h)
            break;
        dfs(h);
    }
    v.push_back(i);
}

int s[N * 4];
void ubds(int tl, int tr, int x, int y, int pos)
{
    if (tl == tr)
    {
        s[pos] += y;
        return;
    }
    int m = (tl + tr) / 2;
    if (x <= m)
        ubds(tl, m, x, y, pos * 2);
    else
        ubds(m + 1, tr, x, y, pos * 2 + 1);
    s[pos] = s[pos * 2] + s[pos * 2 + 1];
}

int qrys(int tl, int tr, int l, int r, int pos)
{
    if (l > r)
        return 0;
    if (tl == l && tr == r)
        return s[pos];
    int m = (tl + tr) / 2;
    return (qrys(tl, m, l, min(m, r), pos * 2) +
               qrys(m + 1, tr, max(m + 1, l), r, pos * 2 + 1));
}

int qryys(int x, int y)
{
    int ans = 0;
    while (f[x] != f[y])
    {
        if (tin[f[x]] < tin[f[y]])
            swap(x, y);
        ans += qrys(1, n, tin[f[x]], tin[x], 1);
        x = p0[f[x]];
    }
    if (tin[x] < tin[y])
        swap(x, y);
    ans += qrys(1, n, tin[y], tin[x], 1);
    return ans;
}

void solv()
{
    /*for (int i = 0; i < N; ++i)
    {
        assert(st[i].empty());
        assert(t2[i].empty());
        assert(t[i] == 0);
        assert(s[i] == 0);
    }*/

    cin >> n;
    for (int i = 1; i <= n; ++i)
    {
        g[i].clear();
    }
    for (int i = 0; i < n - 1; ++i)
    {
        int x, y;
        cin >> x >> y;
        g[x].push_back(y);
        g[y].push_back(x);
    }

    dfs0(1, 1);
    ti = 0;
    f[1] = 1;
    dfs1(1);

    cin >> m;
    for (int i = 1; i <= m; ++i)
        cin >> b[i].fi >> b[i].se;

    for (int i = 1; i <= m; ++i)
        c[i] = false;
    for (int i = 1; i <= m; ++i)
    {
        ubd(1, n, tin[b[i].fi], i, 1);
        ubdd2(b[i].fi, b[i].se, i);
    }
    v.clear();
    for (int i = 1; i <= m; ++i)
    {
        if (c[i])
            continue;
        dfs(i);
    }
    for (int i = 1; i <= n; ++i)
        qry2(1, n, i, 1);

    assert(sz(v) == m);
    for (int i = 1; i <= m; ++i)
        ubds(1, n, tin[b[i].fi], 1, 1);
    for (int ii = 0; ii < sz(v); ++ii)
    {
        int i = v[ii];
        ubds(1, n, tin[b[i].fi], -1, 1);
        if (qryys(b[i].fi, b[i].se))
        {
            for (int jj = 0; jj < ii; ++jj)
            {
                int i = v[jj];
                ubds(1, n, tin[b[i].se], -1, 1);
            }
            for (int jj = ii + 1; jj < sz(v); ++jj)
            {
                int i = v[jj];
                ubds(1, n, tin[b[i].fi], -1, 1);
            }
            cout << "No\n";
            return;
        }
        ubds(1, n, tin[b[i].se], 1, 1);
    }
    for (int ii = 0; ii < sz(v); ++ii)
    {
        int i = v[ii];
        ubds(1, n, tin[b[i].se], -1, 1);
    }
    cout << "Yes\n";
}

int main()
{
    #ifdef SOMETHING
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif // SOMETHING
    ios_base::sync_with_stdio(false), cin.tie(0);

    int tt = 1;
    cin >> tt;
    while (tt--)
    {
        solv();
    }
    return 0;
}

Compilation message

jail.cpp: In function 'void dfs0(int, int)':
jail.cpp:22:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |     for (int i = 0; i < g[x].size(); ++i)
      |                     ~~^~~~~~~~~~~~~
jail.cpp:31:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     for (int i = 0; i < g[x].size(); ++i)
      |                     ~~^~~~~~~~~~~~~
jail.cpp:41:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |     for (int i = 0; i < g[x].size(); ++i)
      |                     ~~^~~~~~~~~~~~~
jail.cpp: In function 'void dfs1(int)':
jail.cpp:54:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   54 |     for (int i = 0; i < g[x].size(); ++i)
      |                     ~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 46124 KB Output is correct
2 Correct 21 ms 46116 KB Output is correct
3 Correct 22 ms 46096 KB Output is correct
4 Correct 31 ms 46128 KB Output is correct
5 Correct 45 ms 46536 KB Output is correct
6 Correct 22 ms 46164 KB Output is correct
7 Correct 22 ms 46164 KB Output is correct
8 Correct 25 ms 46168 KB Output is correct
9 Correct 63 ms 47788 KB Output is correct
10 Correct 66 ms 62144 KB Output is correct
11 Correct 29 ms 46204 KB Output is correct
12 Correct 75 ms 46468 KB Output is correct
13 Correct 167 ms 72456 KB Output is correct
14 Correct 155 ms 74288 KB Output is correct
15 Correct 271 ms 75580 KB Output is correct
16 Correct 503 ms 86580 KB Output is correct
17 Correct 191 ms 75848 KB Output is correct
18 Correct 249 ms 79288 KB Output is correct
19 Correct 194 ms 75548 KB Output is correct
20 Correct 177 ms 75204 KB Output is correct
21 Correct 180 ms 76304 KB Output is correct
22 Correct 151 ms 72392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 46164 KB Output is correct
2 Correct 21 ms 46060 KB Output is correct
3 Correct 22 ms 46088 KB Output is correct
4 Correct 23 ms 46164 KB Output is correct
5 Correct 23 ms 46196 KB Output is correct
6 Correct 22 ms 46216 KB Output is correct
7 Correct 22 ms 46128 KB Output is correct
8 Correct 23 ms 46160 KB Output is correct
9 Correct 22 ms 46128 KB Output is correct
10 Correct 23 ms 46112 KB Output is correct
11 Correct 22 ms 46192 KB Output is correct
12 Correct 22 ms 46200 KB Output is correct
13 Correct 21 ms 46184 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 46164 KB Output is correct
2 Correct 21 ms 46060 KB Output is correct
3 Correct 22 ms 46088 KB Output is correct
4 Correct 23 ms 46164 KB Output is correct
5 Correct 23 ms 46196 KB Output is correct
6 Correct 22 ms 46216 KB Output is correct
7 Correct 22 ms 46128 KB Output is correct
8 Correct 23 ms 46160 KB Output is correct
9 Correct 22 ms 46128 KB Output is correct
10 Correct 23 ms 46112 KB Output is correct
11 Correct 22 ms 46192 KB Output is correct
12 Correct 22 ms 46200 KB Output is correct
13 Correct 21 ms 46184 KB Output is correct
14 Correct 21 ms 46160 KB Output is correct
15 Correct 21 ms 46164 KB Output is correct
16 Correct 24 ms 46188 KB Output is correct
17 Correct 23 ms 46232 KB Output is correct
18 Correct 22 ms 46164 KB Output is correct
19 Correct 21 ms 46096 KB Output is correct
20 Correct 23 ms 46228 KB Output is correct
21 Correct 23 ms 46216 KB Output is correct
22 Correct 22 ms 46216 KB Output is correct
23 Correct 21 ms 46176 KB Output is correct
24 Correct 22 ms 46164 KB Output is correct
25 Correct 23 ms 46160 KB Output is correct
26 Correct 21 ms 46084 KB Output is correct
27 Correct 25 ms 46144 KB Output is correct
28 Correct 20 ms 46144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 46164 KB Output is correct
2 Correct 21 ms 46060 KB Output is correct
3 Correct 22 ms 46088 KB Output is correct
4 Correct 23 ms 46164 KB Output is correct
5 Correct 23 ms 46196 KB Output is correct
6 Correct 22 ms 46216 KB Output is correct
7 Correct 22 ms 46128 KB Output is correct
8 Correct 23 ms 46160 KB Output is correct
9 Correct 22 ms 46128 KB Output is correct
10 Correct 23 ms 46112 KB Output is correct
11 Correct 22 ms 46192 KB Output is correct
12 Correct 22 ms 46200 KB Output is correct
13 Correct 21 ms 46184 KB Output is correct
14 Correct 21 ms 46160 KB Output is correct
15 Correct 21 ms 46164 KB Output is correct
16 Correct 24 ms 46188 KB Output is correct
17 Correct 23 ms 46232 KB Output is correct
18 Correct 22 ms 46164 KB Output is correct
19 Correct 21 ms 46096 KB Output is correct
20 Correct 23 ms 46228 KB Output is correct
21 Correct 23 ms 46216 KB Output is correct
22 Correct 22 ms 46216 KB Output is correct
23 Correct 21 ms 46176 KB Output is correct
24 Correct 22 ms 46164 KB Output is correct
25 Correct 23 ms 46160 KB Output is correct
26 Correct 21 ms 46084 KB Output is correct
27 Correct 25 ms 46144 KB Output is correct
28 Correct 20 ms 46144 KB Output is correct
29 Correct 24 ms 46368 KB Output is correct
30 Correct 24 ms 46180 KB Output is correct
31 Correct 24 ms 46212 KB Output is correct
32 Correct 23 ms 46196 KB Output is correct
33 Correct 23 ms 46192 KB Output is correct
34 Correct 25 ms 46164 KB Output is correct
35 Correct 25 ms 46236 KB Output is correct
36 Correct 24 ms 46156 KB Output is correct
37 Correct 23 ms 46160 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 46164 KB Output is correct
2 Correct 21 ms 46060 KB Output is correct
3 Correct 22 ms 46088 KB Output is correct
4 Correct 23 ms 46164 KB Output is correct
5 Correct 23 ms 46196 KB Output is correct
6 Correct 22 ms 46216 KB Output is correct
7 Correct 22 ms 46128 KB Output is correct
8 Correct 23 ms 46160 KB Output is correct
9 Correct 22 ms 46128 KB Output is correct
10 Correct 23 ms 46112 KB Output is correct
11 Correct 22 ms 46192 KB Output is correct
12 Correct 22 ms 46200 KB Output is correct
13 Correct 21 ms 46184 KB Output is correct
14 Correct 21 ms 46160 KB Output is correct
15 Correct 21 ms 46164 KB Output is correct
16 Correct 24 ms 46188 KB Output is correct
17 Correct 23 ms 46232 KB Output is correct
18 Correct 22 ms 46164 KB Output is correct
19 Correct 21 ms 46096 KB Output is correct
20 Correct 23 ms 46228 KB Output is correct
21 Correct 23 ms 46216 KB Output is correct
22 Correct 22 ms 46216 KB Output is correct
23 Correct 21 ms 46176 KB Output is correct
24 Correct 22 ms 46164 KB Output is correct
25 Correct 23 ms 46160 KB Output is correct
26 Correct 21 ms 46084 KB Output is correct
27 Correct 25 ms 46144 KB Output is correct
28 Correct 20 ms 46144 KB Output is correct
29 Correct 24 ms 46368 KB Output is correct
30 Correct 24 ms 46180 KB Output is correct
31 Correct 24 ms 46212 KB Output is correct
32 Correct 23 ms 46196 KB Output is correct
33 Correct 23 ms 46192 KB Output is correct
34 Correct 25 ms 46164 KB Output is correct
35 Correct 25 ms 46236 KB Output is correct
36 Correct 24 ms 46156 KB Output is correct
37 Correct 23 ms 46160 KB Output is correct
38 Correct 70 ms 47744 KB Output is correct
39 Correct 68 ms 62176 KB Output is correct
40 Correct 79 ms 47608 KB Output is correct
41 Correct 92 ms 47456 KB Output is correct
42 Correct 73 ms 47728 KB Output is correct
43 Correct 51 ms 47180 KB Output is correct
44 Correct 43 ms 46668 KB Output is correct
45 Correct 82 ms 54928 KB Output is correct
46 Correct 87 ms 54840 KB Output is correct
47 Correct 65 ms 59632 KB Output is correct
48 Correct 68 ms 59576 KB Output is correct
49 Correct 81 ms 56176 KB Output is correct
50 Correct 74 ms 56092 KB Output is correct
51 Correct 65 ms 56872 KB Output is correct
52 Correct 63 ms 57056 KB Output is correct
53 Correct 45 ms 47052 KB Output is correct
54 Correct 106 ms 55936 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 46164 KB Output is correct
2 Correct 21 ms 46164 KB Output is correct
3 Correct 20 ms 46068 KB Output is correct
4 Correct 24 ms 46164 KB Output is correct
5 Correct 29 ms 46112 KB Output is correct
6 Correct 20 ms 46152 KB Output is correct
7 Correct 21 ms 46208 KB Output is correct
8 Correct 21 ms 46164 KB Output is correct
9 Correct 21 ms 46108 KB Output is correct
10 Correct 21 ms 46104 KB Output is correct
11 Correct 21 ms 46180 KB Output is correct
12 Correct 32 ms 46232 KB Output is correct
13 Correct 65 ms 46596 KB Output is correct
14 Correct 88 ms 46524 KB Output is correct
15 Correct 80 ms 46580 KB Output is correct
16 Correct 138 ms 57024 KB Output is correct
17 Correct 495 ms 65644 KB Output is correct
18 Correct 860 ms 76436 KB Output is correct
19 Correct 245 ms 59108 KB Output is correct
20 Correct 196 ms 59992 KB Output is correct
21 Correct 241 ms 60408 KB Output is correct
22 Correct 401 ms 66488 KB Output is correct
23 Correct 313 ms 65864 KB Output is correct
24 Correct 390 ms 65724 KB Output is correct
25 Correct 313 ms 66632 KB Output is correct
26 Correct 392 ms 66624 KB Output is correct
27 Correct 542 ms 72080 KB Output is correct
28 Correct 457 ms 74684 KB Output is correct
29 Correct 463 ms 71804 KB Output is correct
30 Correct 328 ms 66760 KB Output is correct
31 Correct 334 ms 67348 KB Output is correct
32 Correct 355 ms 66560 KB Output is correct
33 Correct 296 ms 67324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 46124 KB Output is correct
2 Correct 21 ms 46116 KB Output is correct
3 Correct 22 ms 46096 KB Output is correct
4 Correct 31 ms 46128 KB Output is correct
5 Correct 45 ms 46536 KB Output is correct
6 Correct 22 ms 46164 KB Output is correct
7 Correct 22 ms 46164 KB Output is correct
8 Correct 25 ms 46168 KB Output is correct
9 Correct 63 ms 47788 KB Output is correct
10 Correct 66 ms 62144 KB Output is correct
11 Correct 29 ms 46204 KB Output is correct
12 Correct 75 ms 46468 KB Output is correct
13 Correct 167 ms 72456 KB Output is correct
14 Correct 155 ms 74288 KB Output is correct
15 Correct 271 ms 75580 KB Output is correct
16 Correct 503 ms 86580 KB Output is correct
17 Correct 191 ms 75848 KB Output is correct
18 Correct 249 ms 79288 KB Output is correct
19 Correct 194 ms 75548 KB Output is correct
20 Correct 177 ms 75204 KB Output is correct
21 Correct 180 ms 76304 KB Output is correct
22 Correct 151 ms 72392 KB Output is correct
23 Correct 20 ms 46164 KB Output is correct
24 Correct 21 ms 46060 KB Output is correct
25 Correct 22 ms 46088 KB Output is correct
26 Correct 23 ms 46164 KB Output is correct
27 Correct 23 ms 46196 KB Output is correct
28 Correct 22 ms 46216 KB Output is correct
29 Correct 22 ms 46128 KB Output is correct
30 Correct 23 ms 46160 KB Output is correct
31 Correct 22 ms 46128 KB Output is correct
32 Correct 23 ms 46112 KB Output is correct
33 Correct 22 ms 46192 KB Output is correct
34 Correct 22 ms 46200 KB Output is correct
35 Correct 21 ms 46184 KB Output is correct
36 Correct 21 ms 46160 KB Output is correct
37 Correct 21 ms 46164 KB Output is correct
38 Correct 24 ms 46188 KB Output is correct
39 Correct 23 ms 46232 KB Output is correct
40 Correct 22 ms 46164 KB Output is correct
41 Correct 21 ms 46096 KB Output is correct
42 Correct 23 ms 46228 KB Output is correct
43 Correct 23 ms 46216 KB Output is correct
44 Correct 22 ms 46216 KB Output is correct
45 Correct 21 ms 46176 KB Output is correct
46 Correct 22 ms 46164 KB Output is correct
47 Correct 23 ms 46160 KB Output is correct
48 Correct 21 ms 46084 KB Output is correct
49 Correct 25 ms 46144 KB Output is correct
50 Correct 20 ms 46144 KB Output is correct
51 Correct 24 ms 46368 KB Output is correct
52 Correct 24 ms 46180 KB Output is correct
53 Correct 24 ms 46212 KB Output is correct
54 Correct 23 ms 46196 KB Output is correct
55 Correct 23 ms 46192 KB Output is correct
56 Correct 25 ms 46164 KB Output is correct
57 Correct 25 ms 46236 KB Output is correct
58 Correct 24 ms 46156 KB Output is correct
59 Correct 23 ms 46160 KB Output is correct
60 Correct 70 ms 47744 KB Output is correct
61 Correct 68 ms 62176 KB Output is correct
62 Correct 79 ms 47608 KB Output is correct
63 Correct 92 ms 47456 KB Output is correct
64 Correct 73 ms 47728 KB Output is correct
65 Correct 51 ms 47180 KB Output is correct
66 Correct 43 ms 46668 KB Output is correct
67 Correct 82 ms 54928 KB Output is correct
68 Correct 87 ms 54840 KB Output is correct
69 Correct 65 ms 59632 KB Output is correct
70 Correct 68 ms 59576 KB Output is correct
71 Correct 81 ms 56176 KB Output is correct
72 Correct 74 ms 56092 KB Output is correct
73 Correct 65 ms 56872 KB Output is correct
74 Correct 63 ms 57056 KB Output is correct
75 Correct 45 ms 47052 KB Output is correct
76 Correct 106 ms 55936 KB Output is correct
77 Correct 21 ms 46164 KB Output is correct
78 Correct 21 ms 46164 KB Output is correct
79 Correct 20 ms 46068 KB Output is correct
80 Correct 24 ms 46164 KB Output is correct
81 Correct 29 ms 46112 KB Output is correct
82 Correct 20 ms 46152 KB Output is correct
83 Correct 21 ms 46208 KB Output is correct
84 Correct 21 ms 46164 KB Output is correct
85 Correct 21 ms 46108 KB Output is correct
86 Correct 21 ms 46104 KB Output is correct
87 Correct 21 ms 46180 KB Output is correct
88 Correct 32 ms 46232 KB Output is correct
89 Correct 65 ms 46596 KB Output is correct
90 Correct 88 ms 46524 KB Output is correct
91 Correct 80 ms 46580 KB Output is correct
92 Correct 138 ms 57024 KB Output is correct
93 Correct 495 ms 65644 KB Output is correct
94 Correct 860 ms 76436 KB Output is correct
95 Correct 245 ms 59108 KB Output is correct
96 Correct 196 ms 59992 KB Output is correct
97 Correct 241 ms 60408 KB Output is correct
98 Correct 401 ms 66488 KB Output is correct
99 Correct 313 ms 65864 KB Output is correct
100 Correct 390 ms 65724 KB Output is correct
101 Correct 313 ms 66632 KB Output is correct
102 Correct 392 ms 66624 KB Output is correct
103 Correct 542 ms 72080 KB Output is correct
104 Correct 457 ms 74684 KB Output is correct
105 Correct 463 ms 71804 KB Output is correct
106 Correct 328 ms 66760 KB Output is correct
107 Correct 334 ms 67348 KB Output is correct
108 Correct 355 ms 66560 KB Output is correct
109 Correct 296 ms 67324 KB Output is correct
110 Correct 98 ms 47204 KB Output is correct
111 Correct 52 ms 46860 KB Output is correct
112 Correct 350 ms 72348 KB Output is correct
113 Correct 173 ms 64752 KB Output is correct
114 Correct 258 ms 70172 KB Output is correct
115 Correct 71 ms 56372 KB Output is correct
116 Correct 277 ms 64556 KB Output is correct
117 Correct 1135 ms 82576 KB Output is correct
118 Correct 97 ms 56124 KB Output is correct
119 Correct 97 ms 55992 KB Output is correct
120 Correct 39 ms 47756 KB Output is correct
121 Correct 343 ms 65232 KB Output is correct
122 Correct 335 ms 65164 KB Output is correct
123 Correct 187 ms 66764 KB Output is correct
124 Correct 166 ms 67904 KB Output is correct
125 Correct 196 ms 67280 KB Output is correct
126 Correct 553 ms 83464 KB Output is correct
127 Correct 256 ms 72612 KB Output is correct
128 Correct 218 ms 72928 KB Output is correct
129 Correct 236 ms 73000 KB Output is correct
130 Correct 223 ms 72740 KB Output is correct