#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
const ll INF=1e17;
ll n,m,q;
struct date
{
ll tip,l,r,k,c;
} v[250005];
vector<int> ev[250005];
bool comp(int a, int b)
{
return v[a].tip<v[b].tip;
}
pll arbmin[4*250005];
ll arbmax[4*250005],arbsum[4*250005];
ll topropmin[4*250005],topropmax[4*250005],topropsum[4*250005];
ll sol[250005];
void buildmin(ll nod,ll st,ll dr)
{
arbmin[nod]={0,st};
if(st==dr)
return;
ll mij=(st+dr)/2;
buildmin(nod*2,st,mij);
buildmin(nod*2+1,mij+1,dr);
}
void propmin(ll nod)
{
ll val=topropmin[nod];
arbmin[nod*2].first+=val;
arbmin[nod*2+1].first+=val;
topropmin[nod*2]+=val;
topropmin[nod*2+1]+=val;
}
void updatemin(ll nod,ll st,ll dr,ll a,ll b,ll val)
{
if(st<dr)
propmin(nod);
topropmin[nod]=0;
if(st>=a&&dr<=b)
{
arbmin[nod].first+=val;
topropmin[nod]+=val;
return;
}
ll mij=(st+dr)/2;
if(a<=mij)
updatemin(nod*2,st,mij,a,b,val);
if(b>mij)
updatemin(nod*2+1,mij+1,dr,a,b,val);
arbmin[nod]=min(arbmin[nod*2],arbmin[nod*2+1]);
}
pll querymin(ll nod,ll st,ll dr,ll a,ll b)
{
if(st<dr)
propmin(nod);
topropmin[nod]=0;
if(st>=a&&dr<=b)
return arbmin[nod];
pll rez={INF,INF};
ll mij=(st+dr)/2;
if(a<=mij)
rez=min(rez,querymin(nod*2,st,mij,a,b));
if(b>mij)
rez=min(rez,querymin(nod*2+1,mij+1,dr,a,b));
return rez;
}
void propmax(ll nod)
{
ll val=topropmax[nod];
arbmax[nod*2]+=val;
arbmax[nod*2+1]+=val;
topropmax[nod*2]+=val;
topropmax[nod*2+1]+=val;
}
void updatemax(ll nod,ll st,ll dr,ll a,ll b,ll val)
{
if(st<dr)
propmax(nod);
topropmax[nod]=0;
if(st>=a&&dr<=b)
{
arbmax[nod]+=val;
topropmax[nod]+=val;
return;
}
ll mij=(st+dr)/2;
if(a<=mij)
updatemax(nod*2,st,mij,a,b,val);
if(b>mij)
updatemax(nod*2+1,mij+1,dr,a,b,val);
arbmax[nod]=max(arbmax[nod*2],arbmax[nod*2+1]);
}
ll querymax(ll nod,ll st,ll dr,ll a,ll b)
{
if(st<dr)
propmax(nod);
topropmax[nod]=0;
if(st>=a&&dr<=b)
return arbmax[nod];
ll rez=0;
ll mij=(st+dr)/2;
if(a<=mij)
rez=max(rez,querymax(nod*2,st,mij,a,b));
if(b>mij)
rez=max(rez,querymax(nod*2+1,mij+1,dr,a,b));
return rez;
}
ll getfirst(ll nod,ll st,ll dr,ll val)
{
if(st<dr)
propmax(nod);
topropmax[nod]=0;
if(arbmax[nod]<val)
return INF;
if(st==dr)
return st;
ll mij=(st+dr)/2;
if(arbmax[nod*2]>=val)
return getfirst(nod*2,st,mij,val);
return getfirst(nod*2+1,mij+1,dr,val);
}
void updatesum(ll nod,ll st,ll dr,ll poz,ll val)
{
if(st==dr)
{
arbsum[nod]+=val;
return;
}
ll mij=(st+dr)/2;
if(poz<=mij)
updatesum(nod*2,st,mij,poz,val);
else
updatesum(nod*2+1,mij+1,dr,poz,val);
arbsum[nod]=arbsum[nod*2]+arbsum[nod*2+1];
}
ll querysum(ll nod,ll st,ll dr,ll a,ll b)
{
if(st>=a&&dr<=b)
return arbsum[nod];
ll mij=(st+dr)/2;
ll rez=0;
if(a<=mij)
rez+=querysum(nod*2,st,mij,a,b);
if(b>mij)
rez+=querysum(nod*2+1,mij+1,dr,a,b);
return rez;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n>>m>>q;
set<ll> setik;
for(int i=1;i<=q;i++)
{
cin>>v[i].tip;
if(v[i].tip==1)
{
cin>>v[i].l>>v[i].r>>v[i].c>>v[i].k;
ev[v[i].l].push_back(i);
ev[v[i].r+1].push_back(i);
setik.insert(v[i].l);
setik.insert(v[i].r+1);
}
if(v[i].tip==2)
{
cin>>v[i].l>>v[i].r>>v[i].k;
ev[v[i].l].push_back(i);
ev[v[i].r+1].push_back(i);
setik.insert(v[i].l);
setik.insert(v[i].r+1);
}
if(v[i].tip==3)
{
cin>>v[i].l>>v[i].k;
ev[v[i].l].push_back(i);
setik.insert(v[i].l);
}
}
buildmin(1,1,q);
for(int z:setik)
if(!ev[z].empty())
{
sort(ev[z].begin(),ev[z].end(),comp);
for(int i:ev[z])
{
if(v[i].tip==1)
{
if(z==v[i].l)
{
updatemin(1,1,q,i,q,v[i].k);
updatemax(1,1,q,i,q,v[i].k);
}
else
{
updatemin(1,1,q,i,q,-v[i].k);
updatemax(1,1,q,i,q,-v[i].k);
}
}
if(v[i].tip==2)
{
if(z==v[i].l)
{
updatemin(1,1,q,i,q,-v[i].k);
updatesum(1,1,q,i,-v[i].k);
}
else
{
updatemin(1,1,q,i,q,v[i].k);
updatesum(1,1,q,i,v[i].k);
}
}
if(v[i].tip==3)
{
bool ok=0;
if(i==22)
ok=1;
ll b=v[i].k;
ll t=querymax(1,1,q,1,19);
pll p=querymin(1,1,q,1,i);
ll st=1;
ll dr=i;
if(p.first<0)
st=p.second+1;
if(st>dr)
{
sol[i]=0;
continue;
}
ll x=querysum(1,1,q,st,dr);
b-=x;
if(st-1>0)
b+=querymax(1,1,q,1,st-1);
ll poz=getfirst(1,1,q,b);
if(poz<=dr)
sol[i]=v[poz].c;
}
}
}
for(int i=1;i<=q;i++)
if(v[i].tip==3)
cout<<sol[i]<<'\n';
return 0;
}
Compilation message
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:219:26: warning: variable 'ok' set but not used [-Wunused-but-set-variable]
219 | bool ok=0;
| ^~
foodcourt.cpp:223:24: warning: unused variable 't' [-Wunused-variable]
223 | ll t=querymax(1,1,q,1,19);
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14940 KB |
Output is correct |
2 |
Correct |
5 ms |
15024 KB |
Output is correct |
3 |
Correct |
5 ms |
14940 KB |
Output is correct |
4 |
Correct |
5 ms |
12892 KB |
Output is correct |
5 |
Correct |
4 ms |
14936 KB |
Output is correct |
6 |
Correct |
4 ms |
14764 KB |
Output is correct |
7 |
Correct |
6 ms |
14940 KB |
Output is correct |
8 |
Correct |
5 ms |
14940 KB |
Output is correct |
9 |
Correct |
5 ms |
14940 KB |
Output is correct |
10 |
Correct |
5 ms |
14940 KB |
Output is correct |
11 |
Correct |
5 ms |
15020 KB |
Output is correct |
12 |
Correct |
5 ms |
15196 KB |
Output is correct |
13 |
Correct |
4 ms |
14936 KB |
Output is correct |
14 |
Correct |
4 ms |
14832 KB |
Output is correct |
15 |
Correct |
4 ms |
14940 KB |
Output is correct |
16 |
Correct |
4 ms |
15020 KB |
Output is correct |
17 |
Correct |
4 ms |
15028 KB |
Output is correct |
18 |
Correct |
5 ms |
14940 KB |
Output is correct |
19 |
Correct |
5 ms |
13044 KB |
Output is correct |
20 |
Correct |
7 ms |
12892 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14940 KB |
Output is correct |
2 |
Correct |
5 ms |
15024 KB |
Output is correct |
3 |
Correct |
5 ms |
14940 KB |
Output is correct |
4 |
Correct |
5 ms |
12892 KB |
Output is correct |
5 |
Correct |
4 ms |
14936 KB |
Output is correct |
6 |
Correct |
4 ms |
14764 KB |
Output is correct |
7 |
Correct |
6 ms |
14940 KB |
Output is correct |
8 |
Correct |
5 ms |
14940 KB |
Output is correct |
9 |
Correct |
5 ms |
14940 KB |
Output is correct |
10 |
Correct |
5 ms |
14940 KB |
Output is correct |
11 |
Correct |
5 ms |
15020 KB |
Output is correct |
12 |
Correct |
5 ms |
15196 KB |
Output is correct |
13 |
Correct |
4 ms |
14936 KB |
Output is correct |
14 |
Correct |
4 ms |
14832 KB |
Output is correct |
15 |
Correct |
4 ms |
14940 KB |
Output is correct |
16 |
Correct |
4 ms |
15020 KB |
Output is correct |
17 |
Correct |
4 ms |
15028 KB |
Output is correct |
18 |
Correct |
5 ms |
14940 KB |
Output is correct |
19 |
Correct |
5 ms |
13044 KB |
Output is correct |
20 |
Correct |
7 ms |
12892 KB |
Output is correct |
21 |
Correct |
4 ms |
13140 KB |
Output is correct |
22 |
Correct |
4 ms |
12892 KB |
Output is correct |
23 |
Correct |
4 ms |
14940 KB |
Output is correct |
24 |
Correct |
4 ms |
12892 KB |
Output is correct |
25 |
Correct |
5 ms |
14856 KB |
Output is correct |
26 |
Correct |
4 ms |
14936 KB |
Output is correct |
27 |
Correct |
5 ms |
14940 KB |
Output is correct |
28 |
Correct |
6 ms |
14940 KB |
Output is correct |
29 |
Correct |
5 ms |
14940 KB |
Output is correct |
30 |
Correct |
5 ms |
14936 KB |
Output is correct |
31 |
Correct |
5 ms |
14940 KB |
Output is correct |
32 |
Correct |
5 ms |
14940 KB |
Output is correct |
33 |
Correct |
4 ms |
14940 KB |
Output is correct |
34 |
Correct |
5 ms |
14788 KB |
Output is correct |
35 |
Correct |
4 ms |
14920 KB |
Output is correct |
36 |
Correct |
5 ms |
14936 KB |
Output is correct |
37 |
Correct |
4 ms |
12892 KB |
Output is correct |
38 |
Correct |
4 ms |
12892 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
107 ms |
28756 KB |
Output is correct |
2 |
Correct |
113 ms |
30200 KB |
Output is correct |
3 |
Correct |
114 ms |
30036 KB |
Output is correct |
4 |
Correct |
106 ms |
30032 KB |
Output is correct |
5 |
Correct |
115 ms |
29012 KB |
Output is correct |
6 |
Correct |
106 ms |
30036 KB |
Output is correct |
7 |
Correct |
60 ms |
26060 KB |
Output is correct |
8 |
Correct |
81 ms |
26236 KB |
Output is correct |
9 |
Correct |
102 ms |
30112 KB |
Output is correct |
10 |
Correct |
110 ms |
30160 KB |
Output is correct |
11 |
Correct |
107 ms |
30028 KB |
Output is correct |
12 |
Correct |
122 ms |
30160 KB |
Output is correct |
13 |
Correct |
91 ms |
28920 KB |
Output is correct |
14 |
Correct |
118 ms |
30008 KB |
Output is correct |
15 |
Correct |
122 ms |
28360 KB |
Output is correct |
16 |
Correct |
124 ms |
29396 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
649 ms |
66080 KB |
Output is correct |
2 |
Correct |
479 ms |
66008 KB |
Output is correct |
3 |
Correct |
706 ms |
74024 KB |
Output is correct |
4 |
Correct |
539 ms |
67776 KB |
Output is correct |
5 |
Correct |
457 ms |
63964 KB |
Output is correct |
6 |
Correct |
758 ms |
73612 KB |
Output is correct |
7 |
Correct |
297 ms |
58048 KB |
Output is correct |
8 |
Correct |
317 ms |
57812 KB |
Output is correct |
9 |
Correct |
613 ms |
71076 KB |
Output is correct |
10 |
Correct |
624 ms |
73100 KB |
Output is correct |
11 |
Correct |
668 ms |
73976 KB |
Output is correct |
12 |
Correct |
705 ms |
74068 KB |
Output is correct |
13 |
Correct |
685 ms |
73688 KB |
Output is correct |
14 |
Correct |
682 ms |
73996 KB |
Output is correct |
15 |
Correct |
674 ms |
73828 KB |
Output is correct |
16 |
Correct |
710 ms |
73964 KB |
Output is correct |
17 |
Correct |
713 ms |
73848 KB |
Output is correct |
18 |
Correct |
709 ms |
73840 KB |
Output is correct |
19 |
Correct |
705 ms |
74188 KB |
Output is correct |
20 |
Correct |
740 ms |
73856 KB |
Output is correct |
21 |
Correct |
741 ms |
74068 KB |
Output is correct |
22 |
Correct |
728 ms |
73848 KB |
Output is correct |
23 |
Correct |
715 ms |
73860 KB |
Output is correct |
24 |
Correct |
733 ms |
73824 KB |
Output is correct |
25 |
Correct |
553 ms |
65104 KB |
Output is correct |
26 |
Correct |
510 ms |
65444 KB |
Output is correct |
27 |
Correct |
582 ms |
70336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14940 KB |
Output is correct |
2 |
Correct |
5 ms |
15024 KB |
Output is correct |
3 |
Correct |
5 ms |
14940 KB |
Output is correct |
4 |
Correct |
5 ms |
12892 KB |
Output is correct |
5 |
Correct |
4 ms |
14936 KB |
Output is correct |
6 |
Correct |
4 ms |
14764 KB |
Output is correct |
7 |
Correct |
6 ms |
14940 KB |
Output is correct |
8 |
Correct |
5 ms |
14940 KB |
Output is correct |
9 |
Correct |
5 ms |
14940 KB |
Output is correct |
10 |
Correct |
5 ms |
14940 KB |
Output is correct |
11 |
Correct |
5 ms |
15020 KB |
Output is correct |
12 |
Correct |
5 ms |
15196 KB |
Output is correct |
13 |
Correct |
4 ms |
14936 KB |
Output is correct |
14 |
Correct |
4 ms |
14832 KB |
Output is correct |
15 |
Correct |
4 ms |
14940 KB |
Output is correct |
16 |
Correct |
4 ms |
15020 KB |
Output is correct |
17 |
Correct |
4 ms |
15028 KB |
Output is correct |
18 |
Correct |
5 ms |
14940 KB |
Output is correct |
19 |
Correct |
5 ms |
13044 KB |
Output is correct |
20 |
Correct |
7 ms |
12892 KB |
Output is correct |
21 |
Correct |
107 ms |
28756 KB |
Output is correct |
22 |
Correct |
113 ms |
30200 KB |
Output is correct |
23 |
Correct |
114 ms |
30036 KB |
Output is correct |
24 |
Correct |
106 ms |
30032 KB |
Output is correct |
25 |
Correct |
115 ms |
29012 KB |
Output is correct |
26 |
Correct |
106 ms |
30036 KB |
Output is correct |
27 |
Correct |
60 ms |
26060 KB |
Output is correct |
28 |
Correct |
81 ms |
26236 KB |
Output is correct |
29 |
Correct |
102 ms |
30112 KB |
Output is correct |
30 |
Correct |
110 ms |
30160 KB |
Output is correct |
31 |
Correct |
107 ms |
30028 KB |
Output is correct |
32 |
Correct |
122 ms |
30160 KB |
Output is correct |
33 |
Correct |
91 ms |
28920 KB |
Output is correct |
34 |
Correct |
118 ms |
30008 KB |
Output is correct |
35 |
Correct |
122 ms |
28360 KB |
Output is correct |
36 |
Correct |
124 ms |
29396 KB |
Output is correct |
37 |
Correct |
117 ms |
29536 KB |
Output is correct |
38 |
Correct |
102 ms |
29416 KB |
Output is correct |
39 |
Correct |
56 ms |
26064 KB |
Output is correct |
40 |
Correct |
60 ms |
26056 KB |
Output is correct |
41 |
Correct |
117 ms |
29880 KB |
Output is correct |
42 |
Correct |
123 ms |
30088 KB |
Output is correct |
43 |
Correct |
138 ms |
30064 KB |
Output is correct |
44 |
Correct |
115 ms |
30032 KB |
Output is correct |
45 |
Correct |
112 ms |
30036 KB |
Output is correct |
46 |
Correct |
116 ms |
30036 KB |
Output is correct |
47 |
Correct |
81 ms |
27628 KB |
Output is correct |
48 |
Correct |
103 ms |
27748 KB |
Output is correct |
49 |
Correct |
79 ms |
28500 KB |
Output is correct |
50 |
Correct |
96 ms |
29692 KB |
Output is correct |
51 |
Correct |
113 ms |
30172 KB |
Output is correct |
52 |
Correct |
112 ms |
30036 KB |
Output is correct |
53 |
Correct |
92 ms |
29264 KB |
Output is correct |
54 |
Correct |
109 ms |
30184 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
102 ms |
26508 KB |
Output is correct |
2 |
Correct |
111 ms |
27988 KB |
Output is correct |
3 |
Correct |
106 ms |
28496 KB |
Output is correct |
4 |
Correct |
75 ms |
27216 KB |
Output is correct |
5 |
Correct |
91 ms |
27740 KB |
Output is correct |
6 |
Correct |
106 ms |
28500 KB |
Output is correct |
7 |
Correct |
56 ms |
24436 KB |
Output is correct |
8 |
Correct |
59 ms |
24532 KB |
Output is correct |
9 |
Correct |
81 ms |
26620 KB |
Output is correct |
10 |
Correct |
61 ms |
25680 KB |
Output is correct |
11 |
Correct |
100 ms |
26960 KB |
Output is correct |
12 |
Correct |
95 ms |
26960 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14940 KB |
Output is correct |
2 |
Correct |
5 ms |
15024 KB |
Output is correct |
3 |
Correct |
5 ms |
14940 KB |
Output is correct |
4 |
Correct |
5 ms |
12892 KB |
Output is correct |
5 |
Correct |
4 ms |
14936 KB |
Output is correct |
6 |
Correct |
4 ms |
14764 KB |
Output is correct |
7 |
Correct |
6 ms |
14940 KB |
Output is correct |
8 |
Correct |
5 ms |
14940 KB |
Output is correct |
9 |
Correct |
5 ms |
14940 KB |
Output is correct |
10 |
Correct |
5 ms |
14940 KB |
Output is correct |
11 |
Correct |
5 ms |
15020 KB |
Output is correct |
12 |
Correct |
5 ms |
15196 KB |
Output is correct |
13 |
Correct |
4 ms |
14936 KB |
Output is correct |
14 |
Correct |
4 ms |
14832 KB |
Output is correct |
15 |
Correct |
4 ms |
14940 KB |
Output is correct |
16 |
Correct |
4 ms |
15020 KB |
Output is correct |
17 |
Correct |
4 ms |
15028 KB |
Output is correct |
18 |
Correct |
5 ms |
14940 KB |
Output is correct |
19 |
Correct |
5 ms |
13044 KB |
Output is correct |
20 |
Correct |
7 ms |
12892 KB |
Output is correct |
21 |
Correct |
4 ms |
13140 KB |
Output is correct |
22 |
Correct |
4 ms |
12892 KB |
Output is correct |
23 |
Correct |
4 ms |
14940 KB |
Output is correct |
24 |
Correct |
4 ms |
12892 KB |
Output is correct |
25 |
Correct |
5 ms |
14856 KB |
Output is correct |
26 |
Correct |
4 ms |
14936 KB |
Output is correct |
27 |
Correct |
5 ms |
14940 KB |
Output is correct |
28 |
Correct |
6 ms |
14940 KB |
Output is correct |
29 |
Correct |
5 ms |
14940 KB |
Output is correct |
30 |
Correct |
5 ms |
14936 KB |
Output is correct |
31 |
Correct |
5 ms |
14940 KB |
Output is correct |
32 |
Correct |
5 ms |
14940 KB |
Output is correct |
33 |
Correct |
4 ms |
14940 KB |
Output is correct |
34 |
Correct |
5 ms |
14788 KB |
Output is correct |
35 |
Correct |
4 ms |
14920 KB |
Output is correct |
36 |
Correct |
5 ms |
14936 KB |
Output is correct |
37 |
Correct |
4 ms |
12892 KB |
Output is correct |
38 |
Correct |
4 ms |
12892 KB |
Output is correct |
39 |
Correct |
107 ms |
28756 KB |
Output is correct |
40 |
Correct |
113 ms |
30200 KB |
Output is correct |
41 |
Correct |
114 ms |
30036 KB |
Output is correct |
42 |
Correct |
106 ms |
30032 KB |
Output is correct |
43 |
Correct |
115 ms |
29012 KB |
Output is correct |
44 |
Correct |
106 ms |
30036 KB |
Output is correct |
45 |
Correct |
60 ms |
26060 KB |
Output is correct |
46 |
Correct |
81 ms |
26236 KB |
Output is correct |
47 |
Correct |
102 ms |
30112 KB |
Output is correct |
48 |
Correct |
110 ms |
30160 KB |
Output is correct |
49 |
Correct |
107 ms |
30028 KB |
Output is correct |
50 |
Correct |
122 ms |
30160 KB |
Output is correct |
51 |
Correct |
91 ms |
28920 KB |
Output is correct |
52 |
Correct |
118 ms |
30008 KB |
Output is correct |
53 |
Correct |
122 ms |
28360 KB |
Output is correct |
54 |
Correct |
124 ms |
29396 KB |
Output is correct |
55 |
Correct |
117 ms |
29536 KB |
Output is correct |
56 |
Correct |
102 ms |
29416 KB |
Output is correct |
57 |
Correct |
56 ms |
26064 KB |
Output is correct |
58 |
Correct |
60 ms |
26056 KB |
Output is correct |
59 |
Correct |
117 ms |
29880 KB |
Output is correct |
60 |
Correct |
123 ms |
30088 KB |
Output is correct |
61 |
Correct |
138 ms |
30064 KB |
Output is correct |
62 |
Correct |
115 ms |
30032 KB |
Output is correct |
63 |
Correct |
112 ms |
30036 KB |
Output is correct |
64 |
Correct |
116 ms |
30036 KB |
Output is correct |
65 |
Correct |
81 ms |
27628 KB |
Output is correct |
66 |
Correct |
103 ms |
27748 KB |
Output is correct |
67 |
Correct |
79 ms |
28500 KB |
Output is correct |
68 |
Correct |
96 ms |
29692 KB |
Output is correct |
69 |
Correct |
113 ms |
30172 KB |
Output is correct |
70 |
Correct |
112 ms |
30036 KB |
Output is correct |
71 |
Correct |
92 ms |
29264 KB |
Output is correct |
72 |
Correct |
109 ms |
30184 KB |
Output is correct |
73 |
Correct |
102 ms |
26508 KB |
Output is correct |
74 |
Correct |
111 ms |
27988 KB |
Output is correct |
75 |
Correct |
106 ms |
28496 KB |
Output is correct |
76 |
Correct |
75 ms |
27216 KB |
Output is correct |
77 |
Correct |
91 ms |
27740 KB |
Output is correct |
78 |
Correct |
106 ms |
28500 KB |
Output is correct |
79 |
Correct |
56 ms |
24436 KB |
Output is correct |
80 |
Correct |
59 ms |
24532 KB |
Output is correct |
81 |
Correct |
81 ms |
26620 KB |
Output is correct |
82 |
Correct |
61 ms |
25680 KB |
Output is correct |
83 |
Correct |
100 ms |
26960 KB |
Output is correct |
84 |
Correct |
95 ms |
26960 KB |
Output is correct |
85 |
Correct |
110 ms |
28752 KB |
Output is correct |
86 |
Correct |
117 ms |
30592 KB |
Output is correct |
87 |
Correct |
98 ms |
30124 KB |
Output is correct |
88 |
Correct |
114 ms |
29776 KB |
Output is correct |
89 |
Correct |
70 ms |
28788 KB |
Output is correct |
90 |
Correct |
131 ms |
30760 KB |
Output is correct |
91 |
Correct |
101 ms |
29012 KB |
Output is correct |
92 |
Correct |
101 ms |
29008 KB |
Output is correct |
93 |
Correct |
118 ms |
30580 KB |
Output is correct |
94 |
Correct |
110 ms |
30496 KB |
Output is correct |
95 |
Correct |
112 ms |
30276 KB |
Output is correct |
96 |
Correct |
167 ms |
30592 KB |
Output is correct |
97 |
Correct |
129 ms |
30584 KB |
Output is correct |
98 |
Correct |
111 ms |
29268 KB |
Output is correct |
99 |
Correct |
78 ms |
27976 KB |
Output is correct |
100 |
Correct |
85 ms |
27728 KB |
Output is correct |
101 |
Correct |
129 ms |
28504 KB |
Output is correct |
102 |
Correct |
102 ms |
30288 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
14940 KB |
Output is correct |
2 |
Correct |
5 ms |
15024 KB |
Output is correct |
3 |
Correct |
5 ms |
14940 KB |
Output is correct |
4 |
Correct |
5 ms |
12892 KB |
Output is correct |
5 |
Correct |
4 ms |
14936 KB |
Output is correct |
6 |
Correct |
4 ms |
14764 KB |
Output is correct |
7 |
Correct |
6 ms |
14940 KB |
Output is correct |
8 |
Correct |
5 ms |
14940 KB |
Output is correct |
9 |
Correct |
5 ms |
14940 KB |
Output is correct |
10 |
Correct |
5 ms |
14940 KB |
Output is correct |
11 |
Correct |
5 ms |
15020 KB |
Output is correct |
12 |
Correct |
5 ms |
15196 KB |
Output is correct |
13 |
Correct |
4 ms |
14936 KB |
Output is correct |
14 |
Correct |
4 ms |
14832 KB |
Output is correct |
15 |
Correct |
4 ms |
14940 KB |
Output is correct |
16 |
Correct |
4 ms |
15020 KB |
Output is correct |
17 |
Correct |
4 ms |
15028 KB |
Output is correct |
18 |
Correct |
5 ms |
14940 KB |
Output is correct |
19 |
Correct |
5 ms |
13044 KB |
Output is correct |
20 |
Correct |
7 ms |
12892 KB |
Output is correct |
21 |
Correct |
4 ms |
13140 KB |
Output is correct |
22 |
Correct |
4 ms |
12892 KB |
Output is correct |
23 |
Correct |
4 ms |
14940 KB |
Output is correct |
24 |
Correct |
4 ms |
12892 KB |
Output is correct |
25 |
Correct |
5 ms |
14856 KB |
Output is correct |
26 |
Correct |
4 ms |
14936 KB |
Output is correct |
27 |
Correct |
5 ms |
14940 KB |
Output is correct |
28 |
Correct |
6 ms |
14940 KB |
Output is correct |
29 |
Correct |
5 ms |
14940 KB |
Output is correct |
30 |
Correct |
5 ms |
14936 KB |
Output is correct |
31 |
Correct |
5 ms |
14940 KB |
Output is correct |
32 |
Correct |
5 ms |
14940 KB |
Output is correct |
33 |
Correct |
4 ms |
14940 KB |
Output is correct |
34 |
Correct |
5 ms |
14788 KB |
Output is correct |
35 |
Correct |
4 ms |
14920 KB |
Output is correct |
36 |
Correct |
5 ms |
14936 KB |
Output is correct |
37 |
Correct |
4 ms |
12892 KB |
Output is correct |
38 |
Correct |
4 ms |
12892 KB |
Output is correct |
39 |
Correct |
107 ms |
28756 KB |
Output is correct |
40 |
Correct |
113 ms |
30200 KB |
Output is correct |
41 |
Correct |
114 ms |
30036 KB |
Output is correct |
42 |
Correct |
106 ms |
30032 KB |
Output is correct |
43 |
Correct |
115 ms |
29012 KB |
Output is correct |
44 |
Correct |
106 ms |
30036 KB |
Output is correct |
45 |
Correct |
60 ms |
26060 KB |
Output is correct |
46 |
Correct |
81 ms |
26236 KB |
Output is correct |
47 |
Correct |
102 ms |
30112 KB |
Output is correct |
48 |
Correct |
110 ms |
30160 KB |
Output is correct |
49 |
Correct |
107 ms |
30028 KB |
Output is correct |
50 |
Correct |
122 ms |
30160 KB |
Output is correct |
51 |
Correct |
91 ms |
28920 KB |
Output is correct |
52 |
Correct |
118 ms |
30008 KB |
Output is correct |
53 |
Correct |
122 ms |
28360 KB |
Output is correct |
54 |
Correct |
124 ms |
29396 KB |
Output is correct |
55 |
Correct |
649 ms |
66080 KB |
Output is correct |
56 |
Correct |
479 ms |
66008 KB |
Output is correct |
57 |
Correct |
706 ms |
74024 KB |
Output is correct |
58 |
Correct |
539 ms |
67776 KB |
Output is correct |
59 |
Correct |
457 ms |
63964 KB |
Output is correct |
60 |
Correct |
758 ms |
73612 KB |
Output is correct |
61 |
Correct |
297 ms |
58048 KB |
Output is correct |
62 |
Correct |
317 ms |
57812 KB |
Output is correct |
63 |
Correct |
613 ms |
71076 KB |
Output is correct |
64 |
Correct |
624 ms |
73100 KB |
Output is correct |
65 |
Correct |
668 ms |
73976 KB |
Output is correct |
66 |
Correct |
705 ms |
74068 KB |
Output is correct |
67 |
Correct |
685 ms |
73688 KB |
Output is correct |
68 |
Correct |
682 ms |
73996 KB |
Output is correct |
69 |
Correct |
674 ms |
73828 KB |
Output is correct |
70 |
Correct |
710 ms |
73964 KB |
Output is correct |
71 |
Correct |
713 ms |
73848 KB |
Output is correct |
72 |
Correct |
709 ms |
73840 KB |
Output is correct |
73 |
Correct |
705 ms |
74188 KB |
Output is correct |
74 |
Correct |
740 ms |
73856 KB |
Output is correct |
75 |
Correct |
741 ms |
74068 KB |
Output is correct |
76 |
Correct |
728 ms |
73848 KB |
Output is correct |
77 |
Correct |
715 ms |
73860 KB |
Output is correct |
78 |
Correct |
733 ms |
73824 KB |
Output is correct |
79 |
Correct |
553 ms |
65104 KB |
Output is correct |
80 |
Correct |
510 ms |
65444 KB |
Output is correct |
81 |
Correct |
582 ms |
70336 KB |
Output is correct |
82 |
Correct |
117 ms |
29536 KB |
Output is correct |
83 |
Correct |
102 ms |
29416 KB |
Output is correct |
84 |
Correct |
56 ms |
26064 KB |
Output is correct |
85 |
Correct |
60 ms |
26056 KB |
Output is correct |
86 |
Correct |
117 ms |
29880 KB |
Output is correct |
87 |
Correct |
123 ms |
30088 KB |
Output is correct |
88 |
Correct |
138 ms |
30064 KB |
Output is correct |
89 |
Correct |
115 ms |
30032 KB |
Output is correct |
90 |
Correct |
112 ms |
30036 KB |
Output is correct |
91 |
Correct |
116 ms |
30036 KB |
Output is correct |
92 |
Correct |
81 ms |
27628 KB |
Output is correct |
93 |
Correct |
103 ms |
27748 KB |
Output is correct |
94 |
Correct |
79 ms |
28500 KB |
Output is correct |
95 |
Correct |
96 ms |
29692 KB |
Output is correct |
96 |
Correct |
113 ms |
30172 KB |
Output is correct |
97 |
Correct |
112 ms |
30036 KB |
Output is correct |
98 |
Correct |
92 ms |
29264 KB |
Output is correct |
99 |
Correct |
109 ms |
30184 KB |
Output is correct |
100 |
Correct |
102 ms |
26508 KB |
Output is correct |
101 |
Correct |
111 ms |
27988 KB |
Output is correct |
102 |
Correct |
106 ms |
28496 KB |
Output is correct |
103 |
Correct |
75 ms |
27216 KB |
Output is correct |
104 |
Correct |
91 ms |
27740 KB |
Output is correct |
105 |
Correct |
106 ms |
28500 KB |
Output is correct |
106 |
Correct |
56 ms |
24436 KB |
Output is correct |
107 |
Correct |
59 ms |
24532 KB |
Output is correct |
108 |
Correct |
81 ms |
26620 KB |
Output is correct |
109 |
Correct |
61 ms |
25680 KB |
Output is correct |
110 |
Correct |
100 ms |
26960 KB |
Output is correct |
111 |
Correct |
95 ms |
26960 KB |
Output is correct |
112 |
Correct |
110 ms |
28752 KB |
Output is correct |
113 |
Correct |
117 ms |
30592 KB |
Output is correct |
114 |
Correct |
98 ms |
30124 KB |
Output is correct |
115 |
Correct |
114 ms |
29776 KB |
Output is correct |
116 |
Correct |
70 ms |
28788 KB |
Output is correct |
117 |
Correct |
131 ms |
30760 KB |
Output is correct |
118 |
Correct |
101 ms |
29012 KB |
Output is correct |
119 |
Correct |
101 ms |
29008 KB |
Output is correct |
120 |
Correct |
118 ms |
30580 KB |
Output is correct |
121 |
Correct |
110 ms |
30496 KB |
Output is correct |
122 |
Correct |
112 ms |
30276 KB |
Output is correct |
123 |
Correct |
167 ms |
30592 KB |
Output is correct |
124 |
Correct |
129 ms |
30584 KB |
Output is correct |
125 |
Correct |
111 ms |
29268 KB |
Output is correct |
126 |
Correct |
78 ms |
27976 KB |
Output is correct |
127 |
Correct |
85 ms |
27728 KB |
Output is correct |
128 |
Correct |
129 ms |
28504 KB |
Output is correct |
129 |
Correct |
102 ms |
30288 KB |
Output is correct |
130 |
Correct |
722 ms |
73700 KB |
Output is correct |
131 |
Correct |
529 ms |
65876 KB |
Output is correct |
132 |
Correct |
767 ms |
74404 KB |
Output is correct |
133 |
Correct |
637 ms |
72244 KB |
Output is correct |
134 |
Correct |
644 ms |
72360 KB |
Output is correct |
135 |
Correct |
722 ms |
75088 KB |
Output is correct |
136 |
Correct |
610 ms |
73552 KB |
Output is correct |
137 |
Correct |
682 ms |
74404 KB |
Output is correct |
138 |
Correct |
647 ms |
74380 KB |
Output is correct |
139 |
Correct |
679 ms |
74560 KB |
Output is correct |
140 |
Correct |
753 ms |
74540 KB |
Output is correct |
141 |
Correct |
696 ms |
74656 KB |
Output is correct |
142 |
Correct |
727 ms |
74660 KB |
Output is correct |
143 |
Correct |
771 ms |
74508 KB |
Output is correct |
144 |
Correct |
713 ms |
74464 KB |
Output is correct |
145 |
Correct |
755 ms |
74584 KB |
Output is correct |
146 |
Correct |
735 ms |
74524 KB |
Output is correct |
147 |
Correct |
712 ms |
74796 KB |
Output is correct |
148 |
Correct |
783 ms |
74372 KB |
Output is correct |
149 |
Correct |
680 ms |
74576 KB |
Output is correct |
150 |
Correct |
418 ms |
64824 KB |
Output is correct |
151 |
Correct |
546 ms |
66128 KB |
Output is correct |
152 |
Correct |
551 ms |
66064 KB |
Output is correct |
153 |
Correct |
564 ms |
71252 KB |
Output is correct |