#include <iostream>
#include <vector>
using namespace std;
using vi = vector<int>;
using ll = long long;
using vll = vector<ll>;
const int mx = 250'000;
const ll INF = 1'000'000'000'000'000'000LL;
vi L(1+mx), R(1+mx), C(1+mx), A(1+mx);
vll K(1+mx), B(1+mx);
vi T(1+mx);
vi st[1+mx], en[1+mx], qr[1+mx];
vi ans(1+mx, 0);
struct segtree
{
int l;
int r;
pair<ll, int> mn;
ll lp = 0;
segtree* left = NULL;
segtree* right = NULL;
segtree()
{
;
}
segtree(int L, int R)
{
l = L;
r = R;
mn = {0, l};
if(l == r) return;
int m = (l+r)/2;
left = new segtree(l, m);
right = new segtree(m+1, r);
}
void add(int L, int R, ll V)
{
if(r < L || R < l) return;
else if(L <= l && r <= R)
{
lp += V;
mn.first += V;
}
else
{
left->add(L, R, V);
right->add(L, R, V);
mn = min(left->mn, right->mn);
mn.first += lp;
}
}
pair<ll, int> rangemin(int L, int R)
{
if(R < l || r < L) return {INF, -1};
else if(L <= l && r <= R) return mn;
else
{
auto res = min(left->rangemin(L, R), right->rangemin(L, R));
res.first += lp;
return res;
}
}
};
struct BIT
{
int Z;
vll arr;
BIT()
{
;
}
BIT(int z)
{
Z = z;
arr = vll(1+z, 0);
}
void add(int i, ll v)
{
for(int j = i; j <= Z; j += j&-j)
arr[j] += v;
}
ll prefsum(int i)
{
ll ans = 0;
for(int j = i; j >= 1; j -= j&-j)
ans += arr[j];
return ans;
}
};
int main()
{
int N, M, Q;
cin >> N >> M >> Q;
for(int j = 1; j <= Q; j++)
{
cin >> T[j];
if(T[j] == 1) cin >> L[j] >> R[j] >> C[j] >> K[j];
else if(T[j] == 2)
{
cin >> L[j] >> R[j] >> K[j];
K[j] *= -1;
}
else cin >> A[j] >> B[j];
if(T[j] <= 2)
{
st[L[j]].push_back(j);
en[R[j]].push_back(j);
}
else qr[A[j]].push_back(j);
}
vll S(1+Q, 0);
vi ans(1+Q, 0);
segtree ST(0, Q);
BIT plus_sum(1+Q), minus_sum(1+Q);
for(int i = 1; i <= N; i++)
{
for(int o: st[i])
{
S[o] = K[o];
ST.add(o, Q, +K[o]);
if(K[o] > 0)
plus_sum.add(o, +K[o]);
else
minus_sum.add(o, -K[o]);
}
for(int q: qr[i])
{
int p = ST.rangemin(0, q-1).second;
ll min_sum = minus_sum.prefsum(q) - minus_sum.prefsum(p);
// cerr << "p = " << p << '\n';
// cerr << "total loss = " << minus_sum << '\n';
ll plus_sub = plus_sum.prefsum(p);
int lo = p+1;
int hi = q+1;
while(lo != hi)
{
int mid = (lo+hi)/2;
if(plus_sum.prefsum(mid) - plus_sub >= min_sum + B[q])
hi = mid;
else
lo = mid+1;
}
if(lo != q+1)
{
ans[q] = C[lo];
}
// ll plus_sum = 0;
// for(int j = p+1; j <= q; j++)
// {
// if(S[j] > 0)
// plus_sum += S[j];
//
// if(plus_sum >= min_sum + B[q])
// {
// ans[q] = C[j];
// break;
// }
// }
}
for(int o: en[i])
{
S[o] = 0;
ST.add(o, Q, -K[o]);
if(K[o] > 0)
plus_sum.add(o, -K[o]);
else
minus_sum.add(o, +K[o]);
}
}
for(int q = 1; q <= Q; q++)
if(T[q] == 3)
cout << ans[q] << '\n';
// cout << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
27980 KB |
Output is correct |
2 |
Correct |
15 ms |
27984 KB |
Output is correct |
3 |
Correct |
14 ms |
27952 KB |
Output is correct |
4 |
Correct |
18 ms |
28080 KB |
Output is correct |
5 |
Correct |
15 ms |
27948 KB |
Output is correct |
6 |
Correct |
15 ms |
27968 KB |
Output is correct |
7 |
Correct |
18 ms |
28028 KB |
Output is correct |
8 |
Correct |
16 ms |
28000 KB |
Output is correct |
9 |
Correct |
16 ms |
28080 KB |
Output is correct |
10 |
Correct |
15 ms |
27980 KB |
Output is correct |
11 |
Correct |
17 ms |
27980 KB |
Output is correct |
12 |
Correct |
16 ms |
27980 KB |
Output is correct |
13 |
Correct |
17 ms |
28008 KB |
Output is correct |
14 |
Correct |
15 ms |
27980 KB |
Output is correct |
15 |
Correct |
15 ms |
27852 KB |
Output is correct |
16 |
Correct |
17 ms |
27980 KB |
Output is correct |
17 |
Correct |
16 ms |
28032 KB |
Output is correct |
18 |
Correct |
15 ms |
28096 KB |
Output is correct |
19 |
Correct |
15 ms |
27980 KB |
Output is correct |
20 |
Correct |
16 ms |
28104 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
27980 KB |
Output is correct |
2 |
Correct |
15 ms |
27984 KB |
Output is correct |
3 |
Correct |
14 ms |
27952 KB |
Output is correct |
4 |
Correct |
18 ms |
28080 KB |
Output is correct |
5 |
Correct |
15 ms |
27948 KB |
Output is correct |
6 |
Correct |
15 ms |
27968 KB |
Output is correct |
7 |
Correct |
18 ms |
28028 KB |
Output is correct |
8 |
Correct |
16 ms |
28000 KB |
Output is correct |
9 |
Correct |
16 ms |
28080 KB |
Output is correct |
10 |
Correct |
15 ms |
27980 KB |
Output is correct |
11 |
Correct |
17 ms |
27980 KB |
Output is correct |
12 |
Correct |
16 ms |
27980 KB |
Output is correct |
13 |
Correct |
17 ms |
28008 KB |
Output is correct |
14 |
Correct |
15 ms |
27980 KB |
Output is correct |
15 |
Correct |
15 ms |
27852 KB |
Output is correct |
16 |
Correct |
17 ms |
27980 KB |
Output is correct |
17 |
Correct |
16 ms |
28032 KB |
Output is correct |
18 |
Correct |
15 ms |
28096 KB |
Output is correct |
19 |
Correct |
15 ms |
27980 KB |
Output is correct |
20 |
Correct |
16 ms |
28104 KB |
Output is correct |
21 |
Correct |
17 ms |
27980 KB |
Output is correct |
22 |
Correct |
17 ms |
28000 KB |
Output is correct |
23 |
Correct |
15 ms |
27960 KB |
Output is correct |
24 |
Correct |
16 ms |
27980 KB |
Output is correct |
25 |
Correct |
14 ms |
28012 KB |
Output is correct |
26 |
Correct |
15 ms |
27980 KB |
Output is correct |
27 |
Correct |
16 ms |
28096 KB |
Output is correct |
28 |
Correct |
16 ms |
28024 KB |
Output is correct |
29 |
Correct |
15 ms |
28032 KB |
Output is correct |
30 |
Correct |
17 ms |
28032 KB |
Output is correct |
31 |
Correct |
16 ms |
27980 KB |
Output is correct |
32 |
Correct |
17 ms |
28056 KB |
Output is correct |
33 |
Correct |
15 ms |
27960 KB |
Output is correct |
34 |
Correct |
17 ms |
27992 KB |
Output is correct |
35 |
Correct |
16 ms |
27980 KB |
Output is correct |
36 |
Correct |
19 ms |
28028 KB |
Output is correct |
37 |
Correct |
16 ms |
27896 KB |
Output is correct |
38 |
Correct |
16 ms |
28060 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
140 ms |
40088 KB |
Output is correct |
2 |
Correct |
166 ms |
40208 KB |
Output is correct |
3 |
Correct |
151 ms |
40152 KB |
Output is correct |
4 |
Correct |
148 ms |
40168 KB |
Output is correct |
5 |
Correct |
154 ms |
40200 KB |
Output is correct |
6 |
Correct |
143 ms |
40164 KB |
Output is correct |
7 |
Correct |
80 ms |
37432 KB |
Output is correct |
8 |
Correct |
81 ms |
37568 KB |
Output is correct |
9 |
Correct |
149 ms |
40128 KB |
Output is correct |
10 |
Correct |
159 ms |
40132 KB |
Output is correct |
11 |
Correct |
147 ms |
40072 KB |
Output is correct |
12 |
Correct |
156 ms |
40140 KB |
Output is correct |
13 |
Correct |
122 ms |
38704 KB |
Output is correct |
14 |
Correct |
144 ms |
40100 KB |
Output is correct |
15 |
Correct |
141 ms |
39664 KB |
Output is correct |
16 |
Correct |
163 ms |
40144 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
793 ms |
71368 KB |
Output is correct |
2 |
Correct |
557 ms |
67012 KB |
Output is correct |
3 |
Correct |
807 ms |
81212 KB |
Output is correct |
4 |
Correct |
573 ms |
66688 KB |
Output is correct |
5 |
Correct |
562 ms |
67048 KB |
Output is correct |
6 |
Correct |
790 ms |
80928 KB |
Output is correct |
7 |
Correct |
350 ms |
71780 KB |
Output is correct |
8 |
Correct |
356 ms |
71892 KB |
Output is correct |
9 |
Correct |
747 ms |
80568 KB |
Output is correct |
10 |
Correct |
779 ms |
80488 KB |
Output is correct |
11 |
Correct |
777 ms |
80568 KB |
Output is correct |
12 |
Correct |
743 ms |
80548 KB |
Output is correct |
13 |
Correct |
756 ms |
80564 KB |
Output is correct |
14 |
Correct |
765 ms |
80504 KB |
Output is correct |
15 |
Correct |
768 ms |
80476 KB |
Output is correct |
16 |
Correct |
753 ms |
80580 KB |
Output is correct |
17 |
Correct |
784 ms |
80448 KB |
Output is correct |
18 |
Correct |
826 ms |
80788 KB |
Output is correct |
19 |
Correct |
806 ms |
80544 KB |
Output is correct |
20 |
Correct |
770 ms |
80480 KB |
Output is correct |
21 |
Correct |
777 ms |
80452 KB |
Output is correct |
22 |
Correct |
761 ms |
80452 KB |
Output is correct |
23 |
Correct |
788 ms |
80580 KB |
Output is correct |
24 |
Correct |
768 ms |
80508 KB |
Output is correct |
25 |
Correct |
641 ms |
75264 KB |
Output is correct |
26 |
Correct |
648 ms |
76180 KB |
Output is correct |
27 |
Correct |
586 ms |
82780 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
27980 KB |
Output is correct |
2 |
Correct |
15 ms |
27984 KB |
Output is correct |
3 |
Correct |
14 ms |
27952 KB |
Output is correct |
4 |
Correct |
18 ms |
28080 KB |
Output is correct |
5 |
Correct |
15 ms |
27948 KB |
Output is correct |
6 |
Correct |
15 ms |
27968 KB |
Output is correct |
7 |
Correct |
18 ms |
28028 KB |
Output is correct |
8 |
Correct |
16 ms |
28000 KB |
Output is correct |
9 |
Correct |
16 ms |
28080 KB |
Output is correct |
10 |
Correct |
15 ms |
27980 KB |
Output is correct |
11 |
Correct |
17 ms |
27980 KB |
Output is correct |
12 |
Correct |
16 ms |
27980 KB |
Output is correct |
13 |
Correct |
17 ms |
28008 KB |
Output is correct |
14 |
Correct |
15 ms |
27980 KB |
Output is correct |
15 |
Correct |
15 ms |
27852 KB |
Output is correct |
16 |
Correct |
17 ms |
27980 KB |
Output is correct |
17 |
Correct |
16 ms |
28032 KB |
Output is correct |
18 |
Correct |
15 ms |
28096 KB |
Output is correct |
19 |
Correct |
15 ms |
27980 KB |
Output is correct |
20 |
Correct |
16 ms |
28104 KB |
Output is correct |
21 |
Correct |
140 ms |
40088 KB |
Output is correct |
22 |
Correct |
166 ms |
40208 KB |
Output is correct |
23 |
Correct |
151 ms |
40152 KB |
Output is correct |
24 |
Correct |
148 ms |
40168 KB |
Output is correct |
25 |
Correct |
154 ms |
40200 KB |
Output is correct |
26 |
Correct |
143 ms |
40164 KB |
Output is correct |
27 |
Correct |
80 ms |
37432 KB |
Output is correct |
28 |
Correct |
81 ms |
37568 KB |
Output is correct |
29 |
Correct |
149 ms |
40128 KB |
Output is correct |
30 |
Correct |
159 ms |
40132 KB |
Output is correct |
31 |
Correct |
147 ms |
40072 KB |
Output is correct |
32 |
Correct |
156 ms |
40140 KB |
Output is correct |
33 |
Correct |
122 ms |
38704 KB |
Output is correct |
34 |
Correct |
144 ms |
40100 KB |
Output is correct |
35 |
Correct |
141 ms |
39664 KB |
Output is correct |
36 |
Correct |
163 ms |
40144 KB |
Output is correct |
37 |
Correct |
141 ms |
39048 KB |
Output is correct |
38 |
Correct |
127 ms |
37840 KB |
Output is correct |
39 |
Correct |
73 ms |
36456 KB |
Output is correct |
40 |
Correct |
82 ms |
37672 KB |
Output is correct |
41 |
Correct |
157 ms |
40080 KB |
Output is correct |
42 |
Correct |
159 ms |
40144 KB |
Output is correct |
43 |
Correct |
161 ms |
40112 KB |
Output is correct |
44 |
Correct |
158 ms |
40112 KB |
Output is correct |
45 |
Correct |
153 ms |
40012 KB |
Output is correct |
46 |
Correct |
167 ms |
40004 KB |
Output is correct |
47 |
Correct |
108 ms |
38912 KB |
Output is correct |
48 |
Correct |
137 ms |
39108 KB |
Output is correct |
49 |
Correct |
113 ms |
36664 KB |
Output is correct |
50 |
Correct |
129 ms |
38400 KB |
Output is correct |
51 |
Correct |
155 ms |
40204 KB |
Output is correct |
52 |
Correct |
174 ms |
40192 KB |
Output is correct |
53 |
Correct |
121 ms |
37812 KB |
Output is correct |
54 |
Correct |
154 ms |
40432 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
160 ms |
39168 KB |
Output is correct |
2 |
Correct |
165 ms |
40060 KB |
Output is correct |
3 |
Correct |
185 ms |
40376 KB |
Output is correct |
4 |
Correct |
125 ms |
36676 KB |
Output is correct |
5 |
Correct |
152 ms |
38636 KB |
Output is correct |
6 |
Correct |
168 ms |
40132 KB |
Output is correct |
7 |
Correct |
96 ms |
37316 KB |
Output is correct |
8 |
Correct |
88 ms |
36732 KB |
Output is correct |
9 |
Correct |
130 ms |
39108 KB |
Output is correct |
10 |
Correct |
106 ms |
35756 KB |
Output is correct |
11 |
Correct |
149 ms |
39280 KB |
Output is correct |
12 |
Correct |
149 ms |
39236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
27980 KB |
Output is correct |
2 |
Correct |
15 ms |
27984 KB |
Output is correct |
3 |
Correct |
14 ms |
27952 KB |
Output is correct |
4 |
Correct |
18 ms |
28080 KB |
Output is correct |
5 |
Correct |
15 ms |
27948 KB |
Output is correct |
6 |
Correct |
15 ms |
27968 KB |
Output is correct |
7 |
Correct |
18 ms |
28028 KB |
Output is correct |
8 |
Correct |
16 ms |
28000 KB |
Output is correct |
9 |
Correct |
16 ms |
28080 KB |
Output is correct |
10 |
Correct |
15 ms |
27980 KB |
Output is correct |
11 |
Correct |
17 ms |
27980 KB |
Output is correct |
12 |
Correct |
16 ms |
27980 KB |
Output is correct |
13 |
Correct |
17 ms |
28008 KB |
Output is correct |
14 |
Correct |
15 ms |
27980 KB |
Output is correct |
15 |
Correct |
15 ms |
27852 KB |
Output is correct |
16 |
Correct |
17 ms |
27980 KB |
Output is correct |
17 |
Correct |
16 ms |
28032 KB |
Output is correct |
18 |
Correct |
15 ms |
28096 KB |
Output is correct |
19 |
Correct |
15 ms |
27980 KB |
Output is correct |
20 |
Correct |
16 ms |
28104 KB |
Output is correct |
21 |
Correct |
17 ms |
27980 KB |
Output is correct |
22 |
Correct |
17 ms |
28000 KB |
Output is correct |
23 |
Correct |
15 ms |
27960 KB |
Output is correct |
24 |
Correct |
16 ms |
27980 KB |
Output is correct |
25 |
Correct |
14 ms |
28012 KB |
Output is correct |
26 |
Correct |
15 ms |
27980 KB |
Output is correct |
27 |
Correct |
16 ms |
28096 KB |
Output is correct |
28 |
Correct |
16 ms |
28024 KB |
Output is correct |
29 |
Correct |
15 ms |
28032 KB |
Output is correct |
30 |
Correct |
17 ms |
28032 KB |
Output is correct |
31 |
Correct |
16 ms |
27980 KB |
Output is correct |
32 |
Correct |
17 ms |
28056 KB |
Output is correct |
33 |
Correct |
15 ms |
27960 KB |
Output is correct |
34 |
Correct |
17 ms |
27992 KB |
Output is correct |
35 |
Correct |
16 ms |
27980 KB |
Output is correct |
36 |
Correct |
19 ms |
28028 KB |
Output is correct |
37 |
Correct |
16 ms |
27896 KB |
Output is correct |
38 |
Correct |
16 ms |
28060 KB |
Output is correct |
39 |
Correct |
140 ms |
40088 KB |
Output is correct |
40 |
Correct |
166 ms |
40208 KB |
Output is correct |
41 |
Correct |
151 ms |
40152 KB |
Output is correct |
42 |
Correct |
148 ms |
40168 KB |
Output is correct |
43 |
Correct |
154 ms |
40200 KB |
Output is correct |
44 |
Correct |
143 ms |
40164 KB |
Output is correct |
45 |
Correct |
80 ms |
37432 KB |
Output is correct |
46 |
Correct |
81 ms |
37568 KB |
Output is correct |
47 |
Correct |
149 ms |
40128 KB |
Output is correct |
48 |
Correct |
159 ms |
40132 KB |
Output is correct |
49 |
Correct |
147 ms |
40072 KB |
Output is correct |
50 |
Correct |
156 ms |
40140 KB |
Output is correct |
51 |
Correct |
122 ms |
38704 KB |
Output is correct |
52 |
Correct |
144 ms |
40100 KB |
Output is correct |
53 |
Correct |
141 ms |
39664 KB |
Output is correct |
54 |
Correct |
163 ms |
40144 KB |
Output is correct |
55 |
Correct |
141 ms |
39048 KB |
Output is correct |
56 |
Correct |
127 ms |
37840 KB |
Output is correct |
57 |
Correct |
73 ms |
36456 KB |
Output is correct |
58 |
Correct |
82 ms |
37672 KB |
Output is correct |
59 |
Correct |
157 ms |
40080 KB |
Output is correct |
60 |
Correct |
159 ms |
40144 KB |
Output is correct |
61 |
Correct |
161 ms |
40112 KB |
Output is correct |
62 |
Correct |
158 ms |
40112 KB |
Output is correct |
63 |
Correct |
153 ms |
40012 KB |
Output is correct |
64 |
Correct |
167 ms |
40004 KB |
Output is correct |
65 |
Correct |
108 ms |
38912 KB |
Output is correct |
66 |
Correct |
137 ms |
39108 KB |
Output is correct |
67 |
Correct |
113 ms |
36664 KB |
Output is correct |
68 |
Correct |
129 ms |
38400 KB |
Output is correct |
69 |
Correct |
155 ms |
40204 KB |
Output is correct |
70 |
Correct |
174 ms |
40192 KB |
Output is correct |
71 |
Correct |
121 ms |
37812 KB |
Output is correct |
72 |
Correct |
154 ms |
40432 KB |
Output is correct |
73 |
Correct |
160 ms |
39168 KB |
Output is correct |
74 |
Correct |
165 ms |
40060 KB |
Output is correct |
75 |
Correct |
185 ms |
40376 KB |
Output is correct |
76 |
Correct |
125 ms |
36676 KB |
Output is correct |
77 |
Correct |
152 ms |
38636 KB |
Output is correct |
78 |
Correct |
168 ms |
40132 KB |
Output is correct |
79 |
Correct |
96 ms |
37316 KB |
Output is correct |
80 |
Correct |
88 ms |
36732 KB |
Output is correct |
81 |
Correct |
130 ms |
39108 KB |
Output is correct |
82 |
Correct |
106 ms |
35756 KB |
Output is correct |
83 |
Correct |
149 ms |
39280 KB |
Output is correct |
84 |
Correct |
149 ms |
39236 KB |
Output is correct |
85 |
Correct |
155 ms |
39124 KB |
Output is correct |
86 |
Correct |
174 ms |
40416 KB |
Output is correct |
87 |
Correct |
151 ms |
38724 KB |
Output is correct |
88 |
Correct |
175 ms |
40300 KB |
Output is correct |
89 |
Correct |
119 ms |
36264 KB |
Output is correct |
90 |
Correct |
175 ms |
40140 KB |
Output is correct |
91 |
Correct |
139 ms |
37888 KB |
Output is correct |
92 |
Correct |
133 ms |
37444 KB |
Output is correct |
93 |
Correct |
174 ms |
40192 KB |
Output is correct |
94 |
Correct |
182 ms |
40156 KB |
Output is correct |
95 |
Correct |
166 ms |
39924 KB |
Output is correct |
96 |
Correct |
175 ms |
40260 KB |
Output is correct |
97 |
Correct |
181 ms |
40192 KB |
Output is correct |
98 |
Correct |
145 ms |
38244 KB |
Output is correct |
99 |
Correct |
125 ms |
38864 KB |
Output is correct |
100 |
Correct |
134 ms |
37484 KB |
Output is correct |
101 |
Correct |
158 ms |
39176 KB |
Output is correct |
102 |
Correct |
145 ms |
40900 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
27980 KB |
Output is correct |
2 |
Correct |
15 ms |
27984 KB |
Output is correct |
3 |
Correct |
14 ms |
27952 KB |
Output is correct |
4 |
Correct |
18 ms |
28080 KB |
Output is correct |
5 |
Correct |
15 ms |
27948 KB |
Output is correct |
6 |
Correct |
15 ms |
27968 KB |
Output is correct |
7 |
Correct |
18 ms |
28028 KB |
Output is correct |
8 |
Correct |
16 ms |
28000 KB |
Output is correct |
9 |
Correct |
16 ms |
28080 KB |
Output is correct |
10 |
Correct |
15 ms |
27980 KB |
Output is correct |
11 |
Correct |
17 ms |
27980 KB |
Output is correct |
12 |
Correct |
16 ms |
27980 KB |
Output is correct |
13 |
Correct |
17 ms |
28008 KB |
Output is correct |
14 |
Correct |
15 ms |
27980 KB |
Output is correct |
15 |
Correct |
15 ms |
27852 KB |
Output is correct |
16 |
Correct |
17 ms |
27980 KB |
Output is correct |
17 |
Correct |
16 ms |
28032 KB |
Output is correct |
18 |
Correct |
15 ms |
28096 KB |
Output is correct |
19 |
Correct |
15 ms |
27980 KB |
Output is correct |
20 |
Correct |
16 ms |
28104 KB |
Output is correct |
21 |
Correct |
17 ms |
27980 KB |
Output is correct |
22 |
Correct |
17 ms |
28000 KB |
Output is correct |
23 |
Correct |
15 ms |
27960 KB |
Output is correct |
24 |
Correct |
16 ms |
27980 KB |
Output is correct |
25 |
Correct |
14 ms |
28012 KB |
Output is correct |
26 |
Correct |
15 ms |
27980 KB |
Output is correct |
27 |
Correct |
16 ms |
28096 KB |
Output is correct |
28 |
Correct |
16 ms |
28024 KB |
Output is correct |
29 |
Correct |
15 ms |
28032 KB |
Output is correct |
30 |
Correct |
17 ms |
28032 KB |
Output is correct |
31 |
Correct |
16 ms |
27980 KB |
Output is correct |
32 |
Correct |
17 ms |
28056 KB |
Output is correct |
33 |
Correct |
15 ms |
27960 KB |
Output is correct |
34 |
Correct |
17 ms |
27992 KB |
Output is correct |
35 |
Correct |
16 ms |
27980 KB |
Output is correct |
36 |
Correct |
19 ms |
28028 KB |
Output is correct |
37 |
Correct |
16 ms |
27896 KB |
Output is correct |
38 |
Correct |
16 ms |
28060 KB |
Output is correct |
39 |
Correct |
140 ms |
40088 KB |
Output is correct |
40 |
Correct |
166 ms |
40208 KB |
Output is correct |
41 |
Correct |
151 ms |
40152 KB |
Output is correct |
42 |
Correct |
148 ms |
40168 KB |
Output is correct |
43 |
Correct |
154 ms |
40200 KB |
Output is correct |
44 |
Correct |
143 ms |
40164 KB |
Output is correct |
45 |
Correct |
80 ms |
37432 KB |
Output is correct |
46 |
Correct |
81 ms |
37568 KB |
Output is correct |
47 |
Correct |
149 ms |
40128 KB |
Output is correct |
48 |
Correct |
159 ms |
40132 KB |
Output is correct |
49 |
Correct |
147 ms |
40072 KB |
Output is correct |
50 |
Correct |
156 ms |
40140 KB |
Output is correct |
51 |
Correct |
122 ms |
38704 KB |
Output is correct |
52 |
Correct |
144 ms |
40100 KB |
Output is correct |
53 |
Correct |
141 ms |
39664 KB |
Output is correct |
54 |
Correct |
163 ms |
40144 KB |
Output is correct |
55 |
Correct |
793 ms |
71368 KB |
Output is correct |
56 |
Correct |
557 ms |
67012 KB |
Output is correct |
57 |
Correct |
807 ms |
81212 KB |
Output is correct |
58 |
Correct |
573 ms |
66688 KB |
Output is correct |
59 |
Correct |
562 ms |
67048 KB |
Output is correct |
60 |
Correct |
790 ms |
80928 KB |
Output is correct |
61 |
Correct |
350 ms |
71780 KB |
Output is correct |
62 |
Correct |
356 ms |
71892 KB |
Output is correct |
63 |
Correct |
747 ms |
80568 KB |
Output is correct |
64 |
Correct |
779 ms |
80488 KB |
Output is correct |
65 |
Correct |
777 ms |
80568 KB |
Output is correct |
66 |
Correct |
743 ms |
80548 KB |
Output is correct |
67 |
Correct |
756 ms |
80564 KB |
Output is correct |
68 |
Correct |
765 ms |
80504 KB |
Output is correct |
69 |
Correct |
768 ms |
80476 KB |
Output is correct |
70 |
Correct |
753 ms |
80580 KB |
Output is correct |
71 |
Correct |
784 ms |
80448 KB |
Output is correct |
72 |
Correct |
826 ms |
80788 KB |
Output is correct |
73 |
Correct |
806 ms |
80544 KB |
Output is correct |
74 |
Correct |
770 ms |
80480 KB |
Output is correct |
75 |
Correct |
777 ms |
80452 KB |
Output is correct |
76 |
Correct |
761 ms |
80452 KB |
Output is correct |
77 |
Correct |
788 ms |
80580 KB |
Output is correct |
78 |
Correct |
768 ms |
80508 KB |
Output is correct |
79 |
Correct |
641 ms |
75264 KB |
Output is correct |
80 |
Correct |
648 ms |
76180 KB |
Output is correct |
81 |
Correct |
586 ms |
82780 KB |
Output is correct |
82 |
Correct |
141 ms |
39048 KB |
Output is correct |
83 |
Correct |
127 ms |
37840 KB |
Output is correct |
84 |
Correct |
73 ms |
36456 KB |
Output is correct |
85 |
Correct |
82 ms |
37672 KB |
Output is correct |
86 |
Correct |
157 ms |
40080 KB |
Output is correct |
87 |
Correct |
159 ms |
40144 KB |
Output is correct |
88 |
Correct |
161 ms |
40112 KB |
Output is correct |
89 |
Correct |
158 ms |
40112 KB |
Output is correct |
90 |
Correct |
153 ms |
40012 KB |
Output is correct |
91 |
Correct |
167 ms |
40004 KB |
Output is correct |
92 |
Correct |
108 ms |
38912 KB |
Output is correct |
93 |
Correct |
137 ms |
39108 KB |
Output is correct |
94 |
Correct |
113 ms |
36664 KB |
Output is correct |
95 |
Correct |
129 ms |
38400 KB |
Output is correct |
96 |
Correct |
155 ms |
40204 KB |
Output is correct |
97 |
Correct |
174 ms |
40192 KB |
Output is correct |
98 |
Correct |
121 ms |
37812 KB |
Output is correct |
99 |
Correct |
154 ms |
40432 KB |
Output is correct |
100 |
Correct |
160 ms |
39168 KB |
Output is correct |
101 |
Correct |
165 ms |
40060 KB |
Output is correct |
102 |
Correct |
185 ms |
40376 KB |
Output is correct |
103 |
Correct |
125 ms |
36676 KB |
Output is correct |
104 |
Correct |
152 ms |
38636 KB |
Output is correct |
105 |
Correct |
168 ms |
40132 KB |
Output is correct |
106 |
Correct |
96 ms |
37316 KB |
Output is correct |
107 |
Correct |
88 ms |
36732 KB |
Output is correct |
108 |
Correct |
130 ms |
39108 KB |
Output is correct |
109 |
Correct |
106 ms |
35756 KB |
Output is correct |
110 |
Correct |
149 ms |
39280 KB |
Output is correct |
111 |
Correct |
149 ms |
39236 KB |
Output is correct |
112 |
Correct |
155 ms |
39124 KB |
Output is correct |
113 |
Correct |
174 ms |
40416 KB |
Output is correct |
114 |
Correct |
151 ms |
38724 KB |
Output is correct |
115 |
Correct |
175 ms |
40300 KB |
Output is correct |
116 |
Correct |
119 ms |
36264 KB |
Output is correct |
117 |
Correct |
175 ms |
40140 KB |
Output is correct |
118 |
Correct |
139 ms |
37888 KB |
Output is correct |
119 |
Correct |
133 ms |
37444 KB |
Output is correct |
120 |
Correct |
174 ms |
40192 KB |
Output is correct |
121 |
Correct |
182 ms |
40156 KB |
Output is correct |
122 |
Correct |
166 ms |
39924 KB |
Output is correct |
123 |
Correct |
175 ms |
40260 KB |
Output is correct |
124 |
Correct |
181 ms |
40192 KB |
Output is correct |
125 |
Correct |
145 ms |
38244 KB |
Output is correct |
126 |
Correct |
125 ms |
38864 KB |
Output is correct |
127 |
Correct |
134 ms |
37484 KB |
Output is correct |
128 |
Correct |
158 ms |
39176 KB |
Output is correct |
129 |
Correct |
145 ms |
40900 KB |
Output is correct |
130 |
Correct |
823 ms |
81788 KB |
Output is correct |
131 |
Correct |
539 ms |
67056 KB |
Output is correct |
132 |
Correct |
802 ms |
81800 KB |
Output is correct |
133 |
Correct |
786 ms |
79292 KB |
Output is correct |
134 |
Correct |
675 ms |
73920 KB |
Output is correct |
135 |
Correct |
804 ms |
81724 KB |
Output is correct |
136 |
Correct |
781 ms |
81428 KB |
Output is correct |
137 |
Correct |
782 ms |
81588 KB |
Output is correct |
138 |
Correct |
784 ms |
81260 KB |
Output is correct |
139 |
Correct |
822 ms |
81220 KB |
Output is correct |
140 |
Correct |
812 ms |
81156 KB |
Output is correct |
141 |
Correct |
835 ms |
81152 KB |
Output is correct |
142 |
Correct |
859 ms |
81204 KB |
Output is correct |
143 |
Correct |
796 ms |
81108 KB |
Output is correct |
144 |
Correct |
792 ms |
81228 KB |
Output is correct |
145 |
Correct |
803 ms |
81200 KB |
Output is correct |
146 |
Correct |
787 ms |
81084 KB |
Output is correct |
147 |
Correct |
783 ms |
81116 KB |
Output is correct |
148 |
Correct |
791 ms |
81100 KB |
Output is correct |
149 |
Correct |
803 ms |
81116 KB |
Output is correct |
150 |
Correct |
499 ms |
75424 KB |
Output is correct |
151 |
Correct |
686 ms |
76800 KB |
Output is correct |
152 |
Correct |
726 ms |
76820 KB |
Output is correct |
153 |
Correct |
629 ms |
83632 KB |
Output is correct |