#include<iostream>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include<cassert>
#include<unordered_map>
#include <queue>
#include <cstdint>
#include<cstring>
#include<limits.h>
#include<cmath>
#include<set>
#include<algorithm>
#include <iomanip>
#include<numeric>
#include<bitset>
using namespace std;
#define ll long long
#define f first
#define s second
#define pii pair<int,int>
#define ppii pair<int,pii>
#define vi vector<int>
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define F(n) for(int i=0;i<n;i++)
#define lb lower_bound
#define ub upper_bound
#define fastio ios::sync_with_stdio(false);cin.tie(NULL);
#pragma GCC optimize ("03,unroll-lopps")
#define int long long
#define double long double
using namespace std;
const int mod=998244353,mxn=1e6+5,inf=1e18,minf=-1e18,lg=30;
//#undef int
int n,k,m,q;
void setIO(string name){
ios_base::sync_with_stdio(0); cin.tie(0);
freopen((name+".in").c_str(),"r",stdin);
freopen((name+".out").c_str(),"w",stdout);
}
pair<int,pii> v1[mxn+10],v2[mxn+10];
//time,before,point
int gap[mxn+10],dp[mxn+10],suf[mxn+10];
struct seg{
int v[4*mxn+10],lazy1[4*mxn+10],lazy2[4*mxn+10];
void init(){for(int i=0;i<=4*(n+1);i++)lazy2[i]=inf,v[i]=minf;}
void build(int l,int r,int pos){
int mid=l+(r-l)/2;
v[pos]=0;
if(l==r)return;
build(l,mid,pos*2);
build(mid+1,r,pos*2+1);
}
void push(int l,int r,int pos){
if(lazy2[pos]!=inf)v[pos]=lazy2[pos];
v[pos]+=lazy1[pos];
if(l!=r){
if(lazy2[pos]!=inf)lazy1[pos*2+1]=0,lazy1[pos*2]=0;
lazy1[pos*2+1]+=lazy1[pos];
lazy1[pos*2]+=lazy1[pos];
if(lazy2[pos]!=inf){
lazy2[pos*2+1]=lazy2[pos];
lazy2[pos*2]=lazy2[pos];
}
}
lazy2[pos]=inf;
lazy1[pos]=0;
}
void updateadd(int l,int r,int ql,int qr,int val,int pos){
push(l,r,pos);
if(l>qr||r<ql)return;
if(l>=ql&&r<=qr){
lazy1[pos]+=val;
push(l,r,pos);
return;
}
int mid=l+(r-l)/2;
updateadd(l,mid,ql,qr,val,pos*2);
updateadd(mid+1,r,ql,qr,val,pos*2+1);
v[pos]=max(v[pos*2],v[pos*2+1]);
}
void updateset(int l,int r,int ql,int qr,int val,int pos){
push(l,r,pos);
if(l>qr||r<ql)return;
if(l>=ql&&r<=qr){
lazy2[pos]=val;
push(l,r,pos);
return;
}
int mid=l+(r-l)/2;
updateset(l,mid,ql,qr,val,pos*2);
updateset(mid+1,r,ql,qr,val,pos*2+1);
v[pos]=max(v[pos*2],v[pos*2+1]);
}
int qry(int l,int r,int qpos,int pos){
push(l,r,pos);
if(l==r)return v[pos];
int mid=l+(r-l)/2;
if(qpos<=mid)return qry(l,mid,qpos,pos*2);
return qry(mid+1,r,qpos,pos*2+1);
}
int search(int l,int r,int ql,int qr,int val,int pos){
//search pos where i<x
push(l,r,pos);
int mid=l+(r-l)/2;
if(l>qr||r<ql)return -1;
if(l>=ql&&r<=qr){
if(l==r){
if(v[pos]<val)return r;
return -1;
}
if(v[pos]<val)return r;
else{
push(l,mid,pos*2);
push(mid+1,r,pos*2+1);
if(v[pos*2]<val)return max(mid,search(mid+1,r,ql,qr,val,pos*2+1));
else return search(l,mid,ql,qr,val,pos*2);
}
}
return max(search(l,mid,ql,qr,val,pos*2),search(mid+1,r,ql,qr,val,pos*2+1));
}
}t;
int getbound(int x,int add){
int l=0,r=n,pos=-1;
while(l<=r){
int mid=l+(r-l)/2;
if(v1[mid].f+add<=x)l=mid+1,pos=max(pos,mid);
else r=mid-1;
}
return pos;
}
int getpos(int x,int st){
int l=st,r=n,pos=-1;
while(l<=r){
int mid=l+(r-l)/2;
if(t.qry(0,n,mid,1)<x)l=mid+1,pos=max(pos,mid);
else r=mid-1;
}
return pos;
}
int done[mxn+10];
int32_t main(){
fastio
//n^2 can use lazy seg to op
cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>v1[i].f>>v1[i].s.f>>v1[i].s.s;
v1[i].f+=v1[i-1].f;
}
for(int i=1;i<=m;i++){
cin>>v2[i].f>>v2[i].s.f>>v2[i].s.s;
v2[i].f+=v2[i-1].f;
}
int ans1=0,ans2=minf,add=0;
vector<pii>gap,gap2;
for(int i=1;i<=n;i++){
if(v1[i].f<=v1[i].s.f){
gap.pb({v1[i].s.f-v1[i].f,i});
ans1+=v1[i].s.s;
}
}
for(int i=1;i<=m;i++){
if(v2[i].f<=v2[i].s.f){
gap2.pb({v2[i].s.f-v2[i].f,i});
add+=v2[i].s.s;
}
}
t.init();
t.build(0,n,1);
sort(all(gap));
sort(all(gap2));
int cur=0,bruh,where,cur2=0;
for(int j=1;j<=m;j++){
if(!done[j]&&v2[j].f<=v2[j].s.f)add-=v2[j].s.s;
done[j]=1;
while(cur<gap.size()&&gap[cur].f<v2[j].f){
t.updateadd(0,n,0,gap[cur].s-1,-v1[gap[cur].s].s.s,1);
if(v1[gap[cur].s].s.s<0){
bruh=t.qry(0,n,gap[cur].s-1,1);
where=t.search(0,n,gap[cur].s,n,bruh,1);
if(where!=-1)t.updateset(0,n,gap[cur].s,where,bruh,1);
}
cur++;
}
while(cur2<gap2.size()&&gap2[cur2].f<v2[j].f+v1[n].f){
if(!done[gap2[cur2].s])add-=v2[gap2[cur2].s].s.s;
done[gap2[cur2].s]=1;
cur2++;
}
int x=getbound(v2[j].s.f,v2[j].f);
if(x!=-1)t.updateadd(0,n,0,x,v2[j].s.s,1);
t.push(0,n,1);
ans2=max(ans2,t.v[1]+add);
if(x!=-1){
bruh=t.qry(0,n,x,1);
where=t.search(0,n,x+1,n,bruh,1);
if(where!=-1)t.updateset(0,n,x+1,where,bruh,1);
}
}
cout<<ans1+ans2<<'\n';
}
/*
*/
Compilation message
dishes.cpp:32:40: warning: bad option '-funroll-lopps' to pragma 'optimize' [-Wpragmas]
32 | #pragma GCC optimize ("03,unroll-lopps")
| ^
dishes.cpp:39:23: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
39 | void setIO(string name){
| ^
dishes.cpp:49:15: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
49 | void init(){for(int i=0;i<=4*(n+1);i++)lazy2[i]=inf,v[i]=minf;}
| ^
dishes.cpp:50:35: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
50 | void build(int l,int r,int pos){
| ^
dishes.cpp:57:34: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
57 | void push(int l,int r,int pos){
| ^
dishes.cpp:72:61: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
72 | void updateadd(int l,int r,int ql,int qr,int val,int pos){
| ^
dishes.cpp:85:61: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
85 | void updateset(int l,int r,int ql,int qr,int val,int pos){
| ^
dishes.cpp:98:41: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
98 | int qry(int l,int r,int qpos,int pos){
| ^
dishes.cpp:105:57: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
105 | int search(int l,int r,int ql,int qr,int val,int pos){
| ^
dishes.cpp:126:27: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
126 | int getbound(int x,int add){
| ^
dishes.cpp:135:24: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
135 | int getpos(int x,int st){
| ^
dishes.cpp:145:14: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
145 | int32_t main(){
| ^
dishes.cpp: In function 'int32_t main()':
dishes.cpp:179:12: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
179 | while(cur<gap.size()&&gap[cur].f<v2[j].f){
| ~~~^~~~~~~~~~~
dishes.cpp:188:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
188 | while(cur2<gap2.size()&&gap2[cur2].f<v2[j].f+v1[n].f){
| ~~~~^~~~~~~~~~~~
dishes.cpp: In function 'void setIO(std::string)':
dishes.cpp:41:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
41 | freopen((name+".in").c_str(),"r",stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dishes.cpp:42:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
42 | freopen((name+".out").c_str(),"w",stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
253 ms |
46904 KB |
Output is correct |
2 |
Correct |
316 ms |
47160 KB |
Output is correct |
3 |
Correct |
135 ms |
43576 KB |
Output is correct |
4 |
Correct |
196 ms |
43660 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
284 ms |
45580 KB |
Output is correct |
7 |
Correct |
59 ms |
16512 KB |
Output is correct |
8 |
Correct |
66 ms |
27844 KB |
Output is correct |
9 |
Correct |
137 ms |
44600 KB |
Output is correct |
10 |
Correct |
341 ms |
41788 KB |
Output is correct |
11 |
Correct |
106 ms |
38200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
2 ms |
860 KB |
Output is correct |
18 |
Correct |
2 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
860 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
840 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
820 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
2 ms |
860 KB |
Output is correct |
18 |
Correct |
2 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
860 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
840 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
820 KB |
Output is correct |
24 |
Correct |
198 ms |
45532 KB |
Output is correct |
25 |
Correct |
250 ms |
39236 KB |
Output is correct |
26 |
Correct |
146 ms |
45248 KB |
Output is correct |
27 |
Correct |
221 ms |
43328 KB |
Output is correct |
28 |
Correct |
255 ms |
44292 KB |
Output is correct |
29 |
Correct |
120 ms |
41532 KB |
Output is correct |
30 |
Correct |
511 ms |
44968 KB |
Output is correct |
31 |
Correct |
69 ms |
15044 KB |
Output is correct |
32 |
Correct |
87 ms |
30148 KB |
Output is correct |
33 |
Correct |
302 ms |
41304 KB |
Output is correct |
34 |
Correct |
381 ms |
44600 KB |
Output is correct |
35 |
Correct |
493 ms |
38456 KB |
Output is correct |
36 |
Correct |
498 ms |
38456 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
2 ms |
860 KB |
Output is correct |
18 |
Correct |
2 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
860 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
840 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
820 KB |
Output is correct |
24 |
Correct |
198 ms |
45532 KB |
Output is correct |
25 |
Correct |
250 ms |
39236 KB |
Output is correct |
26 |
Correct |
146 ms |
45248 KB |
Output is correct |
27 |
Correct |
221 ms |
43328 KB |
Output is correct |
28 |
Correct |
255 ms |
44292 KB |
Output is correct |
29 |
Correct |
120 ms |
41532 KB |
Output is correct |
30 |
Correct |
511 ms |
44968 KB |
Output is correct |
31 |
Correct |
69 ms |
15044 KB |
Output is correct |
32 |
Correct |
87 ms |
30148 KB |
Output is correct |
33 |
Correct |
302 ms |
41304 KB |
Output is correct |
34 |
Correct |
381 ms |
44600 KB |
Output is correct |
35 |
Correct |
493 ms |
38456 KB |
Output is correct |
36 |
Correct |
498 ms |
38456 KB |
Output is correct |
37 |
Correct |
161 ms |
48424 KB |
Output is correct |
38 |
Correct |
247 ms |
46532 KB |
Output is correct |
39 |
Correct |
322 ms |
45372 KB |
Output is correct |
40 |
Correct |
347 ms |
45368 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
593 ms |
48140 KB |
Output is correct |
43 |
Correct |
329 ms |
44112 KB |
Output is correct |
44 |
Correct |
403 ms |
47416 KB |
Output is correct |
45 |
Correct |
527 ms |
41528 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
2 ms |
860 KB |
Output is correct |
18 |
Correct |
2 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
860 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
3 ms |
840 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
3 ms |
820 KB |
Output is correct |
24 |
Correct |
198 ms |
45532 KB |
Output is correct |
25 |
Correct |
250 ms |
39236 KB |
Output is correct |
26 |
Correct |
146 ms |
45248 KB |
Output is correct |
27 |
Correct |
221 ms |
43328 KB |
Output is correct |
28 |
Correct |
255 ms |
44292 KB |
Output is correct |
29 |
Correct |
120 ms |
41532 KB |
Output is correct |
30 |
Correct |
511 ms |
44968 KB |
Output is correct |
31 |
Correct |
69 ms |
15044 KB |
Output is correct |
32 |
Correct |
87 ms |
30148 KB |
Output is correct |
33 |
Correct |
302 ms |
41304 KB |
Output is correct |
34 |
Correct |
381 ms |
44600 KB |
Output is correct |
35 |
Correct |
493 ms |
38456 KB |
Output is correct |
36 |
Correct |
498 ms |
38456 KB |
Output is correct |
37 |
Correct |
161 ms |
48424 KB |
Output is correct |
38 |
Correct |
247 ms |
46532 KB |
Output is correct |
39 |
Correct |
322 ms |
45372 KB |
Output is correct |
40 |
Correct |
347 ms |
45368 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
593 ms |
48140 KB |
Output is correct |
43 |
Correct |
329 ms |
44112 KB |
Output is correct |
44 |
Correct |
403 ms |
47416 KB |
Output is correct |
45 |
Correct |
527 ms |
41528 KB |
Output is correct |
46 |
Correct |
902 ms |
235576 KB |
Output is correct |
47 |
Correct |
1253 ms |
227620 KB |
Output is correct |
48 |
Correct |
1788 ms |
221732 KB |
Output is correct |
49 |
Correct |
2062 ms |
221844 KB |
Output is correct |
50 |
Correct |
3968 ms |
235268 KB |
Output is correct |
51 |
Correct |
2210 ms |
210828 KB |
Output is correct |
52 |
Correct |
2479 ms |
226020 KB |
Output is correct |
53 |
Correct |
3763 ms |
203556 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
253 ms |
46904 KB |
Output is correct |
2 |
Correct |
316 ms |
47160 KB |
Output is correct |
3 |
Correct |
135 ms |
43576 KB |
Output is correct |
4 |
Correct |
196 ms |
43660 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
284 ms |
45580 KB |
Output is correct |
7 |
Correct |
59 ms |
16512 KB |
Output is correct |
8 |
Correct |
66 ms |
27844 KB |
Output is correct |
9 |
Correct |
137 ms |
44600 KB |
Output is correct |
10 |
Correct |
341 ms |
41788 KB |
Output is correct |
11 |
Correct |
106 ms |
38200 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
2 ms |
860 KB |
Output is correct |
29 |
Correct |
2 ms |
860 KB |
Output is correct |
30 |
Correct |
3 ms |
860 KB |
Output is correct |
31 |
Correct |
2 ms |
860 KB |
Output is correct |
32 |
Correct |
3 ms |
840 KB |
Output is correct |
33 |
Correct |
3 ms |
860 KB |
Output is correct |
34 |
Correct |
3 ms |
820 KB |
Output is correct |
35 |
Correct |
198 ms |
45532 KB |
Output is correct |
36 |
Correct |
250 ms |
39236 KB |
Output is correct |
37 |
Correct |
146 ms |
45248 KB |
Output is correct |
38 |
Correct |
221 ms |
43328 KB |
Output is correct |
39 |
Correct |
255 ms |
44292 KB |
Output is correct |
40 |
Correct |
120 ms |
41532 KB |
Output is correct |
41 |
Correct |
511 ms |
44968 KB |
Output is correct |
42 |
Correct |
69 ms |
15044 KB |
Output is correct |
43 |
Correct |
87 ms |
30148 KB |
Output is correct |
44 |
Correct |
302 ms |
41304 KB |
Output is correct |
45 |
Correct |
381 ms |
44600 KB |
Output is correct |
46 |
Correct |
493 ms |
38456 KB |
Output is correct |
47 |
Correct |
498 ms |
38456 KB |
Output is correct |
48 |
Correct |
161 ms |
48424 KB |
Output is correct |
49 |
Correct |
247 ms |
46532 KB |
Output is correct |
50 |
Correct |
322 ms |
45372 KB |
Output is correct |
51 |
Correct |
347 ms |
45368 KB |
Output is correct |
52 |
Correct |
1 ms |
348 KB |
Output is correct |
53 |
Correct |
593 ms |
48140 KB |
Output is correct |
54 |
Correct |
329 ms |
44112 KB |
Output is correct |
55 |
Correct |
403 ms |
47416 KB |
Output is correct |
56 |
Correct |
527 ms |
41528 KB |
Output is correct |
57 |
Correct |
268 ms |
48796 KB |
Output is correct |
58 |
Correct |
324 ms |
47168 KB |
Output is correct |
59 |
Incorrect |
340 ms |
46296 KB |
Output isn't correct |
60 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
253 ms |
46904 KB |
Output is correct |
2 |
Correct |
316 ms |
47160 KB |
Output is correct |
3 |
Correct |
135 ms |
43576 KB |
Output is correct |
4 |
Correct |
196 ms |
43660 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
284 ms |
45580 KB |
Output is correct |
7 |
Correct |
59 ms |
16512 KB |
Output is correct |
8 |
Correct |
66 ms |
27844 KB |
Output is correct |
9 |
Correct |
137 ms |
44600 KB |
Output is correct |
10 |
Correct |
341 ms |
41788 KB |
Output is correct |
11 |
Correct |
106 ms |
38200 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
2 ms |
860 KB |
Output is correct |
29 |
Correct |
2 ms |
860 KB |
Output is correct |
30 |
Correct |
3 ms |
860 KB |
Output is correct |
31 |
Correct |
2 ms |
860 KB |
Output is correct |
32 |
Correct |
3 ms |
840 KB |
Output is correct |
33 |
Correct |
3 ms |
860 KB |
Output is correct |
34 |
Correct |
3 ms |
820 KB |
Output is correct |
35 |
Correct |
198 ms |
45532 KB |
Output is correct |
36 |
Correct |
250 ms |
39236 KB |
Output is correct |
37 |
Correct |
146 ms |
45248 KB |
Output is correct |
38 |
Correct |
221 ms |
43328 KB |
Output is correct |
39 |
Correct |
255 ms |
44292 KB |
Output is correct |
40 |
Correct |
120 ms |
41532 KB |
Output is correct |
41 |
Correct |
511 ms |
44968 KB |
Output is correct |
42 |
Correct |
69 ms |
15044 KB |
Output is correct |
43 |
Correct |
87 ms |
30148 KB |
Output is correct |
44 |
Correct |
302 ms |
41304 KB |
Output is correct |
45 |
Correct |
381 ms |
44600 KB |
Output is correct |
46 |
Correct |
493 ms |
38456 KB |
Output is correct |
47 |
Correct |
498 ms |
38456 KB |
Output is correct |
48 |
Correct |
161 ms |
48424 KB |
Output is correct |
49 |
Correct |
247 ms |
46532 KB |
Output is correct |
50 |
Correct |
322 ms |
45372 KB |
Output is correct |
51 |
Correct |
347 ms |
45368 KB |
Output is correct |
52 |
Correct |
1 ms |
348 KB |
Output is correct |
53 |
Correct |
593 ms |
48140 KB |
Output is correct |
54 |
Correct |
329 ms |
44112 KB |
Output is correct |
55 |
Correct |
403 ms |
47416 KB |
Output is correct |
56 |
Correct |
527 ms |
41528 KB |
Output is correct |
57 |
Correct |
902 ms |
235576 KB |
Output is correct |
58 |
Correct |
1253 ms |
227620 KB |
Output is correct |
59 |
Correct |
1788 ms |
221732 KB |
Output is correct |
60 |
Correct |
2062 ms |
221844 KB |
Output is correct |
61 |
Correct |
3968 ms |
235268 KB |
Output is correct |
62 |
Correct |
2210 ms |
210828 KB |
Output is correct |
63 |
Correct |
2479 ms |
226020 KB |
Output is correct |
64 |
Correct |
3763 ms |
203556 KB |
Output is correct |
65 |
Correct |
268 ms |
48796 KB |
Output is correct |
66 |
Correct |
324 ms |
47168 KB |
Output is correct |
67 |
Incorrect |
340 ms |
46296 KB |
Output isn't correct |
68 |
Halted |
0 ms |
0 KB |
- |