Submission #794056

# Submission time Handle Problem Language Result Execution time Memory
794056 2023-07-26T08:59:35 Z vjudge1 Tourism (JOI23_tourism) C++14
35 / 100
1354 ms 47336 KB
#include<bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std ;
const int N = (1 << 17), sz = 317 ;
bool flag1, flag2, flag3, us[N + 1] ;
int n, m, q, c[N + 1], l[N + 1], r[N + 1], p[N + 1], dist[N + 1], ind[N + 1], pw[2 * N + 1], answer[N + 1] ;
vector<int> v[N + 1] ;
vector<pair<int, int>> tree ;
int mx[N + 1][20], mn1[N + 1][20], mg[N + 1][20] ;
pair<int, int> mn[2 * N + 1][20] ;
vector<int> hld ;
int kol[N + 1], index1[N + 1], tp[N + 1], bst[N + 1], sum[2 * N + 1], psh[2 * N + 1] ;
struct query
{
    int l, r, ind ;
};
bool cmp(query q1, query q2)
{
    if(q1.l / sz != q2.l / sz)
        return q1.l / sz < q2.l / sz ;
    else
        return q1.r < q2.r ;
}
void first_dfs(int city, int last)
{
    int now = 0 ;
    kol[city]++ ;
    for(int i : v[city])
    {
        if(i == last)
            continue ;
        first_dfs(i, city) ;
        kol[city] += kol[i] ;
        if(now < kol[i])
        {
            now = kol[i] ;
            bst[city] = i ;
        }
    }
}
void second_dfs(int city, int last, int gay)
{
    tp[city] = gay ;
    index1[city] = hld.size() ;
    hld.push_back(city) ;
    if(bst[city])
        second_dfs(bst[city], city, gay) ;
    for(int i : v[city])
    {
        if(i == last || i == bst[city])
            continue ;
        second_dfs(i, city, hld.size()) ;
    }
}
void push(int l, int r, int v)
{
    if(psh[v] == -1)
        return ;
    int num = psh[v] ;
    psh[v] = -1 ;
    sum[v] = num * (r - l + 1) ;
    if(l == r)
        return ;
    psh[v * 2] = num ;
    psh[v * 2 + 1] = num ;
}
void build()
{
    for(int i = 1 ; i <= 2 * N ; i++)
        psh[i] = -1 ;
}
void update(int l, int r, int l1, int r1, int num, int v)
{
    push(l, r, v) ;
    if(l > r1 || r < l1)
        return ;
    if(l1 <= l && r <= r1)
    {
        psh[v] = num ;
        push(l, r, v) ;
        return ;
    }
    int mid = (l + r) >> 1 ;
    update(l, mid, l1, r1, num, v * 2) ;
    update(mid + 1, r, l1, r1, num, v * 2 + 1) ;
    sum[v] = sum[v * 2] + sum[v * 2 + 1] ;
}
//конец hld
void dfs(int city, int last)
{
    ind[city] = tree.size() ;
    tree.push_back({dist[city], city}) ;
    p[city] = last ;
    for(int i : v[city])
    {
        if(i == last)
            continue ;
        dist[i] = dist[city] + 1 ;
        dfs(i, city) ;
        tree.push_back({dist[city], city}) ;
    }
}
void build_lca()
{
    for(int i = 2 ; i <= tree.size() ; i++)
        pw[i] = pw[i / 2] + 1 ;
    for(int i = 0 ; i < tree.size() ; i++)
        mn[i][0] = tree[i] ;
    for(int i = 1 ; i < 20 ; i++)
        for(int j = 0 ; j <= (int)tree.size() - (1 << i) ; j++)
            mn[j][i] = min(mn[j][i - 1], mn[j + (1 << (i - 1))][i - 1]) ;
}
int get_lca(int a, int b)
{
    a = ind[a] ;
    b = ind[b] ;
    if(a > b)
        swap(a, b) ;
    int num = pw[b - a + 1] ;
    return min(mn[a][num], mn[b - (1 << num) + 1][num]).se ;
}
void build_mx_mn()
{
    for(int i = 2 ; i <= m ; i++)
        pw[i] = pw[i / 2] + 1 ;
    for(int i = 1 ; i <= m ; i++)
        mn1[i][0] = c[i], mx[i][0] = c[i] ;
    for(int i = 1 ; i < 20 ; i++)
        for(int j = 1 ; j <= m - (1 << i) + 1 ; j++)
            mn1[j][i] = min(mn1[j][i - 1], mn1[j + (1 << (i - 1))][i - 1]),
            mx[j][i] = max(mx[j][i - 1], mx[j + (1 << (i - 1))][i - 1]) ;
}
pair<int, int> get_mn_mx(int a, int b)
{
    int num = pw[b - a + 1] ;
    return {min(mn1[a][num], mn1[b - (1 << num) + 1][num]), max(mx[a][num], mx[b - (1 << num) + 1][num])} ;
}
//всё ниже для MO's algorithm
int cnt[N + 1], sm[2 * N + 1] ;
void build_mega_lca()
{
    for(int i = 2 ; i <= m ; i++)
        pw[i] = pw[i / 2] + 1 ;
    for(int i = 1 ; i <= m ; i++)
        mg[i][0] = c[i] ;
    for(int i = 1 ; i < 20 ; i++)
        for(int j = 1 ; j <= n - (1 << i) + 1 ; j++)
            mg[j][i] = get_lca(mg[j][i - 1], mg[j + (1 << (i - 1))][i - 1]) ;
}
int get_mega_lca(int a, int b)
{
    int num = pw[b - a + 1] ;
    return get_lca(mg[a][num], mg[b - (1 << num) + 1][num]) ;
}
void del(int ind)
{
    while(ind)
    {
        sm[ind] = sm[ind * 2] + sm[ind * 2 + 1] + 1 ;
        cnt[ind]-- ;
        if(!cnt[ind])sm[ind]-- ;
        ind >>= 1 ;
    }
}
void add(int ind)
{
    while(ind)
    {
        sm[ind] = sm[ind * 2] + sm[ind * 2 + 1] + (cnt[ind] > 0) ;
        if(!cnt[ind])sm[ind]++ ;
        cnt[ind]++ ;
        ind >>= 1 ;
    }
}
//конец
signed main()
{
    ios_base::sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
    cin >> n >> m >> q ;
    for(int i = 1 ; i < n ; i++)
    {
        int a, b ;
        cin >> a >> b ;
        if(a != i || b != i + 1)flag1 = 1 ;
        if(a != (i + 1) / 2 || b != i + 1)flag3 = 1 ;
        v[a].push_back(b) ;
        v[b].push_back(a) ;
    }
    for(int i = 1 ; i <= m ; i++)
        cin >> c[i] ;
    for(int i = 1 ; i <= q ; i++)
        cin >> l[i] >> r[i] ;
    for(int i = 1 ; i < q ; i++)
        if(r[i] + 1 != l[i + 1])
            flag2 = 1 ;
    if(!flag3)
    {
        dfs(1, 0) ;
        build_lca() ;
        build_mega_lca() ;
        int ln = 0, rn = -1 ;
        vector<query> qr ;
        for(int i = 1 ; i <= q ; i++)
        {
            query q ;
            q.l = l[i] - 1 ;
            q.r = r[i] - 1 ;
            q.ind = i ;
            qr.push_back(q) ;
        }
        sort(qr.begin(), qr.end(), cmp) ;
        for(query i : qr)
        {
            int j = i.ind, lc = get_mega_lca(i.l + 1, i.r + 1) ;
//            cout<<j << ' '<<i.l<<' '<<i.r<<' '<<lc << ' ' << ln << ' '<< rn << '\n' ;
            while(rn < i.r)
            {
                rn++ ;
                add(c[rn + 1]) ;
            }
//            cout<<j << ' '<<i.l<<' '<<i.r<<' '<<lc << ' ' << ln << ' '<< rn << '\n' ;
            while(ln > i.l)
            {
                ln-- ;
                add(c[ln + 1]) ;
            }
//            cout<<j << ' '<<i.l<<' '<<i.r<<' '<<lc << ' ' << ln << ' '<< rn << '\n' ;
            while(rn > i.r)
            {
                del(c[rn + 1]) ;
                rn-- ;
            }
//            cout<<j << ' '<<i.l<<' '<<i.r<<' '<<lc << ' ' << ln << ' '<< rn << '\n' ;
            while(ln < i.l)
            {
                del(c[ln + 1]) ;
                ln++ ;
            }
//            cout<<j << ' '<<i.l<<' '<<i.r<<' '<<lc << ' ' << ln << ' '<< rn << '\n' ;
            answer[j] = sm[lc] ;
        }
        for(int i = 1 ; i <= q ; i++)
            cout << answer[i] << '\n' ;
        return 0 ;
    }
    if(!flag2)
    {
        dfs(1, 0) ;
        build_lca() ;
        first_dfs(1, 0) ;
        second_dfs(1, 0, 0) ;
        build() ;
        for(int i = 1 ; i <= q ; i++)
        {
            int lc = c[l[i]] ;
            for(int j = l[i] + 1 ; j <= r[i] ; j++)
                lc = get_lca(lc, c[j]) ;
            for(int j = l[i] ; j <= r[i] ; j++)
            {
                int now = c[j] ;
                while(now != p[lc])
                    if(index1[lc] < tp[now])
                    {
                        update(0, N - 1, tp[now], index1[now], 1, 1) ;
                        now = p[hld[tp[now]]] ;
                    }
                    else
                    {
                        update(0, N - 1, index1[lc], index1[now], 1, 1) ;
                        now = p[lc] ;
                    }
            }
            cout << sum[1] << '\n' ;
            psh[1] = 0 ;
        }
        return 0 ;
    }
    if(!flag1)
    {
        build_mx_mn() ;
        for(int i = 1 ; i <= q ; i++)
        {
            pair<int, int> p = get_mn_mx(l[i], r[i]) ;
            cout << p.se - p.fi + 1 << '\n' ;
        }
        return 0 ;
    }
    if(n <= 2000 && m <= 2000 && q <= 2000)
    {
        us[0] = 1 ;
        dfs(1, 0) ;
        build_lca() ;
        for(int i = 1 ; i <= q ; i++)
        {
            int ans = 0, lc = c[l[i]] ;
            for(int j = l[i] + 1 ; j <= r[i] ; j++)
                lc = get_lca(lc, c[j]) ;
            for(int j = l[i] ; j <= r[i] ; j++)
            {
                int now = c[j] ;
                while(!us[now])
                {
                    ans++ ;
                    us[now] = 1 ;
                    if(now == lc)
                        break ;
                    now = p[now] ;
                }
            }
            for(int i = 1 ; i <= n ; i++)
                us[i] = 0 ;
            cout << ans << '\n' ;
        }
        return 0 ;
    }
    return 0 ;
}
//7 6 1
//1 2
//1 3
//2 4
//2 5
//3 6
//3 7
//2 3 6 4 5 7
//1 3

Compilation message

tourism.cpp: In function 'void build_lca()':
tourism.cpp:107:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  107 |     for(int i = 2 ; i <= tree.size() ; i++)
      |                     ~~^~~~~~~~~~~~~~
tourism.cpp:109:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  109 |     for(int i = 0 ; i < tree.size() ; i++)
      |                     ~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3412 KB Output is correct
2 Correct 2 ms 3364 KB Output is correct
3 Correct 2 ms 3444 KB Output is correct
4 Correct 2 ms 3424 KB Output is correct
5 Correct 2 ms 3540 KB Output is correct
6 Correct 2 ms 3412 KB Output is correct
7 Correct 2 ms 3412 KB Output is correct
8 Correct 2 ms 3540 KB Output is correct
9 Correct 2 ms 3540 KB Output is correct
10 Correct 2 ms 3540 KB Output is correct
11 Correct 2 ms 3540 KB Output is correct
12 Correct 3 ms 3540 KB Output is correct
13 Correct 3 ms 3540 KB Output is correct
14 Correct 3 ms 3540 KB Output is correct
15 Correct 2 ms 3540 KB Output is correct
16 Correct 2 ms 3540 KB Output is correct
17 Correct 2 ms 3540 KB Output is correct
18 Correct 2 ms 3540 KB Output is correct
19 Correct 2 ms 3540 KB Output is correct
20 Correct 3 ms 3540 KB Output is correct
21 Correct 2 ms 3540 KB Output is correct
22 Correct 2 ms 3540 KB Output is correct
23 Correct 2 ms 3540 KB Output is correct
24 Correct 2 ms 3540 KB Output is correct
25 Correct 2 ms 3540 KB Output is correct
26 Correct 2 ms 3540 KB Output is correct
27 Correct 2 ms 3412 KB Output is correct
28 Correct 2 ms 3540 KB Output is correct
29 Correct 2 ms 3540 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3412 KB Output is correct
2 Correct 2 ms 3364 KB Output is correct
3 Correct 2 ms 3444 KB Output is correct
4 Correct 2 ms 3424 KB Output is correct
5 Correct 2 ms 3540 KB Output is correct
6 Correct 2 ms 3412 KB Output is correct
7 Correct 2 ms 3412 KB Output is correct
8 Correct 2 ms 3540 KB Output is correct
9 Correct 2 ms 3540 KB Output is correct
10 Correct 2 ms 3540 KB Output is correct
11 Correct 2 ms 3540 KB Output is correct
12 Correct 3 ms 3540 KB Output is correct
13 Correct 3 ms 3540 KB Output is correct
14 Correct 3 ms 3540 KB Output is correct
15 Correct 2 ms 3540 KB Output is correct
16 Correct 2 ms 3540 KB Output is correct
17 Correct 2 ms 3540 KB Output is correct
18 Correct 2 ms 3540 KB Output is correct
19 Correct 2 ms 3540 KB Output is correct
20 Correct 3 ms 3540 KB Output is correct
21 Correct 2 ms 3540 KB Output is correct
22 Correct 2 ms 3540 KB Output is correct
23 Correct 2 ms 3540 KB Output is correct
24 Correct 2 ms 3540 KB Output is correct
25 Correct 2 ms 3540 KB Output is correct
26 Correct 2 ms 3540 KB Output is correct
27 Correct 2 ms 3412 KB Output is correct
28 Correct 2 ms 3540 KB Output is correct
29 Correct 2 ms 3540 KB Output is correct
30 Correct 14 ms 4088 KB Output is correct
31 Correct 20 ms 4008 KB Output is correct
32 Correct 30 ms 4284 KB Output is correct
33 Correct 28 ms 4180 KB Output is correct
34 Correct 29 ms 4284 KB Output is correct
35 Correct 48 ms 4180 KB Output is correct
36 Correct 48 ms 4276 KB Output is correct
37 Correct 48 ms 4280 KB Output is correct
38 Correct 27 ms 4416 KB Output is correct
39 Correct 30 ms 4412 KB Output is correct
40 Correct 30 ms 4412 KB Output is correct
41 Correct 54 ms 4440 KB Output is correct
42 Correct 52 ms 4448 KB Output is correct
43 Correct 63 ms 4392 KB Output is correct
44 Correct 25 ms 4356 KB Output is correct
45 Correct 28 ms 4316 KB Output is correct
46 Correct 26 ms 4356 KB Output is correct
47 Correct 50 ms 4328 KB Output is correct
48 Correct 51 ms 4308 KB Output is correct
49 Correct 49 ms 4308 KB Output is correct
50 Correct 26 ms 4292 KB Output is correct
51 Correct 26 ms 4180 KB Output is correct
52 Correct 27 ms 4292 KB Output is correct
53 Correct 25 ms 4276 KB Output is correct
54 Correct 25 ms 4288 KB Output is correct
55 Correct 26 ms 4292 KB Output is correct
56 Correct 3 ms 3668 KB Output is correct
57 Correct 3 ms 4180 KB Output is correct
58 Correct 3 ms 4180 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3412 KB Output is correct
2 Correct 2 ms 3412 KB Output is correct
3 Correct 3 ms 3668 KB Output is correct
4 Correct 48 ms 20720 KB Output is correct
5 Correct 40 ms 16172 KB Output is correct
6 Correct 48 ms 20444 KB Output is correct
7 Correct 67 ms 24312 KB Output is correct
8 Correct 66 ms 24396 KB Output is correct
9 Correct 65 ms 24280 KB Output is correct
10 Correct 68 ms 24324 KB Output is correct
11 Correct 67 ms 24312 KB Output is correct
12 Correct 58 ms 24368 KB Output is correct
13 Correct 57 ms 24344 KB Output is correct
14 Correct 60 ms 24404 KB Output is correct
15 Correct 33 ms 7500 KB Output is correct
16 Correct 62 ms 23920 KB Output is correct
17 Correct 161 ms 14688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3412 KB Output is correct
2 Correct 110 ms 27364 KB Output is correct
3 Correct 158 ms 29408 KB Output is correct
4 Correct 135 ms 32824 KB Output is correct
5 Correct 201 ms 46160 KB Output is correct
6 Correct 200 ms 46136 KB Output is correct
7 Correct 210 ms 46208 KB Output is correct
8 Correct 208 ms 46148 KB Output is correct
9 Correct 208 ms 46196 KB Output is correct
10 Correct 217 ms 46280 KB Output is correct
11 Correct 212 ms 46180 KB Output is correct
12 Correct 216 ms 46260 KB Output is correct
13 Correct 229 ms 46392 KB Output is correct
14 Correct 236 ms 46516 KB Output is correct
15 Correct 131 ms 47184 KB Output is correct
16 Correct 215 ms 46464 KB Output is correct
17 Correct 217 ms 46248 KB Output is correct
18 Correct 218 ms 46332 KB Output is correct
19 Correct 185 ms 46228 KB Output is correct
20 Correct 178 ms 46276 KB Output is correct
21 Correct 184 ms 46292 KB Output is correct
22 Correct 182 ms 46284 KB Output is correct
23 Correct 181 ms 46232 KB Output is correct
24 Correct 189 ms 46188 KB Output is correct
25 Correct 180 ms 46228 KB Output is correct
26 Correct 189 ms 46248 KB Output is correct
27 Correct 197 ms 46340 KB Output is correct
28 Correct 193 ms 46176 KB Output is correct
29 Correct 204 ms 46304 KB Output is correct
30 Correct 207 ms 46496 KB Output is correct
31 Correct 208 ms 46412 KB Output is correct
32 Correct 209 ms 46560 KB Output is correct
33 Correct 200 ms 46764 KB Output is correct
34 Correct 127 ms 47336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3412 KB Output is correct
2 Correct 2 ms 3412 KB Output is correct
3 Correct 3 ms 3668 KB Output is correct
4 Incorrect 1354 ms 36908 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3412 KB Output is correct
2 Correct 2 ms 3364 KB Output is correct
3 Correct 2 ms 3444 KB Output is correct
4 Correct 2 ms 3424 KB Output is correct
5 Correct 2 ms 3540 KB Output is correct
6 Correct 2 ms 3412 KB Output is correct
7 Correct 2 ms 3412 KB Output is correct
8 Correct 2 ms 3540 KB Output is correct
9 Correct 2 ms 3540 KB Output is correct
10 Correct 2 ms 3540 KB Output is correct
11 Correct 2 ms 3540 KB Output is correct
12 Correct 3 ms 3540 KB Output is correct
13 Correct 3 ms 3540 KB Output is correct
14 Correct 3 ms 3540 KB Output is correct
15 Correct 2 ms 3540 KB Output is correct
16 Correct 2 ms 3540 KB Output is correct
17 Correct 2 ms 3540 KB Output is correct
18 Correct 2 ms 3540 KB Output is correct
19 Correct 2 ms 3540 KB Output is correct
20 Correct 3 ms 3540 KB Output is correct
21 Correct 2 ms 3540 KB Output is correct
22 Correct 2 ms 3540 KB Output is correct
23 Correct 2 ms 3540 KB Output is correct
24 Correct 2 ms 3540 KB Output is correct
25 Correct 2 ms 3540 KB Output is correct
26 Correct 2 ms 3540 KB Output is correct
27 Correct 2 ms 3412 KB Output is correct
28 Correct 2 ms 3540 KB Output is correct
29 Correct 2 ms 3540 KB Output is correct
30 Correct 14 ms 4088 KB Output is correct
31 Correct 20 ms 4008 KB Output is correct
32 Correct 30 ms 4284 KB Output is correct
33 Correct 28 ms 4180 KB Output is correct
34 Correct 29 ms 4284 KB Output is correct
35 Correct 48 ms 4180 KB Output is correct
36 Correct 48 ms 4276 KB Output is correct
37 Correct 48 ms 4280 KB Output is correct
38 Correct 27 ms 4416 KB Output is correct
39 Correct 30 ms 4412 KB Output is correct
40 Correct 30 ms 4412 KB Output is correct
41 Correct 54 ms 4440 KB Output is correct
42 Correct 52 ms 4448 KB Output is correct
43 Correct 63 ms 4392 KB Output is correct
44 Correct 25 ms 4356 KB Output is correct
45 Correct 28 ms 4316 KB Output is correct
46 Correct 26 ms 4356 KB Output is correct
47 Correct 50 ms 4328 KB Output is correct
48 Correct 51 ms 4308 KB Output is correct
49 Correct 49 ms 4308 KB Output is correct
50 Correct 26 ms 4292 KB Output is correct
51 Correct 26 ms 4180 KB Output is correct
52 Correct 27 ms 4292 KB Output is correct
53 Correct 25 ms 4276 KB Output is correct
54 Correct 25 ms 4288 KB Output is correct
55 Correct 26 ms 4292 KB Output is correct
56 Correct 3 ms 3668 KB Output is correct
57 Correct 3 ms 4180 KB Output is correct
58 Correct 3 ms 4180 KB Output is correct
59 Correct 2 ms 3412 KB Output is correct
60 Correct 2 ms 3412 KB Output is correct
61 Correct 3 ms 3668 KB Output is correct
62 Correct 48 ms 20720 KB Output is correct
63 Correct 40 ms 16172 KB Output is correct
64 Correct 48 ms 20444 KB Output is correct
65 Correct 67 ms 24312 KB Output is correct
66 Correct 66 ms 24396 KB Output is correct
67 Correct 65 ms 24280 KB Output is correct
68 Correct 68 ms 24324 KB Output is correct
69 Correct 67 ms 24312 KB Output is correct
70 Correct 58 ms 24368 KB Output is correct
71 Correct 57 ms 24344 KB Output is correct
72 Correct 60 ms 24404 KB Output is correct
73 Correct 33 ms 7500 KB Output is correct
74 Correct 62 ms 23920 KB Output is correct
75 Correct 161 ms 14688 KB Output is correct
76 Correct 2 ms 3412 KB Output is correct
77 Correct 110 ms 27364 KB Output is correct
78 Correct 158 ms 29408 KB Output is correct
79 Correct 135 ms 32824 KB Output is correct
80 Correct 201 ms 46160 KB Output is correct
81 Correct 200 ms 46136 KB Output is correct
82 Correct 210 ms 46208 KB Output is correct
83 Correct 208 ms 46148 KB Output is correct
84 Correct 208 ms 46196 KB Output is correct
85 Correct 217 ms 46280 KB Output is correct
86 Correct 212 ms 46180 KB Output is correct
87 Correct 216 ms 46260 KB Output is correct
88 Correct 229 ms 46392 KB Output is correct
89 Correct 236 ms 46516 KB Output is correct
90 Correct 131 ms 47184 KB Output is correct
91 Correct 215 ms 46464 KB Output is correct
92 Correct 217 ms 46248 KB Output is correct
93 Correct 218 ms 46332 KB Output is correct
94 Correct 185 ms 46228 KB Output is correct
95 Correct 178 ms 46276 KB Output is correct
96 Correct 184 ms 46292 KB Output is correct
97 Correct 182 ms 46284 KB Output is correct
98 Correct 181 ms 46232 KB Output is correct
99 Correct 189 ms 46188 KB Output is correct
100 Correct 180 ms 46228 KB Output is correct
101 Correct 189 ms 46248 KB Output is correct
102 Correct 197 ms 46340 KB Output is correct
103 Correct 193 ms 46176 KB Output is correct
104 Correct 204 ms 46304 KB Output is correct
105 Correct 207 ms 46496 KB Output is correct
106 Correct 208 ms 46412 KB Output is correct
107 Correct 209 ms 46560 KB Output is correct
108 Correct 200 ms 46764 KB Output is correct
109 Correct 127 ms 47336 KB Output is correct
110 Correct 2 ms 3412 KB Output is correct
111 Correct 2 ms 3412 KB Output is correct
112 Correct 3 ms 3668 KB Output is correct
113 Incorrect 1354 ms 36908 KB Output isn't correct
114 Halted 0 ms 0 KB -