Submission #892733

# Submission time Handle Problem Language Result Execution time Memory
892733 2023-12-25T19:32:19 Z LucaIlie Tourism (JOI23_tourism) C++17
100 / 100
1919 ms 96684 KB
#include <bits/stdc++.h>

using namespace std;

struct AIB {
    int l, r;
    vector<int> aib;

    void init( int _l, int _r ) {
        l = _l;
        r = _r;
        aib.clear();
        aib.resize( r - l + 2 );
    }

    void update( int i, int x ) {
        i -= l - 1;
        while ( i <= r - l + 1 ) {
            aib[i] += x;
            i += (i & -i);
        }
    }

    int query( int i ) {
        int s = 0;

        i -= l - 1;
        while ( i > 0 ) {
            s += aib[i];
            i -= (i & -i);
        }

        return s;
    }
} aib;

struct Tree {
    struct edge {
        int u, v, c;

        int other( int w ) {
            return u ^ v ^ w;
        }
    };

    int n;
    vector<edge> edges;
    vector<vector<int>> adj;
    vector<int> depth, timeIn, timeOut;
    vector<vector<int>> parent;
    vector<int> maxLQ, minHQ;

    void resize( int _size ) {
        n = _size;

        edges.clear();
        adj.clear();
        adj.resize( n + 1 );

        depth.clear();
        depth.resize( n + 1 );
        timeIn.clear();
        timeIn.resize( n + 1 );
        timeOut.clear();
        timeOut.resize( n + 1 );

        maxLQ.resize( n + 1 );
        for ( int i = 0; i <= n; i++ )
            maxLQ[i] = 0;
        minHQ.resize( n + 1 );
        for ( int i = 0; i <= n; i++ )
            minHQ[i] = INT_MAX;

        parent.clear();
        parent.resize( (int)log2( n ) + 1 );
        for ( int i = 0; i <= log2( n ); i++ )
            parent[i].resize( n + 1 );
    }

    void add_edge( int u, int v, int c ) {
        adj[u].push_back( edges.size() );
        adj[v].push_back( edges.size() );
        edges.push_back( { u, v, c } );
    }
    void addMaxLQ( int v, int val ) {
        maxLQ[v] = max( maxLQ[v], val );
    }

    void addMinHQ( int v, int val ) {
        minHQ[v] = min( minHQ[v], val );
    }

    int timee;
    void dfs( int u, int p ) {
        parent[0][u] = p;
        timeIn[u] = ++timee;
        for ( int e: adj[u] ) {
            int v = edges[e].other( u ), c = edges[e].c;
            if ( v == p )
                continue;
            depth[v] = depth[u] + c;
            dfs( v, u );
            maxLQ[u] = max( maxLQ[u], maxLQ[v] );
            minHQ[u] = min( minHQ[u], minHQ[v] );
        }
        timeOut[u] = timee;
    }

    void init( int root ) {
        timee = 0;
        dfs( root, 0 );
        for ( int l = 1; l <= log2( n ); l++ ) {
            for ( int v = 1; v <= n; v++ )
                parent[l][v] = parent[l - 1][parent[l - 1][v]];
        }
    }

    int lca( int u, int v ) {
        if ( depth[u] > depth[v] )
            swap( u, v );

        for ( int l = log2( n ); l >= 0; l-- ) {
            if ( depth[parent[l][v]] >= depth[u] )
                v = parent[l][v];
        }

        if ( u == v )
            return v;

        for ( int l = log2( n ); l >= 0; l-- ) {
             if ( parent[l][u] != parent[l][v] ) {
                 u = parent[l][u];
                 v = parent[l][v];
             }
        }

        return parent[0][v];
    }

    bool inSubtree( int u, int v ) {
        return (timeIn[u] <= timeIn[v]) && (timeOut[v] <= timeOut[u]);
    }

};

struct update {
    int l, r, x;
};

const int MAX_N = 1e5;
const int MAX_M = 1e5;
const int MAX_Q = 1e5;
Tree islandTree;
int spots[MAX_M + 1], leftQ[MAX_Q + 1], rightQ[MAX_Q + 1], ans[MAX_Q + 1];
vector<update> updates[MAX_N + 2];
vector<int> queries[MAX_N + 1];

void solve( int l, int r ) {
    if ( l > r )
        return;

    int mid = (l + r) / 2;
    solve( l, mid - 1 );
    solve( mid + 1, r );

    vector<int> rangeSpots, virtualSpots;
    virtualSpots.push_back( 0 );
    for ( int i = l; i <= r; i++ ) {
        rangeSpots.push_back( spots[i] );
        virtualSpots.push_back( spots[i] );
    }
    sort( rangeSpots.begin(), rangeSpots.end(), []( int u, int v ) { return islandTree.timeIn[u] < islandTree.timeIn[v]; } );
    for ( int i = 0; i < rangeSpots.size() - 1; i++ )
        virtualSpots.push_back( islandTree.lca( rangeSpots[i], rangeSpots[i + 1] ) );
    sort( virtualSpots.begin(), virtualSpots.end(), []( int u, int v ) { return islandTree.timeIn[u] < islandTree.timeIn[v]; } );
    virtualSpots.resize( unique( virtualSpots.begin(), virtualSpots.end() ) - virtualSpots.begin() );

    Tree virtualSpotsTree;
    virtualSpotsTree.resize( virtualSpots.size() - 1 );

    vector<int> stack;
    stack.push_back( 1 );
    for ( int i = 2; i < virtualSpots.size(); i++ ) {
        while ( !stack.empty() && !islandTree.inSubtree( virtualSpots[stack.back()], virtualSpots[i] ) ) {
            stack.pop_back();
        }
        virtualSpotsTree.add_edge( stack.back(), i, islandTree.depth[virtualSpots[i]] - islandTree.depth[virtualSpots[stack.back()]] );
        stack.push_back( i );
    }

    unordered_map<int, int> valToPos;
    for ( int i = 1; i < virtualSpots.size(); i++ )
        valToPos[virtualSpots[i]] = i;
    for ( int i = l; i <= mid; i++ )
        virtualSpotsTree.addMaxLQ( valToPos[spots[i]], i );
    for ( int i = mid; i <= r; i++ )
        virtualSpotsTree.addMinHQ( valToPos[spots[i]], i );
    virtualSpotsTree.init( valToPos[spots[mid]] );

    for ( int i = l; i <= r; i++ )
        updates[i].clear();
    for ( auto e: virtualSpotsTree.edges ) {
        if ( virtualSpotsTree.depth[e.u] > virtualSpotsTree.depth[e.v] )
            swap( e.u, e.v );

        int x = max( l - 1, virtualSpotsTree.maxLQ[e.v] ), y = min( r + 1, virtualSpotsTree.minHQ[e.v] );
        updates[l].push_back( { mid, r, e.c } );
        updates[x + 1].push_back( { mid, r, -e.c } );
        updates[x + 1].push_back( { y, r, e.c } );
    }

    aib.init( mid, r );
    for ( int i = l; i <= mid; i++ ) {
        for ( update u: updates[i] ) {
            aib.update( u.l, u.x );
            aib.update( u.r + 1, -u.x );
        }
        for ( int q: queries[i] ) {
            if ( mid <= rightQ[q] && rightQ[q] <= r )
                ans[q] = aib.query( rightQ[q] );
        }
    }
}

int main() {
    int n, m, q;

    cin >> n >> m >> q;
    islandTree.resize( n );
    for ( int i = 0; i < n - 1; i++ ) {
        int u, v;
        cin >> u >> v;
        islandTree.add_edge( u, v, 1 );
    }
    for ( int i = 1; i <= m; i++ )
        cin >> spots[i];
    for ( int i = 1; i <= q; i++ ) {
        cin >> leftQ[i] >> rightQ[i];
        queries[leftQ[i]].push_back( i );
    }

    islandTree.init( 1 );
    solve( 1, m );

    for ( int i = 1; i <= q; i++ )
        cout << ans[i] + 1 << "\n";

    return 0;
}

Compilation message

tourism.cpp: In function 'void solve(int, int)':
tourism.cpp:173:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  173 |     for ( int i = 0; i < rangeSpots.size() - 1; i++ )
      |                      ~~^~~~~~~~~~~~~~~~~~~~~~~
tourism.cpp:183:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  183 |     for ( int i = 2; i < virtualSpots.size(); i++ ) {
      |                      ~~^~~~~~~~~~~~~~~~~~~~~
tourism.cpp:192:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  192 |     for ( int i = 1; i < virtualSpots.size(); i++ )
      |                      ~~^~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 5108 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 2 ms 4956 KB Output is correct
4 Correct 2 ms 5212 KB Output is correct
5 Correct 2 ms 5212 KB Output is correct
6 Correct 2 ms 5208 KB Output is correct
7 Correct 2 ms 5212 KB Output is correct
8 Correct 2 ms 5212 KB Output is correct
9 Correct 3 ms 5208 KB Output is correct
10 Correct 3 ms 5212 KB Output is correct
11 Correct 3 ms 5212 KB Output is correct
12 Correct 3 ms 5212 KB Output is correct
13 Correct 3 ms 5212 KB Output is correct
14 Correct 3 ms 5212 KB Output is correct
15 Correct 2 ms 5276 KB Output is correct
16 Correct 3 ms 5212 KB Output is correct
17 Correct 2 ms 5212 KB Output is correct
18 Correct 3 ms 5212 KB Output is correct
19 Correct 3 ms 5212 KB Output is correct
20 Correct 3 ms 5212 KB Output is correct
21 Correct 2 ms 5212 KB Output is correct
22 Correct 2 ms 5212 KB Output is correct
23 Correct 2 ms 5212 KB Output is correct
24 Correct 3 ms 5208 KB Output is correct
25 Correct 3 ms 5208 KB Output is correct
26 Correct 3 ms 5292 KB Output is correct
27 Correct 2 ms 4956 KB Output is correct
28 Correct 1 ms 4956 KB Output is correct
29 Correct 3 ms 5208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 5108 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 2 ms 4956 KB Output is correct
4 Correct 2 ms 5212 KB Output is correct
5 Correct 2 ms 5212 KB Output is correct
6 Correct 2 ms 5208 KB Output is correct
7 Correct 2 ms 5212 KB Output is correct
8 Correct 2 ms 5212 KB Output is correct
9 Correct 3 ms 5208 KB Output is correct
10 Correct 3 ms 5212 KB Output is correct
11 Correct 3 ms 5212 KB Output is correct
12 Correct 3 ms 5212 KB Output is correct
13 Correct 3 ms 5212 KB Output is correct
14 Correct 3 ms 5212 KB Output is correct
15 Correct 2 ms 5276 KB Output is correct
16 Correct 3 ms 5212 KB Output is correct
17 Correct 2 ms 5212 KB Output is correct
18 Correct 3 ms 5212 KB Output is correct
19 Correct 3 ms 5212 KB Output is correct
20 Correct 3 ms 5212 KB Output is correct
21 Correct 2 ms 5212 KB Output is correct
22 Correct 2 ms 5212 KB Output is correct
23 Correct 2 ms 5212 KB Output is correct
24 Correct 3 ms 5208 KB Output is correct
25 Correct 3 ms 5208 KB Output is correct
26 Correct 3 ms 5292 KB Output is correct
27 Correct 2 ms 4956 KB Output is correct
28 Correct 1 ms 4956 KB Output is correct
29 Correct 3 ms 5208 KB Output is correct
30 Correct 11 ms 5980 KB Output is correct
31 Correct 13 ms 5980 KB Output is correct
32 Correct 16 ms 6236 KB Output is correct
33 Correct 16 ms 6444 KB Output is correct
34 Correct 15 ms 6232 KB Output is correct
35 Correct 18 ms 6236 KB Output is correct
36 Correct 15 ms 6224 KB Output is correct
37 Correct 15 ms 6236 KB Output is correct
38 Correct 12 ms 6492 KB Output is correct
39 Correct 12 ms 6492 KB Output is correct
40 Correct 13 ms 6488 KB Output is correct
41 Correct 12 ms 6340 KB Output is correct
42 Correct 12 ms 6744 KB Output is correct
43 Correct 12 ms 6252 KB Output is correct
44 Correct 14 ms 6236 KB Output is correct
45 Correct 15 ms 6236 KB Output is correct
46 Correct 14 ms 6324 KB Output is correct
47 Correct 14 ms 6236 KB Output is correct
48 Correct 14 ms 6236 KB Output is correct
49 Correct 13 ms 6232 KB Output is correct
50 Correct 12 ms 5980 KB Output is correct
51 Correct 12 ms 5980 KB Output is correct
52 Correct 12 ms 5980 KB Output is correct
53 Correct 12 ms 5980 KB Output is correct
54 Correct 12 ms 6108 KB Output is correct
55 Correct 12 ms 5980 KB Output is correct
56 Correct 4 ms 5212 KB Output is correct
57 Correct 3 ms 5212 KB Output is correct
58 Correct 19 ms 6128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4952 KB Output is correct
2 Correct 2 ms 4956 KB Output is correct
3 Correct 4 ms 5212 KB Output is correct
4 Correct 973 ms 72588 KB Output is correct
5 Correct 604 ms 60800 KB Output is correct
6 Correct 930 ms 81496 KB Output is correct
7 Correct 1131 ms 95856 KB Output is correct
8 Correct 1179 ms 95272 KB Output is correct
9 Correct 1195 ms 96160 KB Output is correct
10 Correct 1090 ms 95412 KB Output is correct
11 Correct 1110 ms 96208 KB Output is correct
12 Correct 829 ms 72172 KB Output is correct
13 Correct 824 ms 72104 KB Output is correct
14 Correct 861 ms 72016 KB Output is correct
15 Correct 82 ms 28272 KB Output is correct
16 Correct 1179 ms 95320 KB Output is correct
17 Correct 186 ms 12140 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4956 KB Output is correct
2 Correct 746 ms 44976 KB Output is correct
3 Correct 1342 ms 59668 KB Output is correct
4 Correct 1067 ms 55612 KB Output is correct
5 Correct 1716 ms 82120 KB Output is correct
6 Correct 1750 ms 82920 KB Output is correct
7 Correct 1730 ms 82580 KB Output is correct
8 Correct 1774 ms 81868 KB Output is correct
9 Correct 1672 ms 82860 KB Output is correct
10 Correct 1754 ms 83384 KB Output is correct
11 Correct 1700 ms 82048 KB Output is correct
12 Correct 1664 ms 83680 KB Output is correct
13 Correct 1605 ms 82944 KB Output is correct
14 Correct 1723 ms 83464 KB Output is correct
15 Correct 1751 ms 88012 KB Output is correct
16 Correct 1700 ms 83840 KB Output is correct
17 Correct 1750 ms 83940 KB Output is correct
18 Correct 1696 ms 82272 KB Output is correct
19 Correct 1698 ms 86524 KB Output is correct
20 Correct 1737 ms 86696 KB Output is correct
21 Correct 1749 ms 86764 KB Output is correct
22 Correct 1722 ms 86560 KB Output is correct
23 Correct 1789 ms 86740 KB Output is correct
24 Correct 1770 ms 86752 KB Output is correct
25 Correct 1681 ms 86776 KB Output is correct
26 Correct 1758 ms 86860 KB Output is correct
27 Correct 1801 ms 86760 KB Output is correct
28 Correct 1730 ms 86436 KB Output is correct
29 Correct 1788 ms 86712 KB Output is correct
30 Correct 1738 ms 86336 KB Output is correct
31 Correct 1704 ms 86856 KB Output is correct
32 Correct 1727 ms 87424 KB Output is correct
33 Correct 1899 ms 89348 KB Output is correct
34 Correct 1802 ms 92500 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4956 KB Output is correct
2 Correct 2 ms 4956 KB Output is correct
3 Correct 4 ms 5212 KB Output is correct
4 Correct 1407 ms 72348 KB Output is correct
5 Correct 1412 ms 77364 KB Output is correct
6 Correct 1659 ms 88772 KB Output is correct
7 Correct 1725 ms 94056 KB Output is correct
8 Correct 1776 ms 94328 KB Output is correct
9 Correct 1816 ms 93832 KB Output is correct
10 Correct 1782 ms 94136 KB Output is correct
11 Correct 1779 ms 94228 KB Output is correct
12 Correct 1799 ms 94436 KB Output is correct
13 Correct 1783 ms 94328 KB Output is correct
14 Correct 186 ms 12032 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 5108 KB Output is correct
2 Correct 1 ms 4952 KB Output is correct
3 Correct 2 ms 4956 KB Output is correct
4 Correct 2 ms 5212 KB Output is correct
5 Correct 2 ms 5212 KB Output is correct
6 Correct 2 ms 5208 KB Output is correct
7 Correct 2 ms 5212 KB Output is correct
8 Correct 2 ms 5212 KB Output is correct
9 Correct 3 ms 5208 KB Output is correct
10 Correct 3 ms 5212 KB Output is correct
11 Correct 3 ms 5212 KB Output is correct
12 Correct 3 ms 5212 KB Output is correct
13 Correct 3 ms 5212 KB Output is correct
14 Correct 3 ms 5212 KB Output is correct
15 Correct 2 ms 5276 KB Output is correct
16 Correct 3 ms 5212 KB Output is correct
17 Correct 2 ms 5212 KB Output is correct
18 Correct 3 ms 5212 KB Output is correct
19 Correct 3 ms 5212 KB Output is correct
20 Correct 3 ms 5212 KB Output is correct
21 Correct 2 ms 5212 KB Output is correct
22 Correct 2 ms 5212 KB Output is correct
23 Correct 2 ms 5212 KB Output is correct
24 Correct 3 ms 5208 KB Output is correct
25 Correct 3 ms 5208 KB Output is correct
26 Correct 3 ms 5292 KB Output is correct
27 Correct 2 ms 4956 KB Output is correct
28 Correct 1 ms 4956 KB Output is correct
29 Correct 3 ms 5208 KB Output is correct
30 Correct 11 ms 5980 KB Output is correct
31 Correct 13 ms 5980 KB Output is correct
32 Correct 16 ms 6236 KB Output is correct
33 Correct 16 ms 6444 KB Output is correct
34 Correct 15 ms 6232 KB Output is correct
35 Correct 18 ms 6236 KB Output is correct
36 Correct 15 ms 6224 KB Output is correct
37 Correct 15 ms 6236 KB Output is correct
38 Correct 12 ms 6492 KB Output is correct
39 Correct 12 ms 6492 KB Output is correct
40 Correct 13 ms 6488 KB Output is correct
41 Correct 12 ms 6340 KB Output is correct
42 Correct 12 ms 6744 KB Output is correct
43 Correct 12 ms 6252 KB Output is correct
44 Correct 14 ms 6236 KB Output is correct
45 Correct 15 ms 6236 KB Output is correct
46 Correct 14 ms 6324 KB Output is correct
47 Correct 14 ms 6236 KB Output is correct
48 Correct 14 ms 6236 KB Output is correct
49 Correct 13 ms 6232 KB Output is correct
50 Correct 12 ms 5980 KB Output is correct
51 Correct 12 ms 5980 KB Output is correct
52 Correct 12 ms 5980 KB Output is correct
53 Correct 12 ms 5980 KB Output is correct
54 Correct 12 ms 6108 KB Output is correct
55 Correct 12 ms 5980 KB Output is correct
56 Correct 4 ms 5212 KB Output is correct
57 Correct 3 ms 5212 KB Output is correct
58 Correct 19 ms 6128 KB Output is correct
59 Correct 1 ms 4952 KB Output is correct
60 Correct 2 ms 4956 KB Output is correct
61 Correct 4 ms 5212 KB Output is correct
62 Correct 973 ms 72588 KB Output is correct
63 Correct 604 ms 60800 KB Output is correct
64 Correct 930 ms 81496 KB Output is correct
65 Correct 1131 ms 95856 KB Output is correct
66 Correct 1179 ms 95272 KB Output is correct
67 Correct 1195 ms 96160 KB Output is correct
68 Correct 1090 ms 95412 KB Output is correct
69 Correct 1110 ms 96208 KB Output is correct
70 Correct 829 ms 72172 KB Output is correct
71 Correct 824 ms 72104 KB Output is correct
72 Correct 861 ms 72016 KB Output is correct
73 Correct 82 ms 28272 KB Output is correct
74 Correct 1179 ms 95320 KB Output is correct
75 Correct 186 ms 12140 KB Output is correct
76 Correct 1 ms 4956 KB Output is correct
77 Correct 746 ms 44976 KB Output is correct
78 Correct 1342 ms 59668 KB Output is correct
79 Correct 1067 ms 55612 KB Output is correct
80 Correct 1716 ms 82120 KB Output is correct
81 Correct 1750 ms 82920 KB Output is correct
82 Correct 1730 ms 82580 KB Output is correct
83 Correct 1774 ms 81868 KB Output is correct
84 Correct 1672 ms 82860 KB Output is correct
85 Correct 1754 ms 83384 KB Output is correct
86 Correct 1700 ms 82048 KB Output is correct
87 Correct 1664 ms 83680 KB Output is correct
88 Correct 1605 ms 82944 KB Output is correct
89 Correct 1723 ms 83464 KB Output is correct
90 Correct 1751 ms 88012 KB Output is correct
91 Correct 1700 ms 83840 KB Output is correct
92 Correct 1750 ms 83940 KB Output is correct
93 Correct 1696 ms 82272 KB Output is correct
94 Correct 1698 ms 86524 KB Output is correct
95 Correct 1737 ms 86696 KB Output is correct
96 Correct 1749 ms 86764 KB Output is correct
97 Correct 1722 ms 86560 KB Output is correct
98 Correct 1789 ms 86740 KB Output is correct
99 Correct 1770 ms 86752 KB Output is correct
100 Correct 1681 ms 86776 KB Output is correct
101 Correct 1758 ms 86860 KB Output is correct
102 Correct 1801 ms 86760 KB Output is correct
103 Correct 1730 ms 86436 KB Output is correct
104 Correct 1788 ms 86712 KB Output is correct
105 Correct 1738 ms 86336 KB Output is correct
106 Correct 1704 ms 86856 KB Output is correct
107 Correct 1727 ms 87424 KB Output is correct
108 Correct 1899 ms 89348 KB Output is correct
109 Correct 1802 ms 92500 KB Output is correct
110 Correct 1 ms 4956 KB Output is correct
111 Correct 2 ms 4956 KB Output is correct
112 Correct 4 ms 5212 KB Output is correct
113 Correct 1407 ms 72348 KB Output is correct
114 Correct 1412 ms 77364 KB Output is correct
115 Correct 1659 ms 88772 KB Output is correct
116 Correct 1725 ms 94056 KB Output is correct
117 Correct 1776 ms 94328 KB Output is correct
118 Correct 1816 ms 93832 KB Output is correct
119 Correct 1782 ms 94136 KB Output is correct
120 Correct 1779 ms 94228 KB Output is correct
121 Correct 1799 ms 94436 KB Output is correct
122 Correct 1783 ms 94328 KB Output is correct
123 Correct 186 ms 12032 KB Output is correct
124 Correct 1448 ms 72028 KB Output is correct
125 Correct 1063 ms 63484 KB Output is correct
126 Correct 1858 ms 86808 KB Output is correct
127 Correct 1781 ms 86288 KB Output is correct
128 Correct 1774 ms 86916 KB Output is correct
129 Correct 1785 ms 86484 KB Output is correct
130 Correct 1779 ms 85464 KB Output is correct
131 Correct 1447 ms 96684 KB Output is correct
132 Correct 1365 ms 96312 KB Output is correct
133 Correct 1452 ms 95624 KB Output is correct
134 Correct 1904 ms 91152 KB Output is correct
135 Correct 1816 ms 91560 KB Output is correct
136 Correct 1840 ms 91672 KB Output is correct
137 Correct 1351 ms 67984 KB Output is correct
138 Correct 1283 ms 67936 KB Output is correct
139 Correct 1279 ms 68260 KB Output is correct
140 Correct 1364 ms 68020 KB Output is correct
141 Correct 1299 ms 68104 KB Output is correct
142 Correct 1297 ms 68080 KB Output is correct
143 Correct 90 ms 24556 KB Output is correct
144 Correct 1919 ms 87728 KB Output is correct