#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
const ll inf = 1e16;
struct segtree_beats{
struct node{
ll mn[2], cnt[2];
ll sm, lazy_add;
node(){
mn[0] = 0, mn[1] = inf;
cnt[0] = 1, cnt[1] = 0;
sm = 0;
lazy_add = 0;
}
node operator+(node a){
node rt;
if(mn[0] < a.mn[0]){
rt.mn[0] = mn[0], rt.cnt[0] = cnt[0];
if(mn[1] < a.mn[0]) rt.mn[1] = mn[1], rt.cnt[1] = cnt[1];
else if(mn[1] > a.mn[0]) rt.mn[1] = a.mn[0], rt.cnt[1] = a.cnt[0];
else rt.mn[1] = mn[1], rt.cnt[1] = cnt[1]+a.cnt[0];
}
else if(mn[0] > a.mn[0]){
rt.mn[0] = a.mn[0], rt.cnt[0] = a.cnt[0];
if(mn[0] < a.mn[1]) rt.mn[1] = mn[0], rt.cnt[1] = cnt[0];
else if(mn[0] > a.mn[1]) rt.mn[1] = a.mn[1], rt.cnt[1] = a.cnt[1];
else rt.mn[1] = mn[0], rt.cnt[1] = cnt[0]+a.cnt[1];
}
else{
rt.mn[0] = mn[0], rt.cnt[0] = cnt[0]+a.cnt[0];
if(mn[1] < a.mn[1]) rt.mn[1] = mn[1], rt.cnt[1] = cnt[1];
else if(mn[1] > a.mn[1]) rt.mn[1] = a.mn[1], rt.cnt[1] = a.cnt[1];
else rt.mn[1] = mn[1], rt.cnt[1] = cnt[1]+a.cnt[1];
}
rt.sm = sm+a.sm;
return rt;
}
void propagate(node nd, int sz){
lazy_add+=nd.lazy_add;
sm+=nd.lazy_add*sz;
mn[0]+=nd.lazy_add;
if(mn[1] != inf) mn[1]+=nd.lazy_add;
if(nd.mn[0] <= mn[0]) return;
sm+=(nd.mn[0]-mn[0])*sz;
mn[0] = nd.mn[0];
}
};
int k;
vector<node> v;
segtree_beats(int n){
k = 1;
while(k < n) k*=2;
k*=2;
v.resize(k, node());
for(int i = k/2-1; i > 0; i--) v[i] = v[2*i]+v[2*i+1];
}
void add(int l, int r, int nd, int a, int b, ll x){
if(a > r || b < l){
return;
}
if(a >= l && b <= r){
node nd0;
nd0.lazy_add = x;
nd0.mn[0] = -inf+1;
v[nd].propagate(nd0, b-a+1);
return;
}
int md = (a+b)/2;
v[2*nd].propagate(v[nd], md-a+1);
v[2*nd+1].propagate(v[nd], b-md);
v[nd].lazy_add = 0;
add(l, r, 2*nd, a, md, x);
add(l, r, 2*nd+1, md+1, b, x);
v[nd] = v[2*nd]+v[2*nd+1];
}
void add(int l, int r, ll x){
add(l, r, 1, 0, k/2-1, x);
}
void chmx(int l, int r, int nd, int a, int b, ll x){
if(a > r || b < l || v[nd].mn[0] >= x){
return;
}
if(a >= l && b <= r && v[nd].mn[1] > x){
node nd0;
nd0.mn[0] = x;
v[nd].propagate(nd0, b-a+1);
return;
}
int md = (a+b)/2;
v[2*nd].propagate(v[nd], md-a+1);
v[2*nd+1].propagate(v[nd], b-md);
v[nd].lazy_add = 0;
chmx(l, r, 2*nd, a, md, x);
chmx(l, r, 2*nd+1, md+1, b, x);
v[nd] = v[2*nd]+v[2*nd+1];
}
void chmx(int l, int r, ll x){
chmx(l, r, 1, 0, k/2-1, x);
}
ll sum(int l, int r, int nd, int a, int b){
if(a > r || b < l){
return 0;
}
if(a >= l && b <= r){
return v[nd].sm;
}
int md = (a+b)/2;
v[2*nd].propagate(v[nd], md-a+1);
v[2*nd+1].propagate(v[nd], b-md);
v[nd].lazy_add = 0;
ll rt = sum(l, r, 2*nd, a, md) + sum(l, r, 2*nd+1, md+1, b);
v[nd] = v[2*nd]+v[2*nd+1];
return rt;
}
ll sum(int l, int r){
return sum(l, r, 1, 0, k/2-1);
}
};
struct BIT{
int n;
vector<ll> sm;
BIT(int _n){
n = _n;
sm.resize(n);
}
void add(int in, ll x){
in++;
while(in <= n) sm[in-1]+=x, in+=in&-in;
}
ll sum(int in){
in++;
ll s = 0;
while(in >= 1) s+=sm[in-1], in-=in&-in;
return s;
}
ll sum(int l, int r){
return sum(r)-(l == 0? 0:sum(l-1));
}
};
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, m, q; cin >> n >> m >> q;
vector<vector<int>> ql(n), qr(n);
vector<int> ans;
vector<pair<int, ll>> queries(q, {-1, -1});
vector<vector<pair<ll, int>>> qq(n);
BIT sum(n+1);
segtree_beats beats(n);
for(int i = 0; i < q; i++){
int tt; cin >> tt;
if(tt == 1){
int l, r, c; ll k; cin >> l >> r >> c >> k; l--, r--;
queries[i] = {c, k};
ql[l].pb(i);
qr[r].pb(i);
sum.add(l, k);
sum.add(r+1, -k);
beats.add(l, r, k);
}
else if(tt == 2){
int l, r; ll k; cin >> l >> r >> k; l--, r--;
beats.add(l, r, -k);
beats.chmx(l, r, 0);
}
else{
int a; ll b; cin >> a >> b; a--;
ll s = sum.sum(0, a);
ll pos = s-beats.sum(a, a)+b;
if(s < pos) ans.pb(0);
else{
qq[a].pb({pos, ans.size()});
ans.pb(-1);
}
}
}
BIT Q(q);
for(int i = n-1; i >= 0; i--){
for(int x: qr[i]) Q.add(x, queries[x].sc);
for(auto [b, in]: qq[i]){
int l = 0, r = q-1;
while(l < r){
int md = (l+r)/2;
if(Q.sum(0, md) >= b) r = md;
else l = md+1;
}
ans[in] = queries[l].f;
}
for(int x: ql[i]) Q.add(x, -queries[x].sc);
}
for(int x: ans) cout << x << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
596 KB |
Output is correct |
2 |
Correct |
3 ms |
764 KB |
Output is correct |
3 |
Correct |
2 ms |
740 KB |
Output is correct |
4 |
Correct |
3 ms |
724 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
3 ms |
724 KB |
Output is correct |
8 |
Correct |
3 ms |
724 KB |
Output is correct |
9 |
Correct |
4 ms |
756 KB |
Output is correct |
10 |
Correct |
3 ms |
764 KB |
Output is correct |
11 |
Correct |
4 ms |
724 KB |
Output is correct |
12 |
Correct |
3 ms |
724 KB |
Output is correct |
13 |
Correct |
3 ms |
724 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
724 KB |
Output is correct |
16 |
Correct |
3 ms |
724 KB |
Output is correct |
17 |
Correct |
3 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
772 KB |
Output is correct |
19 |
Correct |
3 ms |
716 KB |
Output is correct |
20 |
Correct |
3 ms |
716 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
596 KB |
Output is correct |
2 |
Correct |
3 ms |
764 KB |
Output is correct |
3 |
Correct |
2 ms |
740 KB |
Output is correct |
4 |
Correct |
3 ms |
724 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
3 ms |
724 KB |
Output is correct |
8 |
Correct |
3 ms |
724 KB |
Output is correct |
9 |
Correct |
4 ms |
756 KB |
Output is correct |
10 |
Correct |
3 ms |
764 KB |
Output is correct |
11 |
Correct |
4 ms |
724 KB |
Output is correct |
12 |
Correct |
3 ms |
724 KB |
Output is correct |
13 |
Correct |
3 ms |
724 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
724 KB |
Output is correct |
16 |
Correct |
3 ms |
724 KB |
Output is correct |
17 |
Correct |
3 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
772 KB |
Output is correct |
19 |
Correct |
3 ms |
716 KB |
Output is correct |
20 |
Correct |
3 ms |
716 KB |
Output is correct |
21 |
Correct |
4 ms |
752 KB |
Output is correct |
22 |
Correct |
3 ms |
712 KB |
Output is correct |
23 |
Correct |
3 ms |
724 KB |
Output is correct |
24 |
Correct |
4 ms |
724 KB |
Output is correct |
25 |
Correct |
2 ms |
328 KB |
Output is correct |
26 |
Correct |
2 ms |
388 KB |
Output is correct |
27 |
Correct |
3 ms |
724 KB |
Output is correct |
28 |
Correct |
3 ms |
724 KB |
Output is correct |
29 |
Correct |
3 ms |
724 KB |
Output is correct |
30 |
Correct |
3 ms |
724 KB |
Output is correct |
31 |
Correct |
3 ms |
772 KB |
Output is correct |
32 |
Correct |
4 ms |
724 KB |
Output is correct |
33 |
Correct |
2 ms |
744 KB |
Output is correct |
34 |
Correct |
2 ms |
724 KB |
Output is correct |
35 |
Correct |
2 ms |
724 KB |
Output is correct |
36 |
Correct |
3 ms |
720 KB |
Output is correct |
37 |
Correct |
2 ms |
724 KB |
Output is correct |
38 |
Correct |
3 ms |
724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
138 ms |
14320 KB |
Output is correct |
2 |
Correct |
140 ms |
16016 KB |
Output is correct |
3 |
Correct |
117 ms |
15552 KB |
Output is correct |
4 |
Correct |
124 ms |
15532 KB |
Output is correct |
5 |
Correct |
137 ms |
15996 KB |
Output is correct |
6 |
Correct |
126 ms |
15972 KB |
Output is correct |
7 |
Correct |
20 ms |
3020 KB |
Output is correct |
8 |
Correct |
22 ms |
3080 KB |
Output is correct |
9 |
Correct |
127 ms |
15736 KB |
Output is correct |
10 |
Correct |
135 ms |
15692 KB |
Output is correct |
11 |
Correct |
115 ms |
15600 KB |
Output is correct |
12 |
Correct |
125 ms |
15680 KB |
Output is correct |
13 |
Correct |
129 ms |
13844 KB |
Output is correct |
14 |
Correct |
126 ms |
16040 KB |
Output is correct |
15 |
Correct |
110 ms |
14616 KB |
Output is correct |
16 |
Correct |
130 ms |
16564 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
573 ms |
53724 KB |
Output is correct |
2 |
Correct |
483 ms |
53424 KB |
Output is correct |
3 |
Correct |
655 ms |
62800 KB |
Output is correct |
4 |
Correct |
512 ms |
58424 KB |
Output is correct |
5 |
Correct |
414 ms |
53580 KB |
Output is correct |
6 |
Correct |
638 ms |
63468 KB |
Output is correct |
7 |
Correct |
102 ms |
13080 KB |
Output is correct |
8 |
Correct |
151 ms |
12444 KB |
Output is correct |
9 |
Correct |
612 ms |
64756 KB |
Output is correct |
10 |
Correct |
601 ms |
64768 KB |
Output is correct |
11 |
Correct |
561 ms |
62500 KB |
Output is correct |
12 |
Correct |
614 ms |
62452 KB |
Output is correct |
13 |
Correct |
564 ms |
62324 KB |
Output is correct |
14 |
Correct |
592 ms |
62356 KB |
Output is correct |
15 |
Correct |
753 ms |
62228 KB |
Output is correct |
16 |
Correct |
736 ms |
62360 KB |
Output is correct |
17 |
Correct |
681 ms |
62256 KB |
Output is correct |
18 |
Correct |
606 ms |
62372 KB |
Output is correct |
19 |
Correct |
638 ms |
62384 KB |
Output is correct |
20 |
Correct |
786 ms |
62308 KB |
Output is correct |
21 |
Correct |
727 ms |
62296 KB |
Output is correct |
22 |
Correct |
599 ms |
62260 KB |
Output is correct |
23 |
Correct |
625 ms |
62352 KB |
Output is correct |
24 |
Correct |
651 ms |
62284 KB |
Output is correct |
25 |
Correct |
455 ms |
54664 KB |
Output is correct |
26 |
Correct |
453 ms |
59380 KB |
Output is correct |
27 |
Correct |
522 ms |
66272 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
596 KB |
Output is correct |
2 |
Correct |
3 ms |
764 KB |
Output is correct |
3 |
Correct |
2 ms |
740 KB |
Output is correct |
4 |
Correct |
3 ms |
724 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
3 ms |
724 KB |
Output is correct |
8 |
Correct |
3 ms |
724 KB |
Output is correct |
9 |
Correct |
4 ms |
756 KB |
Output is correct |
10 |
Correct |
3 ms |
764 KB |
Output is correct |
11 |
Correct |
4 ms |
724 KB |
Output is correct |
12 |
Correct |
3 ms |
724 KB |
Output is correct |
13 |
Correct |
3 ms |
724 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
724 KB |
Output is correct |
16 |
Correct |
3 ms |
724 KB |
Output is correct |
17 |
Correct |
3 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
772 KB |
Output is correct |
19 |
Correct |
3 ms |
716 KB |
Output is correct |
20 |
Correct |
3 ms |
716 KB |
Output is correct |
21 |
Correct |
138 ms |
14320 KB |
Output is correct |
22 |
Correct |
140 ms |
16016 KB |
Output is correct |
23 |
Correct |
117 ms |
15552 KB |
Output is correct |
24 |
Correct |
124 ms |
15532 KB |
Output is correct |
25 |
Correct |
137 ms |
15996 KB |
Output is correct |
26 |
Correct |
126 ms |
15972 KB |
Output is correct |
27 |
Correct |
20 ms |
3020 KB |
Output is correct |
28 |
Correct |
22 ms |
3080 KB |
Output is correct |
29 |
Correct |
127 ms |
15736 KB |
Output is correct |
30 |
Correct |
135 ms |
15692 KB |
Output is correct |
31 |
Correct |
115 ms |
15600 KB |
Output is correct |
32 |
Correct |
125 ms |
15680 KB |
Output is correct |
33 |
Correct |
129 ms |
13844 KB |
Output is correct |
34 |
Correct |
126 ms |
16040 KB |
Output is correct |
35 |
Correct |
110 ms |
14616 KB |
Output is correct |
36 |
Correct |
130 ms |
16564 KB |
Output is correct |
37 |
Correct |
133 ms |
14912 KB |
Output is correct |
38 |
Correct |
125 ms |
14676 KB |
Output is correct |
39 |
Correct |
18 ms |
2728 KB |
Output is correct |
40 |
Correct |
21 ms |
3088 KB |
Output is correct |
41 |
Correct |
103 ms |
15732 KB |
Output is correct |
42 |
Correct |
107 ms |
15716 KB |
Output is correct |
43 |
Correct |
132 ms |
15632 KB |
Output is correct |
44 |
Correct |
143 ms |
15656 KB |
Output is correct |
45 |
Correct |
136 ms |
15692 KB |
Output is correct |
46 |
Correct |
133 ms |
15692 KB |
Output is correct |
47 |
Correct |
68 ms |
14792 KB |
Output is correct |
48 |
Correct |
129 ms |
14888 KB |
Output is correct |
49 |
Correct |
99 ms |
12876 KB |
Output is correct |
50 |
Correct |
128 ms |
15112 KB |
Output is correct |
51 |
Correct |
195 ms |
15780 KB |
Output is correct |
52 |
Correct |
151 ms |
15720 KB |
Output is correct |
53 |
Correct |
94 ms |
14916 KB |
Output is correct |
54 |
Correct |
158 ms |
16556 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
102 ms |
14944 KB |
Output is correct |
2 |
Correct |
137 ms |
14492 KB |
Output is correct |
3 |
Correct |
125 ms |
15428 KB |
Output is correct |
4 |
Correct |
89 ms |
14028 KB |
Output is correct |
5 |
Correct |
97 ms |
14712 KB |
Output is correct |
6 |
Correct |
126 ms |
15340 KB |
Output is correct |
7 |
Correct |
28 ms |
2636 KB |
Output is correct |
8 |
Correct |
28 ms |
2616 KB |
Output is correct |
9 |
Correct |
72 ms |
14280 KB |
Output is correct |
10 |
Correct |
67 ms |
12888 KB |
Output is correct |
11 |
Correct |
101 ms |
14412 KB |
Output is correct |
12 |
Correct |
100 ms |
14412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
596 KB |
Output is correct |
2 |
Correct |
3 ms |
764 KB |
Output is correct |
3 |
Correct |
2 ms |
740 KB |
Output is correct |
4 |
Correct |
3 ms |
724 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
3 ms |
724 KB |
Output is correct |
8 |
Correct |
3 ms |
724 KB |
Output is correct |
9 |
Correct |
4 ms |
756 KB |
Output is correct |
10 |
Correct |
3 ms |
764 KB |
Output is correct |
11 |
Correct |
4 ms |
724 KB |
Output is correct |
12 |
Correct |
3 ms |
724 KB |
Output is correct |
13 |
Correct |
3 ms |
724 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
724 KB |
Output is correct |
16 |
Correct |
3 ms |
724 KB |
Output is correct |
17 |
Correct |
3 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
772 KB |
Output is correct |
19 |
Correct |
3 ms |
716 KB |
Output is correct |
20 |
Correct |
3 ms |
716 KB |
Output is correct |
21 |
Correct |
4 ms |
752 KB |
Output is correct |
22 |
Correct |
3 ms |
712 KB |
Output is correct |
23 |
Correct |
3 ms |
724 KB |
Output is correct |
24 |
Correct |
4 ms |
724 KB |
Output is correct |
25 |
Correct |
2 ms |
328 KB |
Output is correct |
26 |
Correct |
2 ms |
388 KB |
Output is correct |
27 |
Correct |
3 ms |
724 KB |
Output is correct |
28 |
Correct |
3 ms |
724 KB |
Output is correct |
29 |
Correct |
3 ms |
724 KB |
Output is correct |
30 |
Correct |
3 ms |
724 KB |
Output is correct |
31 |
Correct |
3 ms |
772 KB |
Output is correct |
32 |
Correct |
4 ms |
724 KB |
Output is correct |
33 |
Correct |
2 ms |
744 KB |
Output is correct |
34 |
Correct |
2 ms |
724 KB |
Output is correct |
35 |
Correct |
2 ms |
724 KB |
Output is correct |
36 |
Correct |
3 ms |
720 KB |
Output is correct |
37 |
Correct |
2 ms |
724 KB |
Output is correct |
38 |
Correct |
3 ms |
724 KB |
Output is correct |
39 |
Correct |
138 ms |
14320 KB |
Output is correct |
40 |
Correct |
140 ms |
16016 KB |
Output is correct |
41 |
Correct |
117 ms |
15552 KB |
Output is correct |
42 |
Correct |
124 ms |
15532 KB |
Output is correct |
43 |
Correct |
137 ms |
15996 KB |
Output is correct |
44 |
Correct |
126 ms |
15972 KB |
Output is correct |
45 |
Correct |
20 ms |
3020 KB |
Output is correct |
46 |
Correct |
22 ms |
3080 KB |
Output is correct |
47 |
Correct |
127 ms |
15736 KB |
Output is correct |
48 |
Correct |
135 ms |
15692 KB |
Output is correct |
49 |
Correct |
115 ms |
15600 KB |
Output is correct |
50 |
Correct |
125 ms |
15680 KB |
Output is correct |
51 |
Correct |
129 ms |
13844 KB |
Output is correct |
52 |
Correct |
126 ms |
16040 KB |
Output is correct |
53 |
Correct |
110 ms |
14616 KB |
Output is correct |
54 |
Correct |
130 ms |
16564 KB |
Output is correct |
55 |
Correct |
133 ms |
14912 KB |
Output is correct |
56 |
Correct |
125 ms |
14676 KB |
Output is correct |
57 |
Correct |
18 ms |
2728 KB |
Output is correct |
58 |
Correct |
21 ms |
3088 KB |
Output is correct |
59 |
Correct |
103 ms |
15732 KB |
Output is correct |
60 |
Correct |
107 ms |
15716 KB |
Output is correct |
61 |
Correct |
132 ms |
15632 KB |
Output is correct |
62 |
Correct |
143 ms |
15656 KB |
Output is correct |
63 |
Correct |
136 ms |
15692 KB |
Output is correct |
64 |
Correct |
133 ms |
15692 KB |
Output is correct |
65 |
Correct |
68 ms |
14792 KB |
Output is correct |
66 |
Correct |
129 ms |
14888 KB |
Output is correct |
67 |
Correct |
99 ms |
12876 KB |
Output is correct |
68 |
Correct |
128 ms |
15112 KB |
Output is correct |
69 |
Correct |
195 ms |
15780 KB |
Output is correct |
70 |
Correct |
151 ms |
15720 KB |
Output is correct |
71 |
Correct |
94 ms |
14916 KB |
Output is correct |
72 |
Correct |
158 ms |
16556 KB |
Output is correct |
73 |
Correct |
102 ms |
14944 KB |
Output is correct |
74 |
Correct |
137 ms |
14492 KB |
Output is correct |
75 |
Correct |
125 ms |
15428 KB |
Output is correct |
76 |
Correct |
89 ms |
14028 KB |
Output is correct |
77 |
Correct |
97 ms |
14712 KB |
Output is correct |
78 |
Correct |
126 ms |
15340 KB |
Output is correct |
79 |
Correct |
28 ms |
2636 KB |
Output is correct |
80 |
Correct |
28 ms |
2616 KB |
Output is correct |
81 |
Correct |
72 ms |
14280 KB |
Output is correct |
82 |
Correct |
67 ms |
12888 KB |
Output is correct |
83 |
Correct |
101 ms |
14412 KB |
Output is correct |
84 |
Correct |
100 ms |
14412 KB |
Output is correct |
85 |
Correct |
116 ms |
14808 KB |
Output is correct |
86 |
Correct |
135 ms |
16264 KB |
Output is correct |
87 |
Correct |
114 ms |
15632 KB |
Output is correct |
88 |
Correct |
130 ms |
16560 KB |
Output is correct |
89 |
Correct |
112 ms |
13644 KB |
Output is correct |
90 |
Correct |
113 ms |
16216 KB |
Output is correct |
91 |
Correct |
91 ms |
13636 KB |
Output is correct |
92 |
Correct |
96 ms |
13468 KB |
Output is correct |
93 |
Correct |
130 ms |
16204 KB |
Output is correct |
94 |
Correct |
128 ms |
16356 KB |
Output is correct |
95 |
Correct |
125 ms |
15612 KB |
Output is correct |
96 |
Correct |
113 ms |
16220 KB |
Output is correct |
97 |
Correct |
145 ms |
16248 KB |
Output is correct |
98 |
Correct |
123 ms |
13968 KB |
Output is correct |
99 |
Correct |
82 ms |
15288 KB |
Output is correct |
100 |
Correct |
78 ms |
14096 KB |
Output is correct |
101 |
Correct |
90 ms |
15404 KB |
Output is correct |
102 |
Correct |
104 ms |
17296 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
596 KB |
Output is correct |
2 |
Correct |
3 ms |
764 KB |
Output is correct |
3 |
Correct |
2 ms |
740 KB |
Output is correct |
4 |
Correct |
3 ms |
724 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
3 ms |
724 KB |
Output is correct |
8 |
Correct |
3 ms |
724 KB |
Output is correct |
9 |
Correct |
4 ms |
756 KB |
Output is correct |
10 |
Correct |
3 ms |
764 KB |
Output is correct |
11 |
Correct |
4 ms |
724 KB |
Output is correct |
12 |
Correct |
3 ms |
724 KB |
Output is correct |
13 |
Correct |
3 ms |
724 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
724 KB |
Output is correct |
16 |
Correct |
3 ms |
724 KB |
Output is correct |
17 |
Correct |
3 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
772 KB |
Output is correct |
19 |
Correct |
3 ms |
716 KB |
Output is correct |
20 |
Correct |
3 ms |
716 KB |
Output is correct |
21 |
Correct |
4 ms |
752 KB |
Output is correct |
22 |
Correct |
3 ms |
712 KB |
Output is correct |
23 |
Correct |
3 ms |
724 KB |
Output is correct |
24 |
Correct |
4 ms |
724 KB |
Output is correct |
25 |
Correct |
2 ms |
328 KB |
Output is correct |
26 |
Correct |
2 ms |
388 KB |
Output is correct |
27 |
Correct |
3 ms |
724 KB |
Output is correct |
28 |
Correct |
3 ms |
724 KB |
Output is correct |
29 |
Correct |
3 ms |
724 KB |
Output is correct |
30 |
Correct |
3 ms |
724 KB |
Output is correct |
31 |
Correct |
3 ms |
772 KB |
Output is correct |
32 |
Correct |
4 ms |
724 KB |
Output is correct |
33 |
Correct |
2 ms |
744 KB |
Output is correct |
34 |
Correct |
2 ms |
724 KB |
Output is correct |
35 |
Correct |
2 ms |
724 KB |
Output is correct |
36 |
Correct |
3 ms |
720 KB |
Output is correct |
37 |
Correct |
2 ms |
724 KB |
Output is correct |
38 |
Correct |
3 ms |
724 KB |
Output is correct |
39 |
Correct |
138 ms |
14320 KB |
Output is correct |
40 |
Correct |
140 ms |
16016 KB |
Output is correct |
41 |
Correct |
117 ms |
15552 KB |
Output is correct |
42 |
Correct |
124 ms |
15532 KB |
Output is correct |
43 |
Correct |
137 ms |
15996 KB |
Output is correct |
44 |
Correct |
126 ms |
15972 KB |
Output is correct |
45 |
Correct |
20 ms |
3020 KB |
Output is correct |
46 |
Correct |
22 ms |
3080 KB |
Output is correct |
47 |
Correct |
127 ms |
15736 KB |
Output is correct |
48 |
Correct |
135 ms |
15692 KB |
Output is correct |
49 |
Correct |
115 ms |
15600 KB |
Output is correct |
50 |
Correct |
125 ms |
15680 KB |
Output is correct |
51 |
Correct |
129 ms |
13844 KB |
Output is correct |
52 |
Correct |
126 ms |
16040 KB |
Output is correct |
53 |
Correct |
110 ms |
14616 KB |
Output is correct |
54 |
Correct |
130 ms |
16564 KB |
Output is correct |
55 |
Correct |
573 ms |
53724 KB |
Output is correct |
56 |
Correct |
483 ms |
53424 KB |
Output is correct |
57 |
Correct |
655 ms |
62800 KB |
Output is correct |
58 |
Correct |
512 ms |
58424 KB |
Output is correct |
59 |
Correct |
414 ms |
53580 KB |
Output is correct |
60 |
Correct |
638 ms |
63468 KB |
Output is correct |
61 |
Correct |
102 ms |
13080 KB |
Output is correct |
62 |
Correct |
151 ms |
12444 KB |
Output is correct |
63 |
Correct |
612 ms |
64756 KB |
Output is correct |
64 |
Correct |
601 ms |
64768 KB |
Output is correct |
65 |
Correct |
561 ms |
62500 KB |
Output is correct |
66 |
Correct |
614 ms |
62452 KB |
Output is correct |
67 |
Correct |
564 ms |
62324 KB |
Output is correct |
68 |
Correct |
592 ms |
62356 KB |
Output is correct |
69 |
Correct |
753 ms |
62228 KB |
Output is correct |
70 |
Correct |
736 ms |
62360 KB |
Output is correct |
71 |
Correct |
681 ms |
62256 KB |
Output is correct |
72 |
Correct |
606 ms |
62372 KB |
Output is correct |
73 |
Correct |
638 ms |
62384 KB |
Output is correct |
74 |
Correct |
786 ms |
62308 KB |
Output is correct |
75 |
Correct |
727 ms |
62296 KB |
Output is correct |
76 |
Correct |
599 ms |
62260 KB |
Output is correct |
77 |
Correct |
625 ms |
62352 KB |
Output is correct |
78 |
Correct |
651 ms |
62284 KB |
Output is correct |
79 |
Correct |
455 ms |
54664 KB |
Output is correct |
80 |
Correct |
453 ms |
59380 KB |
Output is correct |
81 |
Correct |
522 ms |
66272 KB |
Output is correct |
82 |
Correct |
133 ms |
14912 KB |
Output is correct |
83 |
Correct |
125 ms |
14676 KB |
Output is correct |
84 |
Correct |
18 ms |
2728 KB |
Output is correct |
85 |
Correct |
21 ms |
3088 KB |
Output is correct |
86 |
Correct |
103 ms |
15732 KB |
Output is correct |
87 |
Correct |
107 ms |
15716 KB |
Output is correct |
88 |
Correct |
132 ms |
15632 KB |
Output is correct |
89 |
Correct |
143 ms |
15656 KB |
Output is correct |
90 |
Correct |
136 ms |
15692 KB |
Output is correct |
91 |
Correct |
133 ms |
15692 KB |
Output is correct |
92 |
Correct |
68 ms |
14792 KB |
Output is correct |
93 |
Correct |
129 ms |
14888 KB |
Output is correct |
94 |
Correct |
99 ms |
12876 KB |
Output is correct |
95 |
Correct |
128 ms |
15112 KB |
Output is correct |
96 |
Correct |
195 ms |
15780 KB |
Output is correct |
97 |
Correct |
151 ms |
15720 KB |
Output is correct |
98 |
Correct |
94 ms |
14916 KB |
Output is correct |
99 |
Correct |
158 ms |
16556 KB |
Output is correct |
100 |
Correct |
102 ms |
14944 KB |
Output is correct |
101 |
Correct |
137 ms |
14492 KB |
Output is correct |
102 |
Correct |
125 ms |
15428 KB |
Output is correct |
103 |
Correct |
89 ms |
14028 KB |
Output is correct |
104 |
Correct |
97 ms |
14712 KB |
Output is correct |
105 |
Correct |
126 ms |
15340 KB |
Output is correct |
106 |
Correct |
28 ms |
2636 KB |
Output is correct |
107 |
Correct |
28 ms |
2616 KB |
Output is correct |
108 |
Correct |
72 ms |
14280 KB |
Output is correct |
109 |
Correct |
67 ms |
12888 KB |
Output is correct |
110 |
Correct |
101 ms |
14412 KB |
Output is correct |
111 |
Correct |
100 ms |
14412 KB |
Output is correct |
112 |
Correct |
116 ms |
14808 KB |
Output is correct |
113 |
Correct |
135 ms |
16264 KB |
Output is correct |
114 |
Correct |
114 ms |
15632 KB |
Output is correct |
115 |
Correct |
130 ms |
16560 KB |
Output is correct |
116 |
Correct |
112 ms |
13644 KB |
Output is correct |
117 |
Correct |
113 ms |
16216 KB |
Output is correct |
118 |
Correct |
91 ms |
13636 KB |
Output is correct |
119 |
Correct |
96 ms |
13468 KB |
Output is correct |
120 |
Correct |
130 ms |
16204 KB |
Output is correct |
121 |
Correct |
128 ms |
16356 KB |
Output is correct |
122 |
Correct |
125 ms |
15612 KB |
Output is correct |
123 |
Correct |
113 ms |
16220 KB |
Output is correct |
124 |
Correct |
145 ms |
16248 KB |
Output is correct |
125 |
Correct |
123 ms |
13968 KB |
Output is correct |
126 |
Correct |
82 ms |
15288 KB |
Output is correct |
127 |
Correct |
78 ms |
14096 KB |
Output is correct |
128 |
Correct |
90 ms |
15404 KB |
Output is correct |
129 |
Correct |
104 ms |
17296 KB |
Output is correct |
130 |
Correct |
691 ms |
62864 KB |
Output is correct |
131 |
Correct |
512 ms |
53096 KB |
Output is correct |
132 |
Correct |
841 ms |
63256 KB |
Output is correct |
133 |
Correct |
714 ms |
62564 KB |
Output is correct |
134 |
Correct |
511 ms |
60668 KB |
Output is correct |
135 |
Correct |
609 ms |
64168 KB |
Output is correct |
136 |
Correct |
619 ms |
65848 KB |
Output is correct |
137 |
Correct |
599 ms |
65824 KB |
Output is correct |
138 |
Correct |
579 ms |
62968 KB |
Output is correct |
139 |
Correct |
601 ms |
63060 KB |
Output is correct |
140 |
Correct |
667 ms |
62896 KB |
Output is correct |
141 |
Correct |
638 ms |
62944 KB |
Output is correct |
142 |
Correct |
638 ms |
62936 KB |
Output is correct |
143 |
Correct |
698 ms |
62852 KB |
Output is correct |
144 |
Correct |
640 ms |
62960 KB |
Output is correct |
145 |
Correct |
645 ms |
62984 KB |
Output is correct |
146 |
Correct |
725 ms |
62920 KB |
Output is correct |
147 |
Correct |
808 ms |
62972 KB |
Output is correct |
148 |
Correct |
698 ms |
62924 KB |
Output is correct |
149 |
Correct |
668 ms |
63044 KB |
Output is correct |
150 |
Correct |
318 ms |
59076 KB |
Output is correct |
151 |
Correct |
527 ms |
59948 KB |
Output is correct |
152 |
Correct |
438 ms |
59980 KB |
Output is correct |
153 |
Correct |
554 ms |
67068 KB |
Output is correct |