#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int MaxN = 3e5 + 5;
const int MaxLog = 20;
struct Query
{
int type;
int l, r, c, a;
long long k, b;
Query() = default;
Query(int _l, int _r, long long _k, int _c)
{
type = 1;
l = _l;
r = _r;
k = _k;
c = _c;
}
Query(int _l, int _r, long long _k)
{
type = 2;
l = _l;
r = _r;
k = _k;
}
Query(int _a, long long _b)
{
type = 3;
a = _a;
b = _b;
}
};
int n, m, q;
Query query[MaxN];
void Inp()
{
cin >> n >> m >> q;
for (int x = 1; x <= q; x++)
{
int type;
cin >> type;
if (type == 1)
{
int l, r, c;
long long k;
cin >> l >> r >> c >> k;
query[x] = Query(l, r, k, c);
}
else if (type == 2)
{
int l, r;
long long k;
cin >> l >> r >> k;
query[x] = Query(l, r, k);
}
else
{
int a;
long long b;
cin >> a >> b;
query[x] = Query(a, b);
}
}
}
long long SegTree[4 * MaxN];
long long Lazy[4 * MaxN];
void Fix(int id, int l, int r)
{
if (Lazy[id] == 0)
{
return;
}
SegTree[id] += Lazy[id];
if (l != r)
{
Lazy[id << 1] += Lazy[id];
Lazy[id << 1 | 1] += Lazy[id];
}
Lazy[id] = 0;
}
void Update(int id, int l, int r, int i, int j, long long v)
{
Fix(id, l, r);
if (j < l || r < i)
{
return;
}
if (i <= l && r <= j)
{
Lazy[id] += v;
Fix(id, l, r);
return;
}
int mid = (l + r) >> 1;
Update(id << 1, l, mid, i, j, v);
Update(id << 1 | 1, mid + 1, r, i, j, v);
SegTree[id] = min(SegTree[id << 1], SegTree[id << 1 | 1]);
}
long long Get(int id, int l, int r, int i, int j)
{
Fix(id, l, r);
if (j < l || r < i)
{
return 1e18;
}
if (i <= l && r <= j)
{
return SegTree[id];
}
int mid = (l + r) >> 1;
return min(Get(id << 1, l, mid, i, j), Get(id << 1 | 1, mid + 1, r, i, j));
}
long long Fenwick1[MaxN];
long long Fenwick2[MaxN];
void UpdateBIT1(int u, long long v)
{
int idx = u;
while (idx <= q)
{
Fenwick1[idx] += v;
idx += (idx & (-idx));
}
}
void UpdateBIT2(int u, long long v)
{
int idx = u;
while (idx <= q)
{
Fenwick2[idx] += v;
idx += (idx & (-idx));
}
}
int BSearchBIT1(long long p)
{
int pos = 0;
long long sum = 0;
for (int x = MaxLog - 1; x >= 0; x--)
{
if (pos + (1 << x) <= q && sum + Fenwick1[pos + (1 << x)] < p)
{
pos += (1 << x);
sum += Fenwick1[pos];
}
}
return pos + 1;
}
long long GetBIT2(int u)
{
int idx = u;
long long res = 0;
while (idx > 0)
{
res += Fenwick2[idx];
idx -= (idx & (-idx));
}
return res;
}
vector<int> markin[MaxN];
vector<int> markout[MaxN];
vector<int> markque[MaxN];
int res[MaxN];
void Exc()
{
for (int x = 1; x <= q; x++)
{
if (query[x].type == 3)
{
markque[query[x].a].push_back(x);
}
else
{
markin[query[x].l].push_back(x);
markout[query[x].r + 1].push_back(x);
}
}
for (int x = 1; x <= n; x++)
{
for (int y : markin[x])
{
if (query[y].type == 1)
{
Update(1, 1, q, y, q, query[y].k);
UpdateBIT1(y, query[y].k);
}
else
{
Update(1, 1, q, y, q, -query[y].k);
UpdateBIT2(y, query[y].k);
}
}
for (int y : markout[x])
{
if (query[y].type == 1)
{
Update(1, 1, q, y, q, -query[y].k);
UpdateBIT1(y, -query[y].k);
}
else
{
Update(1, 1, q, y, q, query[y].k);
UpdateBIT2(y, -query[y].k);
}
}
for (int y : markque[x])
{
long long p = Get(1, 1, q, 1, y);
if (p < 0)
{
p = abs(p);
}
else
{
p = 0;
}
p = GetBIT2(y) - p;
int t = BSearchBIT1(query[y].b + p);
if (t > y)
{
res[y] = 0;
}
else
{
assert(query[t].type == 1);
res[y] = query[t].c;
}
}
}
for (int x = 1; x <= q; x++)
{
if (query[x].type == 3)
{
cout << res[x] << "\n";
}
}
}
int main()
{
//freopen("C.INP", "r", stdin);
//freopen("C.OUT", "w", stdout);
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int test = 1;
//cin >> test;
for (int x = 1; x <= test; x++)
{
Inp();
Exc();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
21748 KB |
Output is correct |
2 |
Correct |
11 ms |
21852 KB |
Output is correct |
3 |
Correct |
9 ms |
21860 KB |
Output is correct |
4 |
Correct |
10 ms |
21852 KB |
Output is correct |
5 |
Correct |
17 ms |
21848 KB |
Output is correct |
6 |
Correct |
11 ms |
21596 KB |
Output is correct |
7 |
Correct |
10 ms |
21852 KB |
Output is correct |
8 |
Correct |
9 ms |
21884 KB |
Output is correct |
9 |
Correct |
10 ms |
21852 KB |
Output is correct |
10 |
Correct |
10 ms |
21852 KB |
Output is correct |
11 |
Correct |
12 ms |
21924 KB |
Output is correct |
12 |
Correct |
13 ms |
21916 KB |
Output is correct |
13 |
Correct |
16 ms |
21644 KB |
Output is correct |
14 |
Correct |
11 ms |
21840 KB |
Output is correct |
15 |
Correct |
10 ms |
21596 KB |
Output is correct |
16 |
Correct |
10 ms |
21852 KB |
Output is correct |
17 |
Correct |
10 ms |
21852 KB |
Output is correct |
18 |
Correct |
11 ms |
21848 KB |
Output is correct |
19 |
Correct |
10 ms |
21852 KB |
Output is correct |
20 |
Correct |
10 ms |
21796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
21748 KB |
Output is correct |
2 |
Correct |
11 ms |
21852 KB |
Output is correct |
3 |
Correct |
9 ms |
21860 KB |
Output is correct |
4 |
Correct |
10 ms |
21852 KB |
Output is correct |
5 |
Correct |
17 ms |
21848 KB |
Output is correct |
6 |
Correct |
11 ms |
21596 KB |
Output is correct |
7 |
Correct |
10 ms |
21852 KB |
Output is correct |
8 |
Correct |
9 ms |
21884 KB |
Output is correct |
9 |
Correct |
10 ms |
21852 KB |
Output is correct |
10 |
Correct |
10 ms |
21852 KB |
Output is correct |
11 |
Correct |
12 ms |
21924 KB |
Output is correct |
12 |
Correct |
13 ms |
21916 KB |
Output is correct |
13 |
Correct |
16 ms |
21644 KB |
Output is correct |
14 |
Correct |
11 ms |
21840 KB |
Output is correct |
15 |
Correct |
10 ms |
21596 KB |
Output is correct |
16 |
Correct |
10 ms |
21852 KB |
Output is correct |
17 |
Correct |
10 ms |
21852 KB |
Output is correct |
18 |
Correct |
11 ms |
21848 KB |
Output is correct |
19 |
Correct |
10 ms |
21852 KB |
Output is correct |
20 |
Correct |
10 ms |
21796 KB |
Output is correct |
21 |
Correct |
10 ms |
21848 KB |
Output is correct |
22 |
Correct |
10 ms |
21852 KB |
Output is correct |
23 |
Correct |
10 ms |
21868 KB |
Output is correct |
24 |
Correct |
15 ms |
21848 KB |
Output is correct |
25 |
Correct |
10 ms |
21852 KB |
Output is correct |
26 |
Correct |
9 ms |
21852 KB |
Output is correct |
27 |
Correct |
11 ms |
22104 KB |
Output is correct |
28 |
Correct |
12 ms |
21852 KB |
Output is correct |
29 |
Correct |
12 ms |
21852 KB |
Output is correct |
30 |
Correct |
13 ms |
21848 KB |
Output is correct |
31 |
Correct |
9 ms |
21852 KB |
Output is correct |
32 |
Correct |
11 ms |
21852 KB |
Output is correct |
33 |
Correct |
11 ms |
21836 KB |
Output is correct |
34 |
Correct |
10 ms |
21852 KB |
Output is correct |
35 |
Correct |
10 ms |
21852 KB |
Output is correct |
36 |
Correct |
11 ms |
21848 KB |
Output is correct |
37 |
Correct |
12 ms |
21852 KB |
Output is correct |
38 |
Correct |
12 ms |
21852 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
98 ms |
31060 KB |
Output is correct |
2 |
Correct |
86 ms |
31296 KB |
Output is correct |
3 |
Correct |
74 ms |
31212 KB |
Output is correct |
4 |
Correct |
114 ms |
31168 KB |
Output is correct |
5 |
Correct |
85 ms |
31196 KB |
Output is correct |
6 |
Correct |
83 ms |
31312 KB |
Output is correct |
7 |
Correct |
38 ms |
28640 KB |
Output is correct |
8 |
Correct |
40 ms |
28624 KB |
Output is correct |
9 |
Correct |
83 ms |
30736 KB |
Output is correct |
10 |
Correct |
67 ms |
31236 KB |
Output is correct |
11 |
Correct |
105 ms |
31056 KB |
Output is correct |
12 |
Correct |
104 ms |
31060 KB |
Output is correct |
13 |
Correct |
65 ms |
30172 KB |
Output is correct |
14 |
Correct |
63 ms |
31056 KB |
Output is correct |
15 |
Correct |
79 ms |
30804 KB |
Output is correct |
16 |
Correct |
83 ms |
31144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
429 ms |
57196 KB |
Output is correct |
2 |
Correct |
310 ms |
51900 KB |
Output is correct |
3 |
Correct |
409 ms |
59820 KB |
Output is correct |
4 |
Correct |
311 ms |
51892 KB |
Output is correct |
5 |
Correct |
266 ms |
51756 KB |
Output is correct |
6 |
Correct |
344 ms |
59476 KB |
Output is correct |
7 |
Correct |
124 ms |
50624 KB |
Output is correct |
8 |
Correct |
147 ms |
50804 KB |
Output is correct |
9 |
Correct |
324 ms |
59116 KB |
Output is correct |
10 |
Correct |
364 ms |
59220 KB |
Output is correct |
11 |
Correct |
355 ms |
57348 KB |
Output is correct |
12 |
Correct |
374 ms |
59268 KB |
Output is correct |
13 |
Correct |
354 ms |
57632 KB |
Output is correct |
14 |
Correct |
391 ms |
59216 KB |
Output is correct |
15 |
Correct |
350 ms |
59048 KB |
Output is correct |
16 |
Correct |
436 ms |
58964 KB |
Output is correct |
17 |
Correct |
364 ms |
59072 KB |
Output is correct |
18 |
Correct |
385 ms |
58192 KB |
Output is correct |
19 |
Correct |
369 ms |
59220 KB |
Output is correct |
20 |
Correct |
400 ms |
58392 KB |
Output is correct |
21 |
Correct |
416 ms |
59168 KB |
Output is correct |
22 |
Correct |
368 ms |
58960 KB |
Output is correct |
23 |
Correct |
389 ms |
59072 KB |
Output is correct |
24 |
Correct |
343 ms |
58964 KB |
Output is correct |
25 |
Correct |
311 ms |
54260 KB |
Output is correct |
26 |
Correct |
305 ms |
54872 KB |
Output is correct |
27 |
Correct |
274 ms |
59984 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
21748 KB |
Output is correct |
2 |
Correct |
11 ms |
21852 KB |
Output is correct |
3 |
Correct |
9 ms |
21860 KB |
Output is correct |
4 |
Correct |
10 ms |
21852 KB |
Output is correct |
5 |
Correct |
17 ms |
21848 KB |
Output is correct |
6 |
Correct |
11 ms |
21596 KB |
Output is correct |
7 |
Correct |
10 ms |
21852 KB |
Output is correct |
8 |
Correct |
9 ms |
21884 KB |
Output is correct |
9 |
Correct |
10 ms |
21852 KB |
Output is correct |
10 |
Correct |
10 ms |
21852 KB |
Output is correct |
11 |
Correct |
12 ms |
21924 KB |
Output is correct |
12 |
Correct |
13 ms |
21916 KB |
Output is correct |
13 |
Correct |
16 ms |
21644 KB |
Output is correct |
14 |
Correct |
11 ms |
21840 KB |
Output is correct |
15 |
Correct |
10 ms |
21596 KB |
Output is correct |
16 |
Correct |
10 ms |
21852 KB |
Output is correct |
17 |
Correct |
10 ms |
21852 KB |
Output is correct |
18 |
Correct |
11 ms |
21848 KB |
Output is correct |
19 |
Correct |
10 ms |
21852 KB |
Output is correct |
20 |
Correct |
10 ms |
21796 KB |
Output is correct |
21 |
Correct |
98 ms |
31060 KB |
Output is correct |
22 |
Correct |
86 ms |
31296 KB |
Output is correct |
23 |
Correct |
74 ms |
31212 KB |
Output is correct |
24 |
Correct |
114 ms |
31168 KB |
Output is correct |
25 |
Correct |
85 ms |
31196 KB |
Output is correct |
26 |
Correct |
83 ms |
31312 KB |
Output is correct |
27 |
Correct |
38 ms |
28640 KB |
Output is correct |
28 |
Correct |
40 ms |
28624 KB |
Output is correct |
29 |
Correct |
83 ms |
30736 KB |
Output is correct |
30 |
Correct |
67 ms |
31236 KB |
Output is correct |
31 |
Correct |
105 ms |
31056 KB |
Output is correct |
32 |
Correct |
104 ms |
31060 KB |
Output is correct |
33 |
Correct |
65 ms |
30172 KB |
Output is correct |
34 |
Correct |
63 ms |
31056 KB |
Output is correct |
35 |
Correct |
79 ms |
30804 KB |
Output is correct |
36 |
Correct |
83 ms |
31144 KB |
Output is correct |
37 |
Correct |
70 ms |
30036 KB |
Output is correct |
38 |
Correct |
64 ms |
29496 KB |
Output is correct |
39 |
Correct |
35 ms |
27664 KB |
Output is correct |
40 |
Correct |
39 ms |
28456 KB |
Output is correct |
41 |
Correct |
62 ms |
30292 KB |
Output is correct |
42 |
Correct |
70 ms |
30812 KB |
Output is correct |
43 |
Correct |
72 ms |
30768 KB |
Output is correct |
44 |
Correct |
78 ms |
30548 KB |
Output is correct |
45 |
Correct |
70 ms |
30800 KB |
Output is correct |
46 |
Correct |
71 ms |
30752 KB |
Output is correct |
47 |
Correct |
46 ms |
29280 KB |
Output is correct |
48 |
Correct |
55 ms |
29520 KB |
Output is correct |
49 |
Correct |
61 ms |
28752 KB |
Output is correct |
50 |
Correct |
69 ms |
29884 KB |
Output is correct |
51 |
Correct |
69 ms |
30884 KB |
Output is correct |
52 |
Correct |
88 ms |
30800 KB |
Output is correct |
53 |
Correct |
63 ms |
29520 KB |
Output is correct |
54 |
Correct |
69 ms |
31284 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
70 ms |
30288 KB |
Output is correct |
2 |
Correct |
79 ms |
30712 KB |
Output is correct |
3 |
Correct |
73 ms |
31052 KB |
Output is correct |
4 |
Correct |
50 ms |
28752 KB |
Output is correct |
5 |
Correct |
62 ms |
29780 KB |
Output is correct |
6 |
Correct |
81 ms |
30764 KB |
Output is correct |
7 |
Correct |
40 ms |
28500 KB |
Output is correct |
8 |
Correct |
39 ms |
27972 KB |
Output is correct |
9 |
Correct |
49 ms |
29680 KB |
Output is correct |
10 |
Correct |
58 ms |
28052 KB |
Output is correct |
11 |
Correct |
60 ms |
29776 KB |
Output is correct |
12 |
Correct |
61 ms |
29776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
21748 KB |
Output is correct |
2 |
Correct |
11 ms |
21852 KB |
Output is correct |
3 |
Correct |
9 ms |
21860 KB |
Output is correct |
4 |
Correct |
10 ms |
21852 KB |
Output is correct |
5 |
Correct |
17 ms |
21848 KB |
Output is correct |
6 |
Correct |
11 ms |
21596 KB |
Output is correct |
7 |
Correct |
10 ms |
21852 KB |
Output is correct |
8 |
Correct |
9 ms |
21884 KB |
Output is correct |
9 |
Correct |
10 ms |
21852 KB |
Output is correct |
10 |
Correct |
10 ms |
21852 KB |
Output is correct |
11 |
Correct |
12 ms |
21924 KB |
Output is correct |
12 |
Correct |
13 ms |
21916 KB |
Output is correct |
13 |
Correct |
16 ms |
21644 KB |
Output is correct |
14 |
Correct |
11 ms |
21840 KB |
Output is correct |
15 |
Correct |
10 ms |
21596 KB |
Output is correct |
16 |
Correct |
10 ms |
21852 KB |
Output is correct |
17 |
Correct |
10 ms |
21852 KB |
Output is correct |
18 |
Correct |
11 ms |
21848 KB |
Output is correct |
19 |
Correct |
10 ms |
21852 KB |
Output is correct |
20 |
Correct |
10 ms |
21796 KB |
Output is correct |
21 |
Correct |
10 ms |
21848 KB |
Output is correct |
22 |
Correct |
10 ms |
21852 KB |
Output is correct |
23 |
Correct |
10 ms |
21868 KB |
Output is correct |
24 |
Correct |
15 ms |
21848 KB |
Output is correct |
25 |
Correct |
10 ms |
21852 KB |
Output is correct |
26 |
Correct |
9 ms |
21852 KB |
Output is correct |
27 |
Correct |
11 ms |
22104 KB |
Output is correct |
28 |
Correct |
12 ms |
21852 KB |
Output is correct |
29 |
Correct |
12 ms |
21852 KB |
Output is correct |
30 |
Correct |
13 ms |
21848 KB |
Output is correct |
31 |
Correct |
9 ms |
21852 KB |
Output is correct |
32 |
Correct |
11 ms |
21852 KB |
Output is correct |
33 |
Correct |
11 ms |
21836 KB |
Output is correct |
34 |
Correct |
10 ms |
21852 KB |
Output is correct |
35 |
Correct |
10 ms |
21852 KB |
Output is correct |
36 |
Correct |
11 ms |
21848 KB |
Output is correct |
37 |
Correct |
12 ms |
21852 KB |
Output is correct |
38 |
Correct |
12 ms |
21852 KB |
Output is correct |
39 |
Correct |
98 ms |
31060 KB |
Output is correct |
40 |
Correct |
86 ms |
31296 KB |
Output is correct |
41 |
Correct |
74 ms |
31212 KB |
Output is correct |
42 |
Correct |
114 ms |
31168 KB |
Output is correct |
43 |
Correct |
85 ms |
31196 KB |
Output is correct |
44 |
Correct |
83 ms |
31312 KB |
Output is correct |
45 |
Correct |
38 ms |
28640 KB |
Output is correct |
46 |
Correct |
40 ms |
28624 KB |
Output is correct |
47 |
Correct |
83 ms |
30736 KB |
Output is correct |
48 |
Correct |
67 ms |
31236 KB |
Output is correct |
49 |
Correct |
105 ms |
31056 KB |
Output is correct |
50 |
Correct |
104 ms |
31060 KB |
Output is correct |
51 |
Correct |
65 ms |
30172 KB |
Output is correct |
52 |
Correct |
63 ms |
31056 KB |
Output is correct |
53 |
Correct |
79 ms |
30804 KB |
Output is correct |
54 |
Correct |
83 ms |
31144 KB |
Output is correct |
55 |
Correct |
70 ms |
30036 KB |
Output is correct |
56 |
Correct |
64 ms |
29496 KB |
Output is correct |
57 |
Correct |
35 ms |
27664 KB |
Output is correct |
58 |
Correct |
39 ms |
28456 KB |
Output is correct |
59 |
Correct |
62 ms |
30292 KB |
Output is correct |
60 |
Correct |
70 ms |
30812 KB |
Output is correct |
61 |
Correct |
72 ms |
30768 KB |
Output is correct |
62 |
Correct |
78 ms |
30548 KB |
Output is correct |
63 |
Correct |
70 ms |
30800 KB |
Output is correct |
64 |
Correct |
71 ms |
30752 KB |
Output is correct |
65 |
Correct |
46 ms |
29280 KB |
Output is correct |
66 |
Correct |
55 ms |
29520 KB |
Output is correct |
67 |
Correct |
61 ms |
28752 KB |
Output is correct |
68 |
Correct |
69 ms |
29884 KB |
Output is correct |
69 |
Correct |
69 ms |
30884 KB |
Output is correct |
70 |
Correct |
88 ms |
30800 KB |
Output is correct |
71 |
Correct |
63 ms |
29520 KB |
Output is correct |
72 |
Correct |
69 ms |
31284 KB |
Output is correct |
73 |
Correct |
70 ms |
30288 KB |
Output is correct |
74 |
Correct |
79 ms |
30712 KB |
Output is correct |
75 |
Correct |
73 ms |
31052 KB |
Output is correct |
76 |
Correct |
50 ms |
28752 KB |
Output is correct |
77 |
Correct |
62 ms |
29780 KB |
Output is correct |
78 |
Correct |
81 ms |
30764 KB |
Output is correct |
79 |
Correct |
40 ms |
28500 KB |
Output is correct |
80 |
Correct |
39 ms |
27972 KB |
Output is correct |
81 |
Correct |
49 ms |
29680 KB |
Output is correct |
82 |
Correct |
58 ms |
28052 KB |
Output is correct |
83 |
Correct |
60 ms |
29776 KB |
Output is correct |
84 |
Correct |
61 ms |
29776 KB |
Output is correct |
85 |
Correct |
71 ms |
30648 KB |
Output is correct |
86 |
Correct |
77 ms |
31432 KB |
Output is correct |
87 |
Correct |
66 ms |
30560 KB |
Output is correct |
88 |
Correct |
75 ms |
31312 KB |
Output is correct |
89 |
Correct |
50 ms |
28504 KB |
Output is correct |
90 |
Correct |
74 ms |
31316 KB |
Output is correct |
91 |
Correct |
66 ms |
29832 KB |
Output is correct |
92 |
Correct |
57 ms |
29528 KB |
Output is correct |
93 |
Correct |
78 ms |
31312 KB |
Output is correct |
94 |
Correct |
65 ms |
31060 KB |
Output is correct |
95 |
Correct |
73 ms |
31056 KB |
Output is correct |
96 |
Correct |
77 ms |
31312 KB |
Output is correct |
97 |
Correct |
74 ms |
31288 KB |
Output is correct |
98 |
Correct |
63 ms |
30040 KB |
Output is correct |
99 |
Correct |
47 ms |
29772 KB |
Output is correct |
100 |
Correct |
55 ms |
28928 KB |
Output is correct |
101 |
Correct |
64 ms |
30036 KB |
Output is correct |
102 |
Correct |
71 ms |
31572 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
21748 KB |
Output is correct |
2 |
Correct |
11 ms |
21852 KB |
Output is correct |
3 |
Correct |
9 ms |
21860 KB |
Output is correct |
4 |
Correct |
10 ms |
21852 KB |
Output is correct |
5 |
Correct |
17 ms |
21848 KB |
Output is correct |
6 |
Correct |
11 ms |
21596 KB |
Output is correct |
7 |
Correct |
10 ms |
21852 KB |
Output is correct |
8 |
Correct |
9 ms |
21884 KB |
Output is correct |
9 |
Correct |
10 ms |
21852 KB |
Output is correct |
10 |
Correct |
10 ms |
21852 KB |
Output is correct |
11 |
Correct |
12 ms |
21924 KB |
Output is correct |
12 |
Correct |
13 ms |
21916 KB |
Output is correct |
13 |
Correct |
16 ms |
21644 KB |
Output is correct |
14 |
Correct |
11 ms |
21840 KB |
Output is correct |
15 |
Correct |
10 ms |
21596 KB |
Output is correct |
16 |
Correct |
10 ms |
21852 KB |
Output is correct |
17 |
Correct |
10 ms |
21852 KB |
Output is correct |
18 |
Correct |
11 ms |
21848 KB |
Output is correct |
19 |
Correct |
10 ms |
21852 KB |
Output is correct |
20 |
Correct |
10 ms |
21796 KB |
Output is correct |
21 |
Correct |
10 ms |
21848 KB |
Output is correct |
22 |
Correct |
10 ms |
21852 KB |
Output is correct |
23 |
Correct |
10 ms |
21868 KB |
Output is correct |
24 |
Correct |
15 ms |
21848 KB |
Output is correct |
25 |
Correct |
10 ms |
21852 KB |
Output is correct |
26 |
Correct |
9 ms |
21852 KB |
Output is correct |
27 |
Correct |
11 ms |
22104 KB |
Output is correct |
28 |
Correct |
12 ms |
21852 KB |
Output is correct |
29 |
Correct |
12 ms |
21852 KB |
Output is correct |
30 |
Correct |
13 ms |
21848 KB |
Output is correct |
31 |
Correct |
9 ms |
21852 KB |
Output is correct |
32 |
Correct |
11 ms |
21852 KB |
Output is correct |
33 |
Correct |
11 ms |
21836 KB |
Output is correct |
34 |
Correct |
10 ms |
21852 KB |
Output is correct |
35 |
Correct |
10 ms |
21852 KB |
Output is correct |
36 |
Correct |
11 ms |
21848 KB |
Output is correct |
37 |
Correct |
12 ms |
21852 KB |
Output is correct |
38 |
Correct |
12 ms |
21852 KB |
Output is correct |
39 |
Correct |
98 ms |
31060 KB |
Output is correct |
40 |
Correct |
86 ms |
31296 KB |
Output is correct |
41 |
Correct |
74 ms |
31212 KB |
Output is correct |
42 |
Correct |
114 ms |
31168 KB |
Output is correct |
43 |
Correct |
85 ms |
31196 KB |
Output is correct |
44 |
Correct |
83 ms |
31312 KB |
Output is correct |
45 |
Correct |
38 ms |
28640 KB |
Output is correct |
46 |
Correct |
40 ms |
28624 KB |
Output is correct |
47 |
Correct |
83 ms |
30736 KB |
Output is correct |
48 |
Correct |
67 ms |
31236 KB |
Output is correct |
49 |
Correct |
105 ms |
31056 KB |
Output is correct |
50 |
Correct |
104 ms |
31060 KB |
Output is correct |
51 |
Correct |
65 ms |
30172 KB |
Output is correct |
52 |
Correct |
63 ms |
31056 KB |
Output is correct |
53 |
Correct |
79 ms |
30804 KB |
Output is correct |
54 |
Correct |
83 ms |
31144 KB |
Output is correct |
55 |
Correct |
429 ms |
57196 KB |
Output is correct |
56 |
Correct |
310 ms |
51900 KB |
Output is correct |
57 |
Correct |
409 ms |
59820 KB |
Output is correct |
58 |
Correct |
311 ms |
51892 KB |
Output is correct |
59 |
Correct |
266 ms |
51756 KB |
Output is correct |
60 |
Correct |
344 ms |
59476 KB |
Output is correct |
61 |
Correct |
124 ms |
50624 KB |
Output is correct |
62 |
Correct |
147 ms |
50804 KB |
Output is correct |
63 |
Correct |
324 ms |
59116 KB |
Output is correct |
64 |
Correct |
364 ms |
59220 KB |
Output is correct |
65 |
Correct |
355 ms |
57348 KB |
Output is correct |
66 |
Correct |
374 ms |
59268 KB |
Output is correct |
67 |
Correct |
354 ms |
57632 KB |
Output is correct |
68 |
Correct |
391 ms |
59216 KB |
Output is correct |
69 |
Correct |
350 ms |
59048 KB |
Output is correct |
70 |
Correct |
436 ms |
58964 KB |
Output is correct |
71 |
Correct |
364 ms |
59072 KB |
Output is correct |
72 |
Correct |
385 ms |
58192 KB |
Output is correct |
73 |
Correct |
369 ms |
59220 KB |
Output is correct |
74 |
Correct |
400 ms |
58392 KB |
Output is correct |
75 |
Correct |
416 ms |
59168 KB |
Output is correct |
76 |
Correct |
368 ms |
58960 KB |
Output is correct |
77 |
Correct |
389 ms |
59072 KB |
Output is correct |
78 |
Correct |
343 ms |
58964 KB |
Output is correct |
79 |
Correct |
311 ms |
54260 KB |
Output is correct |
80 |
Correct |
305 ms |
54872 KB |
Output is correct |
81 |
Correct |
274 ms |
59984 KB |
Output is correct |
82 |
Correct |
70 ms |
30036 KB |
Output is correct |
83 |
Correct |
64 ms |
29496 KB |
Output is correct |
84 |
Correct |
35 ms |
27664 KB |
Output is correct |
85 |
Correct |
39 ms |
28456 KB |
Output is correct |
86 |
Correct |
62 ms |
30292 KB |
Output is correct |
87 |
Correct |
70 ms |
30812 KB |
Output is correct |
88 |
Correct |
72 ms |
30768 KB |
Output is correct |
89 |
Correct |
78 ms |
30548 KB |
Output is correct |
90 |
Correct |
70 ms |
30800 KB |
Output is correct |
91 |
Correct |
71 ms |
30752 KB |
Output is correct |
92 |
Correct |
46 ms |
29280 KB |
Output is correct |
93 |
Correct |
55 ms |
29520 KB |
Output is correct |
94 |
Correct |
61 ms |
28752 KB |
Output is correct |
95 |
Correct |
69 ms |
29884 KB |
Output is correct |
96 |
Correct |
69 ms |
30884 KB |
Output is correct |
97 |
Correct |
88 ms |
30800 KB |
Output is correct |
98 |
Correct |
63 ms |
29520 KB |
Output is correct |
99 |
Correct |
69 ms |
31284 KB |
Output is correct |
100 |
Correct |
70 ms |
30288 KB |
Output is correct |
101 |
Correct |
79 ms |
30712 KB |
Output is correct |
102 |
Correct |
73 ms |
31052 KB |
Output is correct |
103 |
Correct |
50 ms |
28752 KB |
Output is correct |
104 |
Correct |
62 ms |
29780 KB |
Output is correct |
105 |
Correct |
81 ms |
30764 KB |
Output is correct |
106 |
Correct |
40 ms |
28500 KB |
Output is correct |
107 |
Correct |
39 ms |
27972 KB |
Output is correct |
108 |
Correct |
49 ms |
29680 KB |
Output is correct |
109 |
Correct |
58 ms |
28052 KB |
Output is correct |
110 |
Correct |
60 ms |
29776 KB |
Output is correct |
111 |
Correct |
61 ms |
29776 KB |
Output is correct |
112 |
Correct |
71 ms |
30648 KB |
Output is correct |
113 |
Correct |
77 ms |
31432 KB |
Output is correct |
114 |
Correct |
66 ms |
30560 KB |
Output is correct |
115 |
Correct |
75 ms |
31312 KB |
Output is correct |
116 |
Correct |
50 ms |
28504 KB |
Output is correct |
117 |
Correct |
74 ms |
31316 KB |
Output is correct |
118 |
Correct |
66 ms |
29832 KB |
Output is correct |
119 |
Correct |
57 ms |
29528 KB |
Output is correct |
120 |
Correct |
78 ms |
31312 KB |
Output is correct |
121 |
Correct |
65 ms |
31060 KB |
Output is correct |
122 |
Correct |
73 ms |
31056 KB |
Output is correct |
123 |
Correct |
77 ms |
31312 KB |
Output is correct |
124 |
Correct |
74 ms |
31288 KB |
Output is correct |
125 |
Correct |
63 ms |
30040 KB |
Output is correct |
126 |
Correct |
47 ms |
29772 KB |
Output is correct |
127 |
Correct |
55 ms |
28928 KB |
Output is correct |
128 |
Correct |
64 ms |
30036 KB |
Output is correct |
129 |
Correct |
71 ms |
31572 KB |
Output is correct |
130 |
Correct |
379 ms |
60240 KB |
Output is correct |
131 |
Correct |
254 ms |
52308 KB |
Output is correct |
132 |
Correct |
392 ms |
60240 KB |
Output is correct |
133 |
Correct |
333 ms |
59000 KB |
Output is correct |
134 |
Correct |
293 ms |
56028 KB |
Output is correct |
135 |
Correct |
366 ms |
60500 KB |
Output is correct |
136 |
Correct |
319 ms |
59984 KB |
Output is correct |
137 |
Correct |
334 ms |
59984 KB |
Output is correct |
138 |
Correct |
334 ms |
57936 KB |
Output is correct |
139 |
Correct |
353 ms |
59732 KB |
Output is correct |
140 |
Correct |
325 ms |
58472 KB |
Output is correct |
141 |
Correct |
345 ms |
59732 KB |
Output is correct |
142 |
Correct |
344 ms |
59728 KB |
Output is correct |
143 |
Correct |
337 ms |
59728 KB |
Output is correct |
144 |
Correct |
336 ms |
58700 KB |
Output is correct |
145 |
Correct |
333 ms |
59732 KB |
Output is correct |
146 |
Correct |
348 ms |
59264 KB |
Output is correct |
147 |
Correct |
348 ms |
59984 KB |
Output is correct |
148 |
Correct |
341 ms |
59728 KB |
Output is correct |
149 |
Correct |
346 ms |
59984 KB |
Output is correct |
150 |
Correct |
189 ms |
54068 KB |
Output is correct |
151 |
Correct |
267 ms |
55476 KB |
Output is correct |
152 |
Correct |
273 ms |
55564 KB |
Output is correct |
153 |
Correct |
263 ms |
60756 KB |
Output is correct |