#include<bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1e18;
int n,m,q;
pair<pair<int,int>,pair<int,int>> aint[530000][3];
int lazy[530000][3];
pair<pair<int,int>,pair<int,int>> emp = {{INF,INF},{-INF,-INF}};
pair<pair<int,int>,pair<int,int>> combine(pair<pair<int,int>,pair<int,int>> x, pair<pair<int,int>,pair<int,int>> y)
{
return {min(x.first,y.first),max(x.second,y.second)};
}
void build(int nod, int st, int dr)
{
if(st==dr)
{
aint[nod][0] = aint[nod][1] = aint[nod][2] = {{0,st},{0,st}};
return;
}
int mij=(st+dr)/2;
build(nod*2,st,mij);
build(nod*2+1,mij+1,dr);
aint[nod][0] = combine(aint[nod*2][0], aint[nod*2+1][0]);
aint[nod][1] = combine(aint[nod*2][1], aint[nod*2+1][1]);
aint[nod][2] = combine(aint[nod*2][2], aint[nod*2+1][2]);
}
void propagate(int nod, int c)
{
if(!lazy[nod][c])
return;
lazy[nod*2][c]+=lazy[nod][c];
lazy[nod*2+1][c]+=lazy[nod][c];
aint[nod*2][c].first.first+=lazy[nod][c];
aint[nod*2][c].second.first+=lazy[nod][c];
aint[nod*2+1][c].first.first+=lazy[nod][c];
aint[nod*2+1][c].second.first+=lazy[nod][c];
lazy[nod][c]=0;
}
void upd(int nod, int st, int dr, int le, int ri, int newv, int c)
{
if(le>ri)
return;
if(le==st && dr==ri)
{
lazy[nod][c]+=newv;
aint[nod][c].first.first+=newv;
aint[nod][c].second.first+=newv;
return;
}
propagate(nod,c);
int mij=(st+dr)/2;
upd(nod*2,st,mij,le,min(mij,ri),newv,c);
upd(nod*2+1,mij+1,dr,max(mij+1,le),ri,newv,c);
aint[nod][c] = combine(aint[nod*2][c], aint[nod*2+1][c]);
}
pair<pair<int,int>,pair<int,int>> qry(int nod, int st, int dr, int le, int ri, int c)
{
if(le>ri)
return emp;
if(le==st && dr==ri)
return aint[nod][c];
propagate(nod,c);
int mij=(st+dr)/2;
return combine(qry(nod*2,st,mij,le,min(mij,ri),c),
qry(nod*2+1,mij+1,dr,max(mij+1,le),ri,c));
}
int cautare_binara(int nod, int st, int dr, int x)
{
if(st==dr)
{
if(aint[nod][1].first.first>=x)
return st;
else
return -1;
}
propagate(nod,1);
int mij=(st+dr)/2;
if(aint[nod*2][1].second.first>=x)
return cautare_binara(nod*2,st,mij,x);
else
return cautare_binara(nod*2+1,mij+1,dr,x);
}
vector<pair<int,int>> upds[250005];
vector<pair<int,int>> qrys[250005];
int rez[250005];
int cit[250005];
signed main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>n>>m>>q;
int tip,le,ri,c,k,a,b;
for(int i=1;i<=q;i++)
{
cin>>tip;
rez[i] = -7;
if(tip==1)
{
cin>>le>>ri>>c>>k;
upds[le].push_back({i,k});
upds[ri+1].push_back({i,-k});
cit[i]=c;
}
else if(tip==2)
{
cin>>le>>ri>>k;
upds[le].push_back({-i,k});
upds[ri+1].push_back({-i,-k});
}
else
{
cin>>a>>b;
qrys[a].push_back({b,i});
}
}
build(1,0,q);
for(int i=1;i<=n;i++)
{
for(auto [t,newv]:upds[i])
{
if(t < 0)
{
t = -t;
upd(1,0,q,t,q,-newv,0);
upd(1,0,q,t,q,newv,2);
}
else
{
upd(1,0,q,t,q,newv,0);
upd(1,0,q,t,q,newv,1);
}
}
for(auto [x,t]:qrys[i])
{
pair<pair<int,int>,pair<int,int>> aux = qry(1,0,q,0,t,0);
int ult = aux.first.second;
int scazute = qry(1,0,q,t,t,2).first.first - qry(1,0,q,ult,ult,2).first.first;
int pref1 = qry(1,0,q,ult,ult,1).first.first;
int ans = cautare_binara(1,0,q,x+pref1+scazute);
if(ans==-1 || ans>t)
{
rez[t]=0;
}
else
{
rez[t]=cit[ans];
}
}
}
for(int i=1;i<=q;i++)
{
if(rez[i]==-7)
continue;
cout<<rez[i]<<"\n";
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
12636 KB |
Output is correct |
2 |
Correct |
8 ms |
12636 KB |
Output is correct |
3 |
Correct |
7 ms |
12636 KB |
Output is correct |
4 |
Correct |
8 ms |
12636 KB |
Output is correct |
5 |
Correct |
6 ms |
12636 KB |
Output is correct |
6 |
Correct |
7 ms |
12600 KB |
Output is correct |
7 |
Correct |
8 ms |
12632 KB |
Output is correct |
8 |
Correct |
8 ms |
12836 KB |
Output is correct |
9 |
Correct |
8 ms |
12636 KB |
Output is correct |
10 |
Correct |
8 ms |
12636 KB |
Output is correct |
11 |
Correct |
7 ms |
12636 KB |
Output is correct |
12 |
Correct |
8 ms |
12836 KB |
Output is correct |
13 |
Correct |
8 ms |
12636 KB |
Output is correct |
14 |
Correct |
6 ms |
12636 KB |
Output is correct |
15 |
Correct |
7 ms |
12636 KB |
Output is correct |
16 |
Correct |
7 ms |
12748 KB |
Output is correct |
17 |
Correct |
8 ms |
12804 KB |
Output is correct |
18 |
Correct |
10 ms |
12632 KB |
Output is correct |
19 |
Correct |
10 ms |
12716 KB |
Output is correct |
20 |
Correct |
8 ms |
12592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
12636 KB |
Output is correct |
2 |
Correct |
8 ms |
12636 KB |
Output is correct |
3 |
Correct |
7 ms |
12636 KB |
Output is correct |
4 |
Correct |
8 ms |
12636 KB |
Output is correct |
5 |
Correct |
6 ms |
12636 KB |
Output is correct |
6 |
Correct |
7 ms |
12600 KB |
Output is correct |
7 |
Correct |
8 ms |
12632 KB |
Output is correct |
8 |
Correct |
8 ms |
12836 KB |
Output is correct |
9 |
Correct |
8 ms |
12636 KB |
Output is correct |
10 |
Correct |
8 ms |
12636 KB |
Output is correct |
11 |
Correct |
7 ms |
12636 KB |
Output is correct |
12 |
Correct |
8 ms |
12836 KB |
Output is correct |
13 |
Correct |
8 ms |
12636 KB |
Output is correct |
14 |
Correct |
6 ms |
12636 KB |
Output is correct |
15 |
Correct |
7 ms |
12636 KB |
Output is correct |
16 |
Correct |
7 ms |
12748 KB |
Output is correct |
17 |
Correct |
8 ms |
12804 KB |
Output is correct |
18 |
Correct |
10 ms |
12632 KB |
Output is correct |
19 |
Correct |
10 ms |
12716 KB |
Output is correct |
20 |
Correct |
8 ms |
12592 KB |
Output is correct |
21 |
Correct |
8 ms |
12636 KB |
Output is correct |
22 |
Correct |
8 ms |
12636 KB |
Output is correct |
23 |
Correct |
8 ms |
12636 KB |
Output is correct |
24 |
Correct |
13 ms |
12636 KB |
Output is correct |
25 |
Correct |
6 ms |
12636 KB |
Output is correct |
26 |
Correct |
10 ms |
12636 KB |
Output is correct |
27 |
Correct |
8 ms |
12632 KB |
Output is correct |
28 |
Correct |
7 ms |
12636 KB |
Output is correct |
29 |
Correct |
7 ms |
12644 KB |
Output is correct |
30 |
Correct |
8 ms |
12632 KB |
Output is correct |
31 |
Correct |
8 ms |
12636 KB |
Output is correct |
32 |
Correct |
7 ms |
12636 KB |
Output is correct |
33 |
Correct |
7 ms |
12636 KB |
Output is correct |
34 |
Correct |
7 ms |
12636 KB |
Output is correct |
35 |
Correct |
7 ms |
12776 KB |
Output is correct |
36 |
Correct |
8 ms |
12636 KB |
Output is correct |
37 |
Correct |
8 ms |
12636 KB |
Output is correct |
38 |
Correct |
8 ms |
12636 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
128 ms |
31496 KB |
Output is correct |
2 |
Correct |
127 ms |
31380 KB |
Output is correct |
3 |
Correct |
124 ms |
31316 KB |
Output is correct |
4 |
Correct |
130 ms |
31496 KB |
Output is correct |
5 |
Correct |
136 ms |
31568 KB |
Output is correct |
6 |
Correct |
129 ms |
31572 KB |
Output is correct |
7 |
Correct |
67 ms |
30140 KB |
Output is correct |
8 |
Correct |
68 ms |
30384 KB |
Output is correct |
9 |
Correct |
136 ms |
31580 KB |
Output is correct |
10 |
Correct |
123 ms |
31608 KB |
Output is correct |
11 |
Correct |
128 ms |
31312 KB |
Output is correct |
12 |
Correct |
130 ms |
31616 KB |
Output is correct |
13 |
Correct |
116 ms |
30920 KB |
Output is correct |
14 |
Correct |
130 ms |
31316 KB |
Output is correct |
15 |
Correct |
122 ms |
31632 KB |
Output is correct |
16 |
Correct |
126 ms |
31580 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
583 ms |
87476 KB |
Output is correct |
2 |
Correct |
482 ms |
89076 KB |
Output is correct |
3 |
Correct |
630 ms |
94704 KB |
Output is correct |
4 |
Correct |
451 ms |
89432 KB |
Output is correct |
5 |
Correct |
461 ms |
89644 KB |
Output is correct |
6 |
Correct |
640 ms |
95572 KB |
Output is correct |
7 |
Correct |
339 ms |
90480 KB |
Output is correct |
8 |
Correct |
332 ms |
89504 KB |
Output is correct |
9 |
Correct |
625 ms |
94104 KB |
Output is correct |
10 |
Correct |
608 ms |
93980 KB |
Output is correct |
11 |
Correct |
642 ms |
94096 KB |
Output is correct |
12 |
Correct |
635 ms |
95060 KB |
Output is correct |
13 |
Correct |
633 ms |
94208 KB |
Output is correct |
14 |
Correct |
675 ms |
95056 KB |
Output is correct |
15 |
Correct |
676 ms |
95068 KB |
Output is correct |
16 |
Correct |
656 ms |
95060 KB |
Output is correct |
17 |
Correct |
676 ms |
95056 KB |
Output is correct |
18 |
Correct |
632 ms |
94548 KB |
Output is correct |
19 |
Correct |
603 ms |
95016 KB |
Output is correct |
20 |
Correct |
642 ms |
94548 KB |
Output is correct |
21 |
Correct |
632 ms |
95084 KB |
Output is correct |
22 |
Correct |
623 ms |
95068 KB |
Output is correct |
23 |
Correct |
584 ms |
95108 KB |
Output is correct |
24 |
Correct |
656 ms |
95060 KB |
Output is correct |
25 |
Correct |
566 ms |
94420 KB |
Output is correct |
26 |
Correct |
560 ms |
94928 KB |
Output is correct |
27 |
Correct |
525 ms |
95568 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
12636 KB |
Output is correct |
2 |
Correct |
8 ms |
12636 KB |
Output is correct |
3 |
Correct |
7 ms |
12636 KB |
Output is correct |
4 |
Correct |
8 ms |
12636 KB |
Output is correct |
5 |
Correct |
6 ms |
12636 KB |
Output is correct |
6 |
Correct |
7 ms |
12600 KB |
Output is correct |
7 |
Correct |
8 ms |
12632 KB |
Output is correct |
8 |
Correct |
8 ms |
12836 KB |
Output is correct |
9 |
Correct |
8 ms |
12636 KB |
Output is correct |
10 |
Correct |
8 ms |
12636 KB |
Output is correct |
11 |
Correct |
7 ms |
12636 KB |
Output is correct |
12 |
Correct |
8 ms |
12836 KB |
Output is correct |
13 |
Correct |
8 ms |
12636 KB |
Output is correct |
14 |
Correct |
6 ms |
12636 KB |
Output is correct |
15 |
Correct |
7 ms |
12636 KB |
Output is correct |
16 |
Correct |
7 ms |
12748 KB |
Output is correct |
17 |
Correct |
8 ms |
12804 KB |
Output is correct |
18 |
Correct |
10 ms |
12632 KB |
Output is correct |
19 |
Correct |
10 ms |
12716 KB |
Output is correct |
20 |
Correct |
8 ms |
12592 KB |
Output is correct |
21 |
Correct |
128 ms |
31496 KB |
Output is correct |
22 |
Correct |
127 ms |
31380 KB |
Output is correct |
23 |
Correct |
124 ms |
31316 KB |
Output is correct |
24 |
Correct |
130 ms |
31496 KB |
Output is correct |
25 |
Correct |
136 ms |
31568 KB |
Output is correct |
26 |
Correct |
129 ms |
31572 KB |
Output is correct |
27 |
Correct |
67 ms |
30140 KB |
Output is correct |
28 |
Correct |
68 ms |
30384 KB |
Output is correct |
29 |
Correct |
136 ms |
31580 KB |
Output is correct |
30 |
Correct |
123 ms |
31608 KB |
Output is correct |
31 |
Correct |
128 ms |
31312 KB |
Output is correct |
32 |
Correct |
130 ms |
31616 KB |
Output is correct |
33 |
Correct |
116 ms |
30920 KB |
Output is correct |
34 |
Correct |
130 ms |
31316 KB |
Output is correct |
35 |
Correct |
122 ms |
31632 KB |
Output is correct |
36 |
Correct |
126 ms |
31580 KB |
Output is correct |
37 |
Correct |
123 ms |
31092 KB |
Output is correct |
38 |
Correct |
103 ms |
30808 KB |
Output is correct |
39 |
Correct |
59 ms |
30204 KB |
Output is correct |
40 |
Correct |
78 ms |
30264 KB |
Output is correct |
41 |
Correct |
130 ms |
31312 KB |
Output is correct |
42 |
Correct |
129 ms |
31572 KB |
Output is correct |
43 |
Correct |
142 ms |
31572 KB |
Output is correct |
44 |
Correct |
131 ms |
31460 KB |
Output is correct |
45 |
Correct |
130 ms |
31580 KB |
Output is correct |
46 |
Correct |
131 ms |
31580 KB |
Output is correct |
47 |
Correct |
77 ms |
30520 KB |
Output is correct |
48 |
Correct |
131 ms |
31568 KB |
Output is correct |
49 |
Correct |
94 ms |
30452 KB |
Output is correct |
50 |
Correct |
109 ms |
31052 KB |
Output is correct |
51 |
Correct |
135 ms |
31624 KB |
Output is correct |
52 |
Correct |
132 ms |
31572 KB |
Output is correct |
53 |
Correct |
95 ms |
30832 KB |
Output is correct |
54 |
Correct |
122 ms |
31712 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
110 ms |
30804 KB |
Output is correct |
2 |
Correct |
126 ms |
31344 KB |
Output is correct |
3 |
Correct |
129 ms |
31312 KB |
Output is correct |
4 |
Correct |
103 ms |
30296 KB |
Output is correct |
5 |
Correct |
110 ms |
30784 KB |
Output is correct |
6 |
Correct |
122 ms |
31188 KB |
Output is correct |
7 |
Correct |
70 ms |
30144 KB |
Output is correct |
8 |
Correct |
71 ms |
29780 KB |
Output is correct |
9 |
Correct |
88 ms |
30656 KB |
Output is correct |
10 |
Correct |
76 ms |
30176 KB |
Output is correct |
11 |
Correct |
113 ms |
30920 KB |
Output is correct |
12 |
Correct |
114 ms |
31056 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
12636 KB |
Output is correct |
2 |
Correct |
8 ms |
12636 KB |
Output is correct |
3 |
Correct |
7 ms |
12636 KB |
Output is correct |
4 |
Correct |
8 ms |
12636 KB |
Output is correct |
5 |
Correct |
6 ms |
12636 KB |
Output is correct |
6 |
Correct |
7 ms |
12600 KB |
Output is correct |
7 |
Correct |
8 ms |
12632 KB |
Output is correct |
8 |
Correct |
8 ms |
12836 KB |
Output is correct |
9 |
Correct |
8 ms |
12636 KB |
Output is correct |
10 |
Correct |
8 ms |
12636 KB |
Output is correct |
11 |
Correct |
7 ms |
12636 KB |
Output is correct |
12 |
Correct |
8 ms |
12836 KB |
Output is correct |
13 |
Correct |
8 ms |
12636 KB |
Output is correct |
14 |
Correct |
6 ms |
12636 KB |
Output is correct |
15 |
Correct |
7 ms |
12636 KB |
Output is correct |
16 |
Correct |
7 ms |
12748 KB |
Output is correct |
17 |
Correct |
8 ms |
12804 KB |
Output is correct |
18 |
Correct |
10 ms |
12632 KB |
Output is correct |
19 |
Correct |
10 ms |
12716 KB |
Output is correct |
20 |
Correct |
8 ms |
12592 KB |
Output is correct |
21 |
Correct |
8 ms |
12636 KB |
Output is correct |
22 |
Correct |
8 ms |
12636 KB |
Output is correct |
23 |
Correct |
8 ms |
12636 KB |
Output is correct |
24 |
Correct |
13 ms |
12636 KB |
Output is correct |
25 |
Correct |
6 ms |
12636 KB |
Output is correct |
26 |
Correct |
10 ms |
12636 KB |
Output is correct |
27 |
Correct |
8 ms |
12632 KB |
Output is correct |
28 |
Correct |
7 ms |
12636 KB |
Output is correct |
29 |
Correct |
7 ms |
12644 KB |
Output is correct |
30 |
Correct |
8 ms |
12632 KB |
Output is correct |
31 |
Correct |
8 ms |
12636 KB |
Output is correct |
32 |
Correct |
7 ms |
12636 KB |
Output is correct |
33 |
Correct |
7 ms |
12636 KB |
Output is correct |
34 |
Correct |
7 ms |
12636 KB |
Output is correct |
35 |
Correct |
7 ms |
12776 KB |
Output is correct |
36 |
Correct |
8 ms |
12636 KB |
Output is correct |
37 |
Correct |
8 ms |
12636 KB |
Output is correct |
38 |
Correct |
8 ms |
12636 KB |
Output is correct |
39 |
Correct |
128 ms |
31496 KB |
Output is correct |
40 |
Correct |
127 ms |
31380 KB |
Output is correct |
41 |
Correct |
124 ms |
31316 KB |
Output is correct |
42 |
Correct |
130 ms |
31496 KB |
Output is correct |
43 |
Correct |
136 ms |
31568 KB |
Output is correct |
44 |
Correct |
129 ms |
31572 KB |
Output is correct |
45 |
Correct |
67 ms |
30140 KB |
Output is correct |
46 |
Correct |
68 ms |
30384 KB |
Output is correct |
47 |
Correct |
136 ms |
31580 KB |
Output is correct |
48 |
Correct |
123 ms |
31608 KB |
Output is correct |
49 |
Correct |
128 ms |
31312 KB |
Output is correct |
50 |
Correct |
130 ms |
31616 KB |
Output is correct |
51 |
Correct |
116 ms |
30920 KB |
Output is correct |
52 |
Correct |
130 ms |
31316 KB |
Output is correct |
53 |
Correct |
122 ms |
31632 KB |
Output is correct |
54 |
Correct |
126 ms |
31580 KB |
Output is correct |
55 |
Correct |
123 ms |
31092 KB |
Output is correct |
56 |
Correct |
103 ms |
30808 KB |
Output is correct |
57 |
Correct |
59 ms |
30204 KB |
Output is correct |
58 |
Correct |
78 ms |
30264 KB |
Output is correct |
59 |
Correct |
130 ms |
31312 KB |
Output is correct |
60 |
Correct |
129 ms |
31572 KB |
Output is correct |
61 |
Correct |
142 ms |
31572 KB |
Output is correct |
62 |
Correct |
131 ms |
31460 KB |
Output is correct |
63 |
Correct |
130 ms |
31580 KB |
Output is correct |
64 |
Correct |
131 ms |
31580 KB |
Output is correct |
65 |
Correct |
77 ms |
30520 KB |
Output is correct |
66 |
Correct |
131 ms |
31568 KB |
Output is correct |
67 |
Correct |
94 ms |
30452 KB |
Output is correct |
68 |
Correct |
109 ms |
31052 KB |
Output is correct |
69 |
Correct |
135 ms |
31624 KB |
Output is correct |
70 |
Correct |
132 ms |
31572 KB |
Output is correct |
71 |
Correct |
95 ms |
30832 KB |
Output is correct |
72 |
Correct |
122 ms |
31712 KB |
Output is correct |
73 |
Correct |
110 ms |
30804 KB |
Output is correct |
74 |
Correct |
126 ms |
31344 KB |
Output is correct |
75 |
Correct |
129 ms |
31312 KB |
Output is correct |
76 |
Correct |
103 ms |
30296 KB |
Output is correct |
77 |
Correct |
110 ms |
30784 KB |
Output is correct |
78 |
Correct |
122 ms |
31188 KB |
Output is correct |
79 |
Correct |
70 ms |
30144 KB |
Output is correct |
80 |
Correct |
71 ms |
29780 KB |
Output is correct |
81 |
Correct |
88 ms |
30656 KB |
Output is correct |
82 |
Correct |
76 ms |
30176 KB |
Output is correct |
83 |
Correct |
113 ms |
30920 KB |
Output is correct |
84 |
Correct |
114 ms |
31056 KB |
Output is correct |
85 |
Correct |
114 ms |
31056 KB |
Output is correct |
86 |
Correct |
130 ms |
31572 KB |
Output is correct |
87 |
Correct |
116 ms |
31056 KB |
Output is correct |
88 |
Correct |
132 ms |
31520 KB |
Output is correct |
89 |
Correct |
88 ms |
30032 KB |
Output is correct |
90 |
Correct |
120 ms |
31596 KB |
Output is correct |
91 |
Correct |
105 ms |
30804 KB |
Output is correct |
92 |
Correct |
105 ms |
30692 KB |
Output is correct |
93 |
Correct |
127 ms |
31584 KB |
Output is correct |
94 |
Correct |
130 ms |
31456 KB |
Output is correct |
95 |
Correct |
125 ms |
31312 KB |
Output is correct |
96 |
Correct |
125 ms |
31600 KB |
Output is correct |
97 |
Correct |
129 ms |
31824 KB |
Output is correct |
98 |
Correct |
112 ms |
30804 KB |
Output is correct |
99 |
Correct |
77 ms |
30516 KB |
Output is correct |
100 |
Correct |
124 ms |
30624 KB |
Output is correct |
101 |
Correct |
117 ms |
31568 KB |
Output is correct |
102 |
Correct |
123 ms |
32052 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
12636 KB |
Output is correct |
2 |
Correct |
8 ms |
12636 KB |
Output is correct |
3 |
Correct |
7 ms |
12636 KB |
Output is correct |
4 |
Correct |
8 ms |
12636 KB |
Output is correct |
5 |
Correct |
6 ms |
12636 KB |
Output is correct |
6 |
Correct |
7 ms |
12600 KB |
Output is correct |
7 |
Correct |
8 ms |
12632 KB |
Output is correct |
8 |
Correct |
8 ms |
12836 KB |
Output is correct |
9 |
Correct |
8 ms |
12636 KB |
Output is correct |
10 |
Correct |
8 ms |
12636 KB |
Output is correct |
11 |
Correct |
7 ms |
12636 KB |
Output is correct |
12 |
Correct |
8 ms |
12836 KB |
Output is correct |
13 |
Correct |
8 ms |
12636 KB |
Output is correct |
14 |
Correct |
6 ms |
12636 KB |
Output is correct |
15 |
Correct |
7 ms |
12636 KB |
Output is correct |
16 |
Correct |
7 ms |
12748 KB |
Output is correct |
17 |
Correct |
8 ms |
12804 KB |
Output is correct |
18 |
Correct |
10 ms |
12632 KB |
Output is correct |
19 |
Correct |
10 ms |
12716 KB |
Output is correct |
20 |
Correct |
8 ms |
12592 KB |
Output is correct |
21 |
Correct |
8 ms |
12636 KB |
Output is correct |
22 |
Correct |
8 ms |
12636 KB |
Output is correct |
23 |
Correct |
8 ms |
12636 KB |
Output is correct |
24 |
Correct |
13 ms |
12636 KB |
Output is correct |
25 |
Correct |
6 ms |
12636 KB |
Output is correct |
26 |
Correct |
10 ms |
12636 KB |
Output is correct |
27 |
Correct |
8 ms |
12632 KB |
Output is correct |
28 |
Correct |
7 ms |
12636 KB |
Output is correct |
29 |
Correct |
7 ms |
12644 KB |
Output is correct |
30 |
Correct |
8 ms |
12632 KB |
Output is correct |
31 |
Correct |
8 ms |
12636 KB |
Output is correct |
32 |
Correct |
7 ms |
12636 KB |
Output is correct |
33 |
Correct |
7 ms |
12636 KB |
Output is correct |
34 |
Correct |
7 ms |
12636 KB |
Output is correct |
35 |
Correct |
7 ms |
12776 KB |
Output is correct |
36 |
Correct |
8 ms |
12636 KB |
Output is correct |
37 |
Correct |
8 ms |
12636 KB |
Output is correct |
38 |
Correct |
8 ms |
12636 KB |
Output is correct |
39 |
Correct |
128 ms |
31496 KB |
Output is correct |
40 |
Correct |
127 ms |
31380 KB |
Output is correct |
41 |
Correct |
124 ms |
31316 KB |
Output is correct |
42 |
Correct |
130 ms |
31496 KB |
Output is correct |
43 |
Correct |
136 ms |
31568 KB |
Output is correct |
44 |
Correct |
129 ms |
31572 KB |
Output is correct |
45 |
Correct |
67 ms |
30140 KB |
Output is correct |
46 |
Correct |
68 ms |
30384 KB |
Output is correct |
47 |
Correct |
136 ms |
31580 KB |
Output is correct |
48 |
Correct |
123 ms |
31608 KB |
Output is correct |
49 |
Correct |
128 ms |
31312 KB |
Output is correct |
50 |
Correct |
130 ms |
31616 KB |
Output is correct |
51 |
Correct |
116 ms |
30920 KB |
Output is correct |
52 |
Correct |
130 ms |
31316 KB |
Output is correct |
53 |
Correct |
122 ms |
31632 KB |
Output is correct |
54 |
Correct |
126 ms |
31580 KB |
Output is correct |
55 |
Correct |
583 ms |
87476 KB |
Output is correct |
56 |
Correct |
482 ms |
89076 KB |
Output is correct |
57 |
Correct |
630 ms |
94704 KB |
Output is correct |
58 |
Correct |
451 ms |
89432 KB |
Output is correct |
59 |
Correct |
461 ms |
89644 KB |
Output is correct |
60 |
Correct |
640 ms |
95572 KB |
Output is correct |
61 |
Correct |
339 ms |
90480 KB |
Output is correct |
62 |
Correct |
332 ms |
89504 KB |
Output is correct |
63 |
Correct |
625 ms |
94104 KB |
Output is correct |
64 |
Correct |
608 ms |
93980 KB |
Output is correct |
65 |
Correct |
642 ms |
94096 KB |
Output is correct |
66 |
Correct |
635 ms |
95060 KB |
Output is correct |
67 |
Correct |
633 ms |
94208 KB |
Output is correct |
68 |
Correct |
675 ms |
95056 KB |
Output is correct |
69 |
Correct |
676 ms |
95068 KB |
Output is correct |
70 |
Correct |
656 ms |
95060 KB |
Output is correct |
71 |
Correct |
676 ms |
95056 KB |
Output is correct |
72 |
Correct |
632 ms |
94548 KB |
Output is correct |
73 |
Correct |
603 ms |
95016 KB |
Output is correct |
74 |
Correct |
642 ms |
94548 KB |
Output is correct |
75 |
Correct |
632 ms |
95084 KB |
Output is correct |
76 |
Correct |
623 ms |
95068 KB |
Output is correct |
77 |
Correct |
584 ms |
95108 KB |
Output is correct |
78 |
Correct |
656 ms |
95060 KB |
Output is correct |
79 |
Correct |
566 ms |
94420 KB |
Output is correct |
80 |
Correct |
560 ms |
94928 KB |
Output is correct |
81 |
Correct |
525 ms |
95568 KB |
Output is correct |
82 |
Correct |
123 ms |
31092 KB |
Output is correct |
83 |
Correct |
103 ms |
30808 KB |
Output is correct |
84 |
Correct |
59 ms |
30204 KB |
Output is correct |
85 |
Correct |
78 ms |
30264 KB |
Output is correct |
86 |
Correct |
130 ms |
31312 KB |
Output is correct |
87 |
Correct |
129 ms |
31572 KB |
Output is correct |
88 |
Correct |
142 ms |
31572 KB |
Output is correct |
89 |
Correct |
131 ms |
31460 KB |
Output is correct |
90 |
Correct |
130 ms |
31580 KB |
Output is correct |
91 |
Correct |
131 ms |
31580 KB |
Output is correct |
92 |
Correct |
77 ms |
30520 KB |
Output is correct |
93 |
Correct |
131 ms |
31568 KB |
Output is correct |
94 |
Correct |
94 ms |
30452 KB |
Output is correct |
95 |
Correct |
109 ms |
31052 KB |
Output is correct |
96 |
Correct |
135 ms |
31624 KB |
Output is correct |
97 |
Correct |
132 ms |
31572 KB |
Output is correct |
98 |
Correct |
95 ms |
30832 KB |
Output is correct |
99 |
Correct |
122 ms |
31712 KB |
Output is correct |
100 |
Correct |
110 ms |
30804 KB |
Output is correct |
101 |
Correct |
126 ms |
31344 KB |
Output is correct |
102 |
Correct |
129 ms |
31312 KB |
Output is correct |
103 |
Correct |
103 ms |
30296 KB |
Output is correct |
104 |
Correct |
110 ms |
30784 KB |
Output is correct |
105 |
Correct |
122 ms |
31188 KB |
Output is correct |
106 |
Correct |
70 ms |
30144 KB |
Output is correct |
107 |
Correct |
71 ms |
29780 KB |
Output is correct |
108 |
Correct |
88 ms |
30656 KB |
Output is correct |
109 |
Correct |
76 ms |
30176 KB |
Output is correct |
110 |
Correct |
113 ms |
30920 KB |
Output is correct |
111 |
Correct |
114 ms |
31056 KB |
Output is correct |
112 |
Correct |
114 ms |
31056 KB |
Output is correct |
113 |
Correct |
130 ms |
31572 KB |
Output is correct |
114 |
Correct |
116 ms |
31056 KB |
Output is correct |
115 |
Correct |
132 ms |
31520 KB |
Output is correct |
116 |
Correct |
88 ms |
30032 KB |
Output is correct |
117 |
Correct |
120 ms |
31596 KB |
Output is correct |
118 |
Correct |
105 ms |
30804 KB |
Output is correct |
119 |
Correct |
105 ms |
30692 KB |
Output is correct |
120 |
Correct |
127 ms |
31584 KB |
Output is correct |
121 |
Correct |
130 ms |
31456 KB |
Output is correct |
122 |
Correct |
125 ms |
31312 KB |
Output is correct |
123 |
Correct |
125 ms |
31600 KB |
Output is correct |
124 |
Correct |
129 ms |
31824 KB |
Output is correct |
125 |
Correct |
112 ms |
30804 KB |
Output is correct |
126 |
Correct |
77 ms |
30516 KB |
Output is correct |
127 |
Correct |
124 ms |
30624 KB |
Output is correct |
128 |
Correct |
117 ms |
31568 KB |
Output is correct |
129 |
Correct |
123 ms |
32052 KB |
Output is correct |
130 |
Correct |
669 ms |
95312 KB |
Output is correct |
131 |
Correct |
456 ms |
89460 KB |
Output is correct |
132 |
Correct |
642 ms |
95220 KB |
Output is correct |
133 |
Correct |
609 ms |
94996 KB |
Output is correct |
134 |
Correct |
539 ms |
92712 KB |
Output is correct |
135 |
Correct |
611 ms |
96152 KB |
Output is correct |
136 |
Correct |
633 ms |
95060 KB |
Output is correct |
137 |
Correct |
640 ms |
95024 KB |
Output is correct |
138 |
Correct |
615 ms |
94848 KB |
Output is correct |
139 |
Correct |
641 ms |
95828 KB |
Output is correct |
140 |
Correct |
619 ms |
94796 KB |
Output is correct |
141 |
Correct |
616 ms |
95820 KB |
Output is correct |
142 |
Correct |
589 ms |
95756 KB |
Output is correct |
143 |
Correct |
642 ms |
95788 KB |
Output is correct |
144 |
Correct |
613 ms |
95316 KB |
Output is correct |
145 |
Correct |
616 ms |
95824 KB |
Output is correct |
146 |
Correct |
685 ms |
95392 KB |
Output is correct |
147 |
Correct |
644 ms |
95748 KB |
Output is correct |
148 |
Correct |
657 ms |
95748 KB |
Output is correct |
149 |
Correct |
655 ms |
95708 KB |
Output is correct |
150 |
Correct |
361 ms |
91260 KB |
Output is correct |
151 |
Correct |
601 ms |
95568 KB |
Output is correct |
152 |
Correct |
580 ms |
95520 KB |
Output is correct |
153 |
Correct |
511 ms |
96584 KB |
Output is correct |