Submission #968897

# Submission time Handle Problem Language Result Execution time Memory
968897 2024-04-24T09:09:18 Z socpite New Home (APIO18_new_home) C++17
100 / 100
4669 ms 705464 KB
// #pragma GCC optimize("arch=skylake")
#include<bits/stdc++.h>
using namespace std;

const int maxn = 6e5+5;
const int INF = 1e9+5;

vector<pair<int, pair<int, int>>> ev;
vector<int> cp, cpy;
int n, q, k;

int ans[maxn];
int p[maxn], ty[maxn];
int L[maxn], Y[maxn];

int st[4*maxn][2];

struct ev_upd{
    int l, r, val, ty;
    ev_upd(int _l, int _r, int _val, int _ty): l(_l), r(_r), ty(_ty), val(_val){};
};

vector<pair<int, int>> leaf_q[maxn];  
set<pair<int, int>> pos[maxn];
int last_time[maxn][2];


vector<ev_upd> st_time[4*maxn];

int crrt;

long long undo_stack[maxn*200];
int stksz = 0;

// 0 is min, 1 is max

void upd_st(int l, int r, int val, int ty, int &cnt){
    if(l > r)return;
    r++;
    for (l += cp.size(), r += cp.size(); l < r; l >>= 1, r >>= 1){
        if(l&1){
            int id = l++;
            if(ty == 0){
                if(st[id][0] > val){
                    undo_stack[stksz++] = ((long long)id<<30)|st[id][0];
                    // cout << undo_stack[stksz-1] << endl;
                    st[id][0] = val;  
                    cnt++;
                }
            }
            else {
                if(st[id][1] < val){
                    undo_stack[stksz++] = (1LL<<60)|(((long long)id<<30)|st[id][1]);
                    // cout << undo_stack[stksz-1] << endl;
                    st[id][1] = val;
                    cnt++;
                }
            }
        }
        if(r&1){
            int id = --r;
            if(ty == 0){
                if(st[id][0] > val){
                    undo_stack[stksz++] = ((long long)id<<30)|st[id][0];
                    // cout << undo_stack[stksz-1] << endl;
                    st[id][0] = val;  
                    cnt++;
                }
            }
            else {
                if(st[id][1] < val){
                    undo_stack[stksz++] = (1LL<<60)|(((long long)id<<30)|st[id][1]);
                    // cout << undo_stack[stksz-1] << endl;
                    st[id][1] = val;
                    cnt++;
                }
            }
        }
    }
}

int query_st(int p){
    int tmp = cp[p];
    int res = 0;
    for (p += cp.size(); p > 0; p >>= 1){
        res = max(res, tmp - st[p][0]);
        res = max(res, st[p][1] - tmp);
    }
    return res;
}

int cnt_segment;

void time_add(int ql, int qr, const ev_upd &ele, int l = 0, int r = cpy.size()-1, int id = 1){
    // cout << ql << " " << qr << " " << ele.l << " " << ele.r << " " << ele.ty << endl;  
    if(ql > qr || ql > cpy[r] || qr < cpy[l])return;
    if(ql <= cpy[l] && cpy[r] <= qr){
        st_time[id].push_back(ele);
        cnt_segment++;
    }
    else {
        int mid = (l+r)>>1;
        time_add(ql, qr, ele, l, mid, id<<1);
        time_add(ql, qr, ele, mid+1, r, id<<1|1);
    }
}

int sumcol[maxn];
int sumall = 0, ptr = 0;

void time_dfs(int l = 0, int r = cpy.size()-1, int id = 1){
    int cnt = 0;
    for(auto &ele: st_time[id])  {
        upd_st(ele.l, ele.r, ele.val, ele.ty, cnt);
    }
    if(l == r){
        while(ptr < ev.size() && ev[ptr].first <= cpy[l]){
            if(ev[ptr].second.first){
                sumcol[ty[ev[ptr].second.second]]--;
                if(!sumcol[ty[ev[ptr].second.second]])sumall--;
            }
            else {
                if(!sumcol[ty[ev[ptr].second.second]])sumall++;
                sumcol[ty[ev[ptr].second.second]]++;
            }
            ptr++;
        }
        // cout << sumall << endl;
        for(auto qq: leaf_q[l]){
            ans[qq.second] = sumall < k ? -1 : query_st(qq.first);
        }
    }
    else {
        int mid = (l+r)>>1;
        time_dfs(l, mid, id<<1);
        time_dfs(mid+1, r, id<<1|1);
    }
    for(int i = 0; i < cnt; i++){
        stksz--;
        long long tmp = undo_stack[stksz];
        // cout << tmp << " " << ((tmp&((1LL<<60) - 1)) >> 30) << endl; 
        st[(tmp&((1LL<<60) - 1)) >> 30][tmp>>60] = tmp&((1<<30) - 1); 
    }
}


void add_range(int l, int r){
    if(l != -INF)last_time[l][0] = crrt;
    if(r != INF)last_time[r][1] = crrt;
}

int lb(int x){
    return lower_bound(cp.begin(), cp.end(), x) - cp.begin();
}

int ub(int x){
    return upper_bound(cp.begin(), cp.end(), x) - cp.begin() - 1;
}

void del_range(int l, int r){
    // return;
    if(l == -INF){
        ev_upd ele(lb(-INF), ub(p[r]), p[r], 1);
        time_add(last_time[r][1], crrt-1, ele);
        last_time[r][1] = 0;
    }
    else if(r == INF){
        time_add(last_time[l][0], crrt-1, ev_upd(lb(p[l]), ub(INF), p[l], 0));
        last_time[l][0] = 0;
    }
    else {
        int mid = (p[l]+p[r])/2;
        time_add(last_time[l][0], crrt-1, ev_upd(lb(p[l]), ub(mid), p[l], 0));
        time_add(last_time[r][1], crrt-1, ev_upd(lb(mid+1), ub(p[r]), p[r], 1));
        last_time[r][1] = 0;
        last_time[l][0] = 0;
    }
}

void add(int x, int col){
    // cout << x << endl;
    auto it = pos[col].insert(make_pair(p[x], x)).first;
    if(pos[col].size() == 1){
        add_range(-INF, x);
        add_range(x, INF);
    }
    else {
        if(next(it) == pos[col].end()){
            int prv = prev(it)->second;
            del_range(prv, INF);
            add_range(prv, x);
            add_range(x, INF);
        }
        else if(it == pos[col].begin()){
            int nxt = next(it)->second;
            del_range(-INF, nxt);
            add_range(-INF, x);
            add_range(x, nxt);
        }
        else {
            int prv = prev(it)->second;
            int nxt = next(it)->second;
            del_range(prv, nxt);
            add_range(prv, x);
            add_range(x, nxt);
        }
    }
}

void del(int x, int col){
    // cout << "DEL " << x << endl;
    auto it = pos[col].erase(pos[col].find(make_pair(p[x], x)));
    if(pos[col].size() == 0){
        del_range(-INF, x);
        del_range(x, INF);
    }
    else {
        if(it == pos[col].end()){
            int prv = prev(it)->second;
            del_range(x, INF);
            del_range(prv, x);
            add_range(prv, INF);
        }
        else if(it == pos[col].begin()){
            int nxt = it->second;
            del_range(-INF, x);
            del_range(x, nxt);
            add_range(-INF, nxt);
        }
        else {
            int prv = prev(it)->second;
            int nxt = it->second;
            del_range(x, nxt);
            del_range(prv, x);
            add_range(prv, nxt);
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    auto t1 = clock();
    // freopen("test_input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    cin >> n >> k >> q;
    for(int i = 0; i < 4*maxn; i++)st[i][0] = INF, st[i][1] = 0;
    for(int i = 1; i <= n; i++){
        int a, b;
        cin >> p[i] >> ty[i] >> a >> b;
        ev.push_back({a, {0, i}});
        ev.push_back({b+1, {1, i}});
    }
    for(int i = 1; i <= q; i++){
        cin >> L[i] >> Y[i];
        cp.push_back(L[i]);
        cpy.push_back(Y[i]);
    }
    sort(cp.begin(), cp.end());
    cp.erase(unique(cp.begin(), cp.end()), cp.end());
    sort(cpy.begin(), cpy.end());
    cpy.erase(unique(cpy.begin(), cpy.end()), cpy.end()); 
    sort(ev.begin(), ev.end());
    for(int i = 1; i <= q; i++)leaf_q[lower_bound(cpy.begin(), cpy.end(), Y[i]) - cpy.begin()].push_back({lb(L[i]), i});
    for(auto v: ev){
        crrt = v.first;
        if(v.second.first)del(v.second.second, ty[v.second.second]);
        else add(v.second.second, ty[v.second.second]);
    }
    // cout << "SUS" << endl;  
    // if(n > 100000)return 0;
    // cout << cnt_segment << endl;
    // return 0;
    time_dfs();
    // cout << clock() - t1 << endl;
    for(int i = 1; i <= q; i++)cout << ans[i] << "\n";
    
}

Compilation message

new_home.cpp: In constructor 'ev_upd::ev_upd(int, int, int, int)':
new_home.cpp:19:20: warning: 'ev_upd::ty' will be initialized after [-Wreorder]
   19 |     int l, r, val, ty;
      |                    ^~
new_home.cpp:19:15: warning:   'int ev_upd::val' [-Wreorder]
   19 |     int l, r, val, ty;
      |               ^~~
new_home.cpp:20:5: warning:   when initialized here [-Wreorder]
   20 |     ev_upd(int _l, int _r, int _val, int _ty): l(_l), r(_r), ty(_ty), val(_val){};
      |     ^~~~~~
new_home.cpp: In function 'void time_dfs(int, int, int)':
new_home.cpp:117:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  117 |         while(ptr < ev.size() && ev[ptr].first <= cpy[l]){
      |               ~~~~^~~~~~~~~~~
new_home.cpp: In function 'int main()':
new_home.cpp:243:10: warning: unused variable 't1' [-Wunused-variable]
  243 |     auto t1 = clock();
      |          ^~
# Verdict Execution time Memory Grader output
1 Correct 52 ms 120656 KB Output is correct
2 Correct 39 ms 120668 KB Output is correct
3 Correct 38 ms 120700 KB Output is correct
4 Correct 47 ms 120660 KB Output is correct
5 Correct 44 ms 120884 KB Output is correct
6 Correct 42 ms 120912 KB Output is correct
7 Correct 50 ms 120924 KB Output is correct
8 Correct 45 ms 120960 KB Output is correct
9 Correct 42 ms 120908 KB Output is correct
10 Correct 41 ms 120916 KB Output is correct
11 Correct 42 ms 120788 KB Output is correct
12 Correct 42 ms 120980 KB Output is correct
13 Correct 42 ms 120660 KB Output is correct
14 Correct 41 ms 120656 KB Output is correct
15 Correct 50 ms 120924 KB Output is correct
16 Correct 47 ms 120992 KB Output is correct
17 Correct 47 ms 121028 KB Output is correct
18 Correct 48 ms 120916 KB Output is correct
19 Correct 43 ms 121064 KB Output is correct
20 Correct 44 ms 120912 KB Output is correct
21 Correct 49 ms 120696 KB Output is correct
22 Correct 43 ms 121056 KB Output is correct
23 Correct 46 ms 121164 KB Output is correct
24 Correct 42 ms 121056 KB Output is correct
25 Correct 43 ms 120820 KB Output is correct
26 Correct 48 ms 120916 KB Output is correct
27 Correct 49 ms 120916 KB Output is correct
28 Correct 42 ms 120912 KB Output is correct
29 Correct 46 ms 120912 KB Output is correct
30 Correct 48 ms 120680 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 52 ms 120656 KB Output is correct
2 Correct 39 ms 120668 KB Output is correct
3 Correct 38 ms 120700 KB Output is correct
4 Correct 47 ms 120660 KB Output is correct
5 Correct 44 ms 120884 KB Output is correct
6 Correct 42 ms 120912 KB Output is correct
7 Correct 50 ms 120924 KB Output is correct
8 Correct 45 ms 120960 KB Output is correct
9 Correct 42 ms 120908 KB Output is correct
10 Correct 41 ms 120916 KB Output is correct
11 Correct 42 ms 120788 KB Output is correct
12 Correct 42 ms 120980 KB Output is correct
13 Correct 42 ms 120660 KB Output is correct
14 Correct 41 ms 120656 KB Output is correct
15 Correct 50 ms 120924 KB Output is correct
16 Correct 47 ms 120992 KB Output is correct
17 Correct 47 ms 121028 KB Output is correct
18 Correct 48 ms 120916 KB Output is correct
19 Correct 43 ms 121064 KB Output is correct
20 Correct 44 ms 120912 KB Output is correct
21 Correct 49 ms 120696 KB Output is correct
22 Correct 43 ms 121056 KB Output is correct
23 Correct 46 ms 121164 KB Output is correct
24 Correct 42 ms 121056 KB Output is correct
25 Correct 43 ms 120820 KB Output is correct
26 Correct 48 ms 120916 KB Output is correct
27 Correct 49 ms 120916 KB Output is correct
28 Correct 42 ms 120912 KB Output is correct
29 Correct 46 ms 120912 KB Output is correct
30 Correct 48 ms 120680 KB Output is correct
31 Correct 842 ms 219000 KB Output is correct
32 Correct 124 ms 134384 KB Output is correct
33 Correct 654 ms 212540 KB Output is correct
34 Correct 811 ms 211736 KB Output is correct
35 Correct 807 ms 219292 KB Output is correct
36 Correct 763 ms 218624 KB Output is correct
37 Correct 552 ms 197120 KB Output is correct
38 Correct 428 ms 196740 KB Output is correct
39 Correct 358 ms 173252 KB Output is correct
40 Correct 350 ms 178884 KB Output is correct
41 Correct 483 ms 172892 KB Output is correct
42 Correct 524 ms 174092 KB Output is correct
43 Correct 86 ms 133308 KB Output is correct
44 Correct 500 ms 170104 KB Output is correct
45 Correct 405 ms 160852 KB Output is correct
46 Correct 308 ms 143968 KB Output is correct
47 Correct 209 ms 142560 KB Output is correct
48 Correct 213 ms 139516 KB Output is correct
49 Correct 290 ms 150084 KB Output is correct
50 Correct 357 ms 166620 KB Output is correct
51 Correct 259 ms 145600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 973 ms 205672 KB Output is correct
2 Correct 1178 ms 198796 KB Output is correct
3 Correct 676 ms 201520 KB Output is correct
4 Correct 1004 ms 205076 KB Output is correct
5 Correct 1105 ms 196212 KB Output is correct
6 Correct 1150 ms 197028 KB Output is correct
7 Correct 639 ms 201516 KB Output is correct
8 Correct 805 ms 201756 KB Output is correct
9 Correct 895 ms 202152 KB Output is correct
10 Correct 1012 ms 201164 KB Output is correct
11 Correct 703 ms 196500 KB Output is correct
12 Correct 760 ms 200436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3811 ms 438884 KB Output is correct
2 Correct 502 ms 189140 KB Output is correct
3 Correct 2844 ms 458044 KB Output is correct
4 Correct 1561 ms 289868 KB Output is correct
5 Correct 3198 ms 383160 KB Output is correct
6 Correct 2765 ms 360068 KB Output is correct
7 Correct 2497 ms 451836 KB Output is correct
8 Correct 2769 ms 456188 KB Output is correct
9 Correct 1568 ms 288444 KB Output is correct
10 Correct 2867 ms 382732 KB Output is correct
11 Correct 3502 ms 440244 KB Output is correct
12 Correct 3108 ms 462936 KB Output is correct
13 Correct 1258 ms 337064 KB Output is correct
14 Correct 1184 ms 333412 KB Output is correct
15 Correct 1567 ms 376232 KB Output is correct
16 Correct 2033 ms 405744 KB Output is correct
17 Correct 1655 ms 393892 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 52 ms 120656 KB Output is correct
2 Correct 39 ms 120668 KB Output is correct
3 Correct 38 ms 120700 KB Output is correct
4 Correct 47 ms 120660 KB Output is correct
5 Correct 44 ms 120884 KB Output is correct
6 Correct 42 ms 120912 KB Output is correct
7 Correct 50 ms 120924 KB Output is correct
8 Correct 45 ms 120960 KB Output is correct
9 Correct 42 ms 120908 KB Output is correct
10 Correct 41 ms 120916 KB Output is correct
11 Correct 42 ms 120788 KB Output is correct
12 Correct 42 ms 120980 KB Output is correct
13 Correct 42 ms 120660 KB Output is correct
14 Correct 41 ms 120656 KB Output is correct
15 Correct 50 ms 120924 KB Output is correct
16 Correct 47 ms 120992 KB Output is correct
17 Correct 47 ms 121028 KB Output is correct
18 Correct 48 ms 120916 KB Output is correct
19 Correct 43 ms 121064 KB Output is correct
20 Correct 44 ms 120912 KB Output is correct
21 Correct 49 ms 120696 KB Output is correct
22 Correct 43 ms 121056 KB Output is correct
23 Correct 46 ms 121164 KB Output is correct
24 Correct 42 ms 121056 KB Output is correct
25 Correct 43 ms 120820 KB Output is correct
26 Correct 48 ms 120916 KB Output is correct
27 Correct 49 ms 120916 KB Output is correct
28 Correct 42 ms 120912 KB Output is correct
29 Correct 46 ms 120912 KB Output is correct
30 Correct 48 ms 120680 KB Output is correct
31 Correct 842 ms 219000 KB Output is correct
32 Correct 124 ms 134384 KB Output is correct
33 Correct 654 ms 212540 KB Output is correct
34 Correct 811 ms 211736 KB Output is correct
35 Correct 807 ms 219292 KB Output is correct
36 Correct 763 ms 218624 KB Output is correct
37 Correct 552 ms 197120 KB Output is correct
38 Correct 428 ms 196740 KB Output is correct
39 Correct 358 ms 173252 KB Output is correct
40 Correct 350 ms 178884 KB Output is correct
41 Correct 483 ms 172892 KB Output is correct
42 Correct 524 ms 174092 KB Output is correct
43 Correct 86 ms 133308 KB Output is correct
44 Correct 500 ms 170104 KB Output is correct
45 Correct 405 ms 160852 KB Output is correct
46 Correct 308 ms 143968 KB Output is correct
47 Correct 209 ms 142560 KB Output is correct
48 Correct 213 ms 139516 KB Output is correct
49 Correct 290 ms 150084 KB Output is correct
50 Correct 357 ms 166620 KB Output is correct
51 Correct 259 ms 145600 KB Output is correct
52 Correct 411 ms 166744 KB Output is correct
53 Correct 373 ms 166336 KB Output is correct
54 Correct 658 ms 194500 KB Output is correct
55 Correct 484 ms 179960 KB Output is correct
56 Correct 485 ms 178760 KB Output is correct
57 Correct 480 ms 174508 KB Output is correct
58 Correct 482 ms 174712 KB Output is correct
59 Correct 470 ms 174020 KB Output is correct
60 Correct 515 ms 174828 KB Output is correct
61 Correct 87 ms 133788 KB Output is correct
62 Correct 409 ms 170336 KB Output is correct
63 Correct 573 ms 185344 KB Output is correct
64 Correct 591 ms 188996 KB Output is correct
65 Correct 627 ms 191792 KB Output is correct
66 Correct 542 ms 179304 KB Output is correct
67 Correct 144 ms 136132 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 52 ms 120656 KB Output is correct
2 Correct 39 ms 120668 KB Output is correct
3 Correct 38 ms 120700 KB Output is correct
4 Correct 47 ms 120660 KB Output is correct
5 Correct 44 ms 120884 KB Output is correct
6 Correct 42 ms 120912 KB Output is correct
7 Correct 50 ms 120924 KB Output is correct
8 Correct 45 ms 120960 KB Output is correct
9 Correct 42 ms 120908 KB Output is correct
10 Correct 41 ms 120916 KB Output is correct
11 Correct 42 ms 120788 KB Output is correct
12 Correct 42 ms 120980 KB Output is correct
13 Correct 42 ms 120660 KB Output is correct
14 Correct 41 ms 120656 KB Output is correct
15 Correct 50 ms 120924 KB Output is correct
16 Correct 47 ms 120992 KB Output is correct
17 Correct 47 ms 121028 KB Output is correct
18 Correct 48 ms 120916 KB Output is correct
19 Correct 43 ms 121064 KB Output is correct
20 Correct 44 ms 120912 KB Output is correct
21 Correct 49 ms 120696 KB Output is correct
22 Correct 43 ms 121056 KB Output is correct
23 Correct 46 ms 121164 KB Output is correct
24 Correct 42 ms 121056 KB Output is correct
25 Correct 43 ms 120820 KB Output is correct
26 Correct 48 ms 120916 KB Output is correct
27 Correct 49 ms 120916 KB Output is correct
28 Correct 42 ms 120912 KB Output is correct
29 Correct 46 ms 120912 KB Output is correct
30 Correct 48 ms 120680 KB Output is correct
31 Correct 842 ms 219000 KB Output is correct
32 Correct 124 ms 134384 KB Output is correct
33 Correct 654 ms 212540 KB Output is correct
34 Correct 811 ms 211736 KB Output is correct
35 Correct 807 ms 219292 KB Output is correct
36 Correct 763 ms 218624 KB Output is correct
37 Correct 552 ms 197120 KB Output is correct
38 Correct 428 ms 196740 KB Output is correct
39 Correct 358 ms 173252 KB Output is correct
40 Correct 350 ms 178884 KB Output is correct
41 Correct 483 ms 172892 KB Output is correct
42 Correct 524 ms 174092 KB Output is correct
43 Correct 86 ms 133308 KB Output is correct
44 Correct 500 ms 170104 KB Output is correct
45 Correct 405 ms 160852 KB Output is correct
46 Correct 308 ms 143968 KB Output is correct
47 Correct 209 ms 142560 KB Output is correct
48 Correct 213 ms 139516 KB Output is correct
49 Correct 290 ms 150084 KB Output is correct
50 Correct 357 ms 166620 KB Output is correct
51 Correct 259 ms 145600 KB Output is correct
52 Correct 973 ms 205672 KB Output is correct
53 Correct 1178 ms 198796 KB Output is correct
54 Correct 676 ms 201520 KB Output is correct
55 Correct 1004 ms 205076 KB Output is correct
56 Correct 1105 ms 196212 KB Output is correct
57 Correct 1150 ms 197028 KB Output is correct
58 Correct 639 ms 201516 KB Output is correct
59 Correct 805 ms 201756 KB Output is correct
60 Correct 895 ms 202152 KB Output is correct
61 Correct 1012 ms 201164 KB Output is correct
62 Correct 703 ms 196500 KB Output is correct
63 Correct 760 ms 200436 KB Output is correct
64 Correct 3811 ms 438884 KB Output is correct
65 Correct 502 ms 189140 KB Output is correct
66 Correct 2844 ms 458044 KB Output is correct
67 Correct 1561 ms 289868 KB Output is correct
68 Correct 3198 ms 383160 KB Output is correct
69 Correct 2765 ms 360068 KB Output is correct
70 Correct 2497 ms 451836 KB Output is correct
71 Correct 2769 ms 456188 KB Output is correct
72 Correct 1568 ms 288444 KB Output is correct
73 Correct 2867 ms 382732 KB Output is correct
74 Correct 3502 ms 440244 KB Output is correct
75 Correct 3108 ms 462936 KB Output is correct
76 Correct 1258 ms 337064 KB Output is correct
77 Correct 1184 ms 333412 KB Output is correct
78 Correct 1567 ms 376232 KB Output is correct
79 Correct 2033 ms 405744 KB Output is correct
80 Correct 1655 ms 393892 KB Output is correct
81 Correct 411 ms 166744 KB Output is correct
82 Correct 373 ms 166336 KB Output is correct
83 Correct 658 ms 194500 KB Output is correct
84 Correct 484 ms 179960 KB Output is correct
85 Correct 485 ms 178760 KB Output is correct
86 Correct 480 ms 174508 KB Output is correct
87 Correct 482 ms 174712 KB Output is correct
88 Correct 470 ms 174020 KB Output is correct
89 Correct 515 ms 174828 KB Output is correct
90 Correct 87 ms 133788 KB Output is correct
91 Correct 409 ms 170336 KB Output is correct
92 Correct 573 ms 185344 KB Output is correct
93 Correct 591 ms 188996 KB Output is correct
94 Correct 627 ms 191792 KB Output is correct
95 Correct 542 ms 179304 KB Output is correct
96 Correct 144 ms 136132 KB Output is correct
97 Correct 2440 ms 395596 KB Output is correct
98 Correct 541 ms 187748 KB Output is correct
99 Correct 4514 ms 646768 KB Output is correct
100 Correct 2376 ms 362592 KB Output is correct
101 Correct 4634 ms 530040 KB Output is correct
102 Correct 4669 ms 705464 KB Output is correct
103 Correct 3338 ms 575548 KB Output is correct
104 Correct 2789 ms 574908 KB Output is correct
105 Correct 2019 ms 469208 KB Output is correct
106 Correct 2061 ms 493984 KB Output is correct
107 Correct 3050 ms 439720 KB Output is correct
108 Correct 3102 ms 468960 KB Output is correct
109 Correct 2999 ms 423632 KB Output is correct
110 Correct 3012 ms 417604 KB Output is correct
111 Correct 2907 ms 419492 KB Output is correct
112 Correct 3106 ms 422912 KB Output is correct
113 Correct 273 ms 191704 KB Output is correct
114 Correct 2496 ms 386696 KB Output is correct
115 Correct 3857 ms 484384 KB Output is correct
116 Correct 4252 ms 501104 KB Output is correct
117 Correct 4665 ms 520292 KB Output is correct
118 Correct 3526 ms 472576 KB Output is correct
119 Correct 562 ms 197284 KB Output is correct
120 Correct 802 ms 216072 KB Output is correct
121 Correct 1087 ms 245620 KB Output is correct
122 Correct 971 ms 222880 KB Output is correct
123 Correct 1391 ms 274848 KB Output is correct
124 Correct 1998 ms 366644 KB Output is correct
125 Correct 1317 ms 250472 KB Output is correct
126 Correct 2244 ms 412332 KB Output is correct