Submission #157129

# Submission time Handle Problem Language Result Execution time Memory
157129 2019-10-09T16:53:06 Z hentai_lover Segments (IZhO18_segments) C++14
75 / 100
5000 ms 11596 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define lft(x) x * 2
#define rgt(x) x * 2 + 1

#define tm hui_pizda
#define ft first
#define sd second
#define pb push_back
#define pf push_front
#define sz size()
#define cnt continue
#define m_p make_pair
#define fr(i, l, r) for(int i = l; i <= r; ++ i)
#define rf(i, r, l) for(int i = r; i >= l; -- i)
#define all(x) x.begin(), x.end()
//#pragma GCC optimize(-O3)
//#pragma GCC optimize(Ofast)
//#pragma GCC optimize("unroll-loops")

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using _set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;

typedef pair <ll, ll> pll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <pii> vpi;
typedef vector <pll> vpl;

mt19937_64 rnd(time(NULL));

const ll N = 1e6;
const ll mtrxN = 10;
const ll oo = 1e18 + 10;
const ll B = 500;
const ll mod = 1e9 + 7;
const ll B1 = 2500;
const ll B2 = 2500;


struct mtrx{
    ll m[mtrxN][mtrxN] = {};
};
mtrx mtrx_mult(mtrx a, mtrx b){
    mtrx c;
    fr(i, 0, mtrxN - 1){
        fr(j, 0, mtrxN - 1){
            ll sum = 0;
            fr(x, 0, mtrxN - 1){
                sum += a.m[i][x] * b.m[x][j];
                sum %= mod;
            }
            c.m[i][j] = sum;
        }
    }
    return c;
}
mtrx mtrx_pow(mtrx a, ll n){
    mtrx res;
    fr(i, 0, mtrxN - 1)fr(j, 0, mtrxN - 1)res.m[i][j] = a.m[i][j];
    n --;
    while(n){
        if(n&1)res = mtrx_mult(res, a);
        a = mtrx_mult(a, a);
        n >>= 1;
    }
    return res;
}
ll _pow(ll a, ll n){
    ll r = 1;
    while(n){
        if(n&1)r = r * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return r;
}
ll div(ll x, ll y, ll md){
    return x * _pow(y, md - 2) % md;
}

ll lastans, last = 1, n, t, i, a, b, k, l, r, now, usd[N], mn[N], mx[N];
vpl temp, sqd1, sqd2, deleted, aded;
vl sqd3, sqd4;
pll o[N];

ll cnv(ll a){
    return (t * lastans) ^ a;
}

ll get1(ll l, ll r, ll x){
    ll last = 0, ans = 0;
    for(ll i = B2; i < (ll)sqd1.sz; i += B2){
        if(mx[i] < l || mn[i] > r);
        else if(mn[i] < l && l <= mx[i] || mn[i] <= r && r < mx[i]){
            //посчитать вручную
            //cout << "last: " << last << " i: " << i << endl;
            fr(j, last, i - 1)
                if(sqd1[j].sd >= l && sqd1[j].sd <= r && sqd1[j].ft >= x)ans ++;
        }   else{
            ll pos = lower_bound(sqd3.begin() + last, sqd3.begin() + i, x) - sqd3.begin();
            ans += i - pos;
        }
        last = i;
    }
    fr(i, last, (ll)sqd1.sz - 1)
        if(sqd1[i].sd >= l && sqd1[i].sd <= r && sqd1[i].ft >= x)ans ++;
    return ans;
}

ll get2(ll l, ll r, ll x){
    ll last = 0, ans = 0;
    for(ll i = B2; i < (ll)sqd2.sz; i += B2){
        if(mx[i] < l || mn[i] > r);
        else if(mn[i] < l && l <= mx[i] || mn[i] <= r && r < mx[i]){
            //посчитать вручную
            fr(j, last, i - 1)
                if(sqd2[j].sd >= l && sqd2[j].sd <= r && sqd2[j].ft >= x)ans ++;
        }   else{
            ll pos = lower_bound(sqd4.begin() + last, sqd4.begin() + i, x) - sqd4.begin();
            ans += i - pos;
        }
        last = i;
    }
    fr(i, last, (ll)sqd2.sz - 1)
        if(sqd2[i].sd >= l && sqd2[i].sd <= r && sqd2[i].ft >= x)ans ++;
    return ans;
}

int main(){
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n >> t;
    fr(tr, 1, n){
        cin >> i;
        if(i == 1){
            cin >> a >> b;
            l = cnv(a);
            r = cnv(b);
            if(l > r)swap(l, r);
            o[++ now] = {l, r};
            aded.pb({l, r});
        }
        if(i == 2){
            ll d;
            cin >> d;
            //удалить отрезок l..r
            usd[d] = 1;
            deleted.pb({o[d].ft, o[d].sd});
        }

        if(i == 3){
            cin >> a >> b >> k;
            l = cnv(a);
            r = cnv(b);
            if(l > r)swap(l, r);

            //(кол-во чисел с li 1..l - 1 и ri >= l + k - 1) + (кол-во чисел с li l..r - k + 1 и ri - li + 1)

            //пройтись по накопленному вектору отрезков

            lastans = 0;
            for(auto i : aded)
                if(i.ft < l && i.sd >= l + k - 1 || i.ft >= l && i.ft <= r - k + 1 && i.sd - i.ft + 1 >= k)lastans ++;
            for(auto i : deleted)
                if(i.ft < l && i.sd >= l + k - 1 || i.ft >= l && i.ft <= r - k + 1 && i.sd - i.ft + 1 >= k)lastans --;


            //взять ответ из посчитанной ранее sqrtdecompompozition
            lastans += get1(1, l - 1, l + k - 1);
            lastans += get2(l, r - k + 1, k);
//            cout << "                 ";
            cout << lastans << "\n";
        }

        if(tr % B1 == 0){
            temp.clear();
            fr(i, 1, now){
                if(usd[i])cnt;
                temp.pb(o[i]);
            }
            sort(temp.begin(), temp.end());
            vpl temp2, temp3;
            aded.clear();
            deleted.clear();
            sqd1.clear();
            sqd2.clear();
            sqd3.clear();
            sqd4.clear();

            ll n = oo, x = -oo;
            fr(i, 0, (ll)temp.sz - 1){

                if(i != 0 && i % B2 == 0){
                    mn[i] = n, mx[i] = x;
                    sort(temp2.begin(), temp2.end());
                    sort(temp3.begin(), temp3.end());
                    for(auto i : temp2)sqd1.pb(i), sqd3.pb(i.ft);
                    for(auto i : temp3)sqd2.pb(i), sqd4.pb(i.ft);
                    n = oo, x = -oo;
                    temp2.clear();
                    temp3.clear();
                }
                temp2.pb({temp[i].sd, temp[i].ft});
                temp3.pb({temp[i].sd - temp[i].ft + 1, temp[i].ft});
                n = min(n, temp[i].ft);
                x = max(x, temp[i].ft);
            }
            sort(temp2.begin(), temp2.end());
            sort(temp3.begin(), temp3.end());
            for(auto i : temp2)sqd1.pb(i), sqd3.pb(i.ft);
            for(auto i : temp3)sqd2.pb(i), sqd4.pb(i.ft);

            last = now + 1;
        }
    }
    return 0;
}
/*

*/

Compilation message

segments.cpp: In function 'll get1(ll, ll, ll)':
segments.cpp:103:27: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
         else if(mn[i] < l && l <= mx[i] || mn[i] <= r && r < mx[i]){
                 ~~~~~~~~~~^~~~~~~~~~~~~
segments.cpp: In function 'll get2(ll, ll, ll)':
segments.cpp:123:27: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
         else if(mn[i] < l && l <= mx[i] || mn[i] <= r && r < mx[i]){
                 ~~~~~~~~~~^~~~~~~~~~~~~
segments.cpp: In function 'int main()':
segments.cpp:171:29: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
                 if(i.ft < l && i.sd >= l + k - 1 || i.ft >= l && i.ft <= r - k + 1 && i.sd - i.ft + 1 >= k)lastans ++;
                    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
segments.cpp:173:29: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
                 if(i.ft < l && i.sd >= l + k - 1 || i.ft >= l && i.ft <= r - k + 1 && i.sd - i.ft + 1 >= k)lastans --;
                    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 14 ms 504 KB Output is correct
4 Correct 14 ms 504 KB Output is correct
5 Correct 30 ms 1020 KB Output is correct
6 Correct 39 ms 888 KB Output is correct
7 Correct 19 ms 632 KB Output is correct
8 Correct 24 ms 1016 KB Output is correct
9 Correct 21 ms 1016 KB Output is correct
10 Correct 11 ms 1016 KB Output is correct
11 Correct 53 ms 1016 KB Output is correct
12 Correct 50 ms 888 KB Output is correct
13 Correct 13 ms 1272 KB Output is correct
14 Correct 24 ms 888 KB Output is correct
15 Correct 14 ms 504 KB Output is correct
16 Correct 14 ms 504 KB Output is correct
17 Correct 22 ms 760 KB Output is correct
18 Correct 16 ms 1016 KB Output is correct
19 Correct 20 ms 760 KB Output is correct
20 Correct 21 ms 760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2127 ms 6680 KB Output is correct
2 Correct 2142 ms 6828 KB Output is correct
3 Correct 2116 ms 6936 KB Output is correct
4 Correct 2009 ms 7348 KB Output is correct
5 Correct 768 ms 10824 KB Output is correct
6 Correct 785 ms 11104 KB Output is correct
7 Correct 2132 ms 6972 KB Output is correct
8 Correct 2119 ms 6940 KB Output is correct
9 Correct 2121 ms 6872 KB Output is correct
10 Correct 2563 ms 4412 KB Output is correct
11 Correct 2520 ms 5192 KB Output is correct
12 Correct 1490 ms 9396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 274 ms 1948 KB Output is correct
2 Correct 250 ms 2000 KB Output is correct
3 Correct 338 ms 2140 KB Output is correct
4 Correct 257 ms 2740 KB Output is correct
5 Correct 1530 ms 9532 KB Output is correct
6 Correct 1799 ms 7612 KB Output is correct
7 Correct 1624 ms 9036 KB Output is correct
8 Correct 751 ms 11204 KB Output is correct
9 Correct 675 ms 11436 KB Output is correct
10 Correct 945 ms 8508 KB Output is correct
11 Correct 846 ms 3224 KB Output is correct
12 Correct 943 ms 9628 KB Output is correct
13 Correct 935 ms 7940 KB Output is correct
14 Correct 974 ms 5504 KB Output is correct
15 Correct 971 ms 5232 KB Output is correct
16 Correct 896 ms 4340 KB Output is correct
17 Correct 2175 ms 6936 KB Output is correct
18 Correct 2158 ms 6988 KB Output is correct
19 Correct 2181 ms 6864 KB Output is correct
20 Correct 2172 ms 6980 KB Output is correct
21 Correct 959 ms 3448 KB Output is correct
22 Correct 1123 ms 6432 KB Output is correct
23 Correct 1067 ms 7352 KB Output is correct
24 Correct 1159 ms 6592 KB Output is correct
25 Correct 388 ms 2620 KB Output is correct
26 Correct 253 ms 2524 KB Output is correct
27 Correct 280 ms 2552 KB Output is correct
28 Correct 263 ms 2680 KB Output is correct
29 Correct 1025 ms 7652 KB Output is correct
30 Correct 1076 ms 7688 KB Output is correct
31 Correct 668 ms 11592 KB Output is correct
32 Correct 948 ms 8664 KB Output is correct
33 Correct 950 ms 8340 KB Output is correct
34 Correct 937 ms 5092 KB Output is correct
35 Correct 980 ms 7384 KB Output is correct
36 Correct 891 ms 8528 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 250 ms 2072 KB Output is correct
2 Correct 261 ms 2712 KB Output is correct
3 Correct 253 ms 2600 KB Output is correct
4 Correct 274 ms 2532 KB Output is correct
5 Correct 1335 ms 9872 KB Output is correct
6 Correct 2457 ms 3576 KB Output is correct
7 Correct 1099 ms 10180 KB Output is correct
8 Correct 2409 ms 4384 KB Output is correct
9 Correct 1144 ms 6028 KB Output is correct
10 Correct 887 ms 9676 KB Output is correct
11 Correct 1090 ms 3836 KB Output is correct
12 Correct 607 ms 11596 KB Output is correct
13 Correct 960 ms 7740 KB Output is correct
14 Correct 984 ms 5676 KB Output is correct
15 Correct 673 ms 11232 KB Output is correct
16 Correct 927 ms 7880 KB Output is correct
17 Correct 2132 ms 6592 KB Output is correct
18 Correct 2158 ms 6840 KB Output is correct
19 Correct 2130 ms 6748 KB Output is correct
20 Correct 2130 ms 6680 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 14 ms 504 KB Output is correct
4 Correct 14 ms 504 KB Output is correct
5 Correct 30 ms 1020 KB Output is correct
6 Correct 39 ms 888 KB Output is correct
7 Correct 19 ms 632 KB Output is correct
8 Correct 24 ms 1016 KB Output is correct
9 Correct 21 ms 1016 KB Output is correct
10 Correct 11 ms 1016 KB Output is correct
11 Correct 53 ms 1016 KB Output is correct
12 Correct 50 ms 888 KB Output is correct
13 Correct 13 ms 1272 KB Output is correct
14 Correct 24 ms 888 KB Output is correct
15 Correct 14 ms 504 KB Output is correct
16 Correct 14 ms 504 KB Output is correct
17 Correct 22 ms 760 KB Output is correct
18 Correct 16 ms 1016 KB Output is correct
19 Correct 20 ms 760 KB Output is correct
20 Correct 21 ms 760 KB Output is correct
21 Correct 2127 ms 6680 KB Output is correct
22 Correct 2142 ms 6828 KB Output is correct
23 Correct 2116 ms 6936 KB Output is correct
24 Correct 2009 ms 7348 KB Output is correct
25 Correct 768 ms 10824 KB Output is correct
26 Correct 785 ms 11104 KB Output is correct
27 Correct 2132 ms 6972 KB Output is correct
28 Correct 2119 ms 6940 KB Output is correct
29 Correct 2121 ms 6872 KB Output is correct
30 Correct 2563 ms 4412 KB Output is correct
31 Correct 2520 ms 5192 KB Output is correct
32 Correct 1490 ms 9396 KB Output is correct
33 Correct 250 ms 2072 KB Output is correct
34 Correct 261 ms 2712 KB Output is correct
35 Correct 253 ms 2600 KB Output is correct
36 Correct 274 ms 2532 KB Output is correct
37 Correct 1335 ms 9872 KB Output is correct
38 Correct 2457 ms 3576 KB Output is correct
39 Correct 1099 ms 10180 KB Output is correct
40 Correct 2409 ms 4384 KB Output is correct
41 Correct 1144 ms 6028 KB Output is correct
42 Correct 887 ms 9676 KB Output is correct
43 Correct 1090 ms 3836 KB Output is correct
44 Correct 607 ms 11596 KB Output is correct
45 Correct 960 ms 7740 KB Output is correct
46 Correct 984 ms 5676 KB Output is correct
47 Correct 673 ms 11232 KB Output is correct
48 Correct 927 ms 7880 KB Output is correct
49 Correct 2132 ms 6592 KB Output is correct
50 Correct 2158 ms 6840 KB Output is correct
51 Correct 2130 ms 6748 KB Output is correct
52 Correct 2130 ms 6680 KB Output is correct
53 Correct 266 ms 2448 KB Output is correct
54 Correct 270 ms 2332 KB Output is correct
55 Correct 252 ms 2340 KB Output is correct
56 Correct 260 ms 2468 KB Output is correct
57 Correct 2441 ms 5140 KB Output is correct
58 Correct 2355 ms 2752 KB Output is correct
59 Correct 1761 ms 6844 KB Output is correct
60 Correct 2551 ms 2332 KB Output is correct
61 Correct 1024 ms 7340 KB Output is correct
62 Correct 729 ms 10440 KB Output is correct
63 Correct 649 ms 10984 KB Output is correct
64 Correct 863 ms 10564 KB Output is correct
65 Correct 973 ms 4036 KB Output is correct
66 Correct 972 ms 3580 KB Output is correct
67 Correct 891 ms 7724 KB Output is correct
68 Correct 987 ms 6516 KB Output is correct
69 Correct 2138 ms 6208 KB Output is correct
70 Correct 2136 ms 6208 KB Output is correct
71 Correct 2123 ms 6164 KB Output is correct
72 Correct 2125 ms 6132 KB Output is correct
73 Correct 1104 ms 4292 KB Output is correct
74 Correct 1076 ms 6620 KB Output is correct
75 Correct 574 ms 11244 KB Output is correct
76 Correct 642 ms 11024 KB Output is correct
77 Correct 258 ms 1788 KB Output is correct
78 Correct 254 ms 1980 KB Output is correct
79 Correct 269 ms 1912 KB Output is correct
80 Correct 255 ms 1824 KB Output is correct
81 Correct 1109 ms 6200 KB Output is correct
82 Correct 1176 ms 4440 KB Output is correct
83 Correct 1068 ms 3184 KB Output is correct
84 Correct 1083 ms 6292 KB Output is correct
85 Correct 903 ms 7804 KB Output is correct
86 Correct 888 ms 9060 KB Output is correct
87 Correct 1055 ms 5568 KB Output is correct
88 Correct 971 ms 3260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 14 ms 504 KB Output is correct
4 Correct 14 ms 504 KB Output is correct
5 Correct 30 ms 1020 KB Output is correct
6 Correct 39 ms 888 KB Output is correct
7 Correct 19 ms 632 KB Output is correct
8 Correct 24 ms 1016 KB Output is correct
9 Correct 21 ms 1016 KB Output is correct
10 Correct 11 ms 1016 KB Output is correct
11 Correct 53 ms 1016 KB Output is correct
12 Correct 50 ms 888 KB Output is correct
13 Correct 13 ms 1272 KB Output is correct
14 Correct 24 ms 888 KB Output is correct
15 Correct 14 ms 504 KB Output is correct
16 Correct 14 ms 504 KB Output is correct
17 Correct 22 ms 760 KB Output is correct
18 Correct 16 ms 1016 KB Output is correct
19 Correct 20 ms 760 KB Output is correct
20 Correct 21 ms 760 KB Output is correct
21 Correct 2127 ms 6680 KB Output is correct
22 Correct 2142 ms 6828 KB Output is correct
23 Correct 2116 ms 6936 KB Output is correct
24 Correct 2009 ms 7348 KB Output is correct
25 Correct 768 ms 10824 KB Output is correct
26 Correct 785 ms 11104 KB Output is correct
27 Correct 2132 ms 6972 KB Output is correct
28 Correct 2119 ms 6940 KB Output is correct
29 Correct 2121 ms 6872 KB Output is correct
30 Correct 2563 ms 4412 KB Output is correct
31 Correct 2520 ms 5192 KB Output is correct
32 Correct 1490 ms 9396 KB Output is correct
33 Correct 274 ms 1948 KB Output is correct
34 Correct 250 ms 2000 KB Output is correct
35 Correct 338 ms 2140 KB Output is correct
36 Correct 257 ms 2740 KB Output is correct
37 Correct 1530 ms 9532 KB Output is correct
38 Correct 1799 ms 7612 KB Output is correct
39 Correct 1624 ms 9036 KB Output is correct
40 Correct 751 ms 11204 KB Output is correct
41 Correct 675 ms 11436 KB Output is correct
42 Correct 945 ms 8508 KB Output is correct
43 Correct 846 ms 3224 KB Output is correct
44 Correct 943 ms 9628 KB Output is correct
45 Correct 935 ms 7940 KB Output is correct
46 Correct 974 ms 5504 KB Output is correct
47 Correct 971 ms 5232 KB Output is correct
48 Correct 896 ms 4340 KB Output is correct
49 Correct 2175 ms 6936 KB Output is correct
50 Correct 2158 ms 6988 KB Output is correct
51 Correct 2181 ms 6864 KB Output is correct
52 Correct 2172 ms 6980 KB Output is correct
53 Correct 959 ms 3448 KB Output is correct
54 Correct 1123 ms 6432 KB Output is correct
55 Correct 1067 ms 7352 KB Output is correct
56 Correct 1159 ms 6592 KB Output is correct
57 Correct 388 ms 2620 KB Output is correct
58 Correct 253 ms 2524 KB Output is correct
59 Correct 280 ms 2552 KB Output is correct
60 Correct 263 ms 2680 KB Output is correct
61 Correct 1025 ms 7652 KB Output is correct
62 Correct 1076 ms 7688 KB Output is correct
63 Correct 668 ms 11592 KB Output is correct
64 Correct 948 ms 8664 KB Output is correct
65 Correct 950 ms 8340 KB Output is correct
66 Correct 937 ms 5092 KB Output is correct
67 Correct 980 ms 7384 KB Output is correct
68 Correct 891 ms 8528 KB Output is correct
69 Correct 250 ms 2072 KB Output is correct
70 Correct 261 ms 2712 KB Output is correct
71 Correct 253 ms 2600 KB Output is correct
72 Correct 274 ms 2532 KB Output is correct
73 Correct 1335 ms 9872 KB Output is correct
74 Correct 2457 ms 3576 KB Output is correct
75 Correct 1099 ms 10180 KB Output is correct
76 Correct 2409 ms 4384 KB Output is correct
77 Correct 1144 ms 6028 KB Output is correct
78 Correct 887 ms 9676 KB Output is correct
79 Correct 1090 ms 3836 KB Output is correct
80 Correct 607 ms 11596 KB Output is correct
81 Correct 960 ms 7740 KB Output is correct
82 Correct 984 ms 5676 KB Output is correct
83 Correct 673 ms 11232 KB Output is correct
84 Correct 927 ms 7880 KB Output is correct
85 Correct 2132 ms 6592 KB Output is correct
86 Correct 2158 ms 6840 KB Output is correct
87 Correct 2130 ms 6748 KB Output is correct
88 Correct 2130 ms 6680 KB Output is correct
89 Correct 266 ms 2448 KB Output is correct
90 Correct 270 ms 2332 KB Output is correct
91 Correct 252 ms 2340 KB Output is correct
92 Correct 260 ms 2468 KB Output is correct
93 Correct 2441 ms 5140 KB Output is correct
94 Correct 2355 ms 2752 KB Output is correct
95 Correct 1761 ms 6844 KB Output is correct
96 Correct 2551 ms 2332 KB Output is correct
97 Correct 1024 ms 7340 KB Output is correct
98 Correct 729 ms 10440 KB Output is correct
99 Correct 649 ms 10984 KB Output is correct
100 Correct 863 ms 10564 KB Output is correct
101 Correct 973 ms 4036 KB Output is correct
102 Correct 972 ms 3580 KB Output is correct
103 Correct 891 ms 7724 KB Output is correct
104 Correct 987 ms 6516 KB Output is correct
105 Correct 2138 ms 6208 KB Output is correct
106 Correct 2136 ms 6208 KB Output is correct
107 Correct 2123 ms 6164 KB Output is correct
108 Correct 2125 ms 6132 KB Output is correct
109 Correct 1104 ms 4292 KB Output is correct
110 Correct 1076 ms 6620 KB Output is correct
111 Correct 574 ms 11244 KB Output is correct
112 Correct 642 ms 11024 KB Output is correct
113 Correct 258 ms 1788 KB Output is correct
114 Correct 254 ms 1980 KB Output is correct
115 Correct 269 ms 1912 KB Output is correct
116 Correct 255 ms 1824 KB Output is correct
117 Correct 1109 ms 6200 KB Output is correct
118 Correct 1176 ms 4440 KB Output is correct
119 Correct 1068 ms 3184 KB Output is correct
120 Correct 1083 ms 6292 KB Output is correct
121 Correct 903 ms 7804 KB Output is correct
122 Correct 888 ms 9060 KB Output is correct
123 Correct 1055 ms 5568 KB Output is correct
124 Correct 971 ms 3260 KB Output is correct
125 Correct 534 ms 2796 KB Output is correct
126 Correct 546 ms 2860 KB Output is correct
127 Correct 618 ms 2820 KB Output is correct
128 Correct 559 ms 2824 KB Output is correct
129 Correct 514 ms 2716 KB Output is correct
130 Correct 574 ms 2872 KB Output is correct
131 Execution timed out 5083 ms 4000 KB Time limit exceeded
132 Halted 0 ms 0 KB -