Submission #243709

# Submission time Handle Problem Language Result Execution time Memory
243709 2020-07-01T15:46:49 Z arnold518 Two Dishes (JOI19_dishes) C++14
100 / 100
7267 ms 119048 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAXN = 1e6;

int N, M;
ll A[MAXN+10], S[MAXN+10], P[MAXN+10];
ll B[MAXN+10], T[MAXN+10], Q[MAXN+10];
ll ans;

struct Point
{
	int x, y; ll w;
};
vector<Point> V;

ll tree[MAXN*4+10];
bool lazy[MAXN*4+10];

void busy(int node, int tl, int tr)
{
	if(!lazy[node]) return;
	tree[node]=0;
	if(tl!=tr) lazy[node*2]=true, lazy[node*2+1]=true;
	lazy[node]=false;
}

ll query(int node, int tl, int tr, int l, int r)
{
	busy(node, tl, tr);
	if(r<tl || tr<l) return 0;
	if(l<=tl && tr<=r) return tree[node];
	int mid=tl+tr>>1;
	ll t=query(node*2, tl, mid, l, r)+query(node*2+1, mid+1, tr, l, r);
	return t;
}

void update1(int node, int tl, int tr, int p, ll v)
{
	busy(node, tl, tr);
	if(tr<p) return;
	if(tl==tr)
	{
		tree[node]+=v;
		return;
	}
	int mid=tl+tr>>1;
	if(p<=mid) update1(node*2, tl, mid, p, v);
	else update1(node*2+1, mid+1, tr, p, v);
	tree[node]=0;
	if(!lazy[node*2]) tree[node]+=tree[node*2];
	if(!lazy[node*2+1]) tree[node]+=tree[node*2+1];
}

void update2(int node, int tl, int tr, int l, int r)
{
	busy(node, tl, tr);
	if(r<l) return;
	if(l<=tl && tr<=r)
	{
		lazy[node]=true;
		busy(node, tl, tr);
		return;
	}
	if(r<tl || tr<l) return;
	int mid=tl+tr>>1;
	update2(node*2, tl, mid, l, r);
	update2(node*2+1, mid+1, tr, l, r);
	tree[node]=tree[node*2]+tree[node*2+1];
}

int main()
{
	int i, j;

	scanf("%d%d", &N, &M);
	for(i=1; i<=N; i++) scanf("%lld%lld%lld", &A[i], &S[i], &P[i]), A[i]+=A[i-1];
	for(i=1; i<=M; i++) scanf("%lld%lld%lld", &B[i], &T[i], &Q[i]), B[i]+=B[i-1];

	for(i=1; i<=N; i++)
	{
		if(A[i]>S[i]) continue;
		int x=i, y=upper_bound(B+1, B+M+1, S[i]-A[i])-B-1;
		
		ans+=P[i];

		if(y!=M)
		{
			x--; y++;
			if(x!=N && y!=0) V.push_back({x, y, -P[i]});
		}
	}
	for(i=1; i<=M; i++)
	{
		if(B[i]>T[i]) continue;
		int y=i, x=upper_bound(A+1, A+N+1, T[i]-B[i])-A-1;
		
		if(x!=N && y!=0) V.push_back({x, y, Q[i]});
		else ans+=Q[i];
	}
	//printf("ANS %lld\n", ans);

	sort(V.begin(), V.end(), [&](const Point &p, const Point &q)
	{
		if(p.x!=q.x) return p.x<q.x;
		if(p.y!=q.y) return p.y>q.y;
		return p.w>q.w;
	});

	//for(i=0; i<V.size(); i++) printf("%d %d %lld\n", V[i].x, V[i].y, V[i].w);

	for(i=0; i<V.size(); i++)
	{	
		//printf("!%d %d %lld\n", V[i].x, V[i].y, V[i].w);
		int y=V[i].y; ll w=V[i].w;

		if(w>=0)
		{
			update1(1, 0, M, y, w);
		}
		else
		{
			int lo=0, hi=M+1;
			ll t=query(1, 0, M, 0, y-1)-w;
			while(lo+1<hi)
			{
				int mid=lo+hi>>1;
				if(query(1, 0, M, 0, mid)<=t) lo=mid;
				else hi=mid;
			}
			//printf("U2 %d %d\n", y, lo);
			ll p=query(1, 0, M, 0, hi), q=query(1, 0, M, hi, hi);
			update2(1, 0, M, y, lo);
			update1(1, 0, M, hi, -q+p-t);
		}
		//for(j=0; j<=M; j++) query(1, 0, M, 0, j);
		//for(j=0; j<=M; j++) printf("%lld ", query(1, 0, M, 0, j));
		//printf("\n");
	}
	//for(j=0; j<=M; j++) query(1, 0, M, 0, j);
	ans+=query(1, 0, M, 0, M);
	printf("%lld\n", ans);
}

Compilation message

dishes.cpp: In function 'll query(int, int, int, int, int)':
dishes.cpp:37:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int mid=tl+tr>>1;
          ~~^~~
dishes.cpp: In function 'void update1(int, int, int, int, ll)':
dishes.cpp:51:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int mid=tl+tr>>1;
          ~~^~~
dishes.cpp: In function 'void update2(int, int, int, int, int)':
dishes.cpp:70:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int mid=tl+tr>>1;
          ~~^~~
dishes.cpp: In function 'int main()':
dishes.cpp:116:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0; i<V.size(); i++)
           ~^~~~~~~~~
dishes.cpp:131:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
     int mid=lo+hi>>1;
             ~~^~~
dishes.cpp:78:9: warning: unused variable 'j' [-Wunused-variable]
  int i, j;
         ^
dishes.cpp:80:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &N, &M);
  ~~~~~^~~~~~~~~~~~~~~~
dishes.cpp:81:64: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(i=1; i<=N; i++) scanf("%lld%lld%lld", &A[i], &S[i], &P[i]), A[i]+=A[i-1];
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
dishes.cpp:82:64: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(i=1; i<=M; i++) scanf("%lld%lld%lld", &B[i], &T[i], &Q[i]), B[i]+=B[i-1];
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 664 ms 23632 KB Output is correct
2 Correct 607 ms 30288 KB Output is correct
3 Correct 223 ms 20696 KB Output is correct
4 Correct 511 ms 26204 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 637 ms 28644 KB Output is correct
7 Correct 103 ms 11896 KB Output is correct
8 Correct 108 ms 12024 KB Output is correct
9 Correct 214 ms 20760 KB Output is correct
10 Correct 708 ms 28368 KB Output is correct
11 Correct 162 ms 17656 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 512 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 5 ms 384 KB Output is correct
14 Correct 4 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 5 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 512 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 5 ms 384 KB Output is correct
14 Correct 4 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 5 ms 384 KB Output is correct
17 Correct 8 ms 640 KB Output is correct
18 Correct 7 ms 640 KB Output is correct
19 Correct 10 ms 768 KB Output is correct
20 Correct 8 ms 640 KB Output is correct
21 Correct 10 ms 768 KB Output is correct
22 Correct 10 ms 640 KB Output is correct
23 Correct 10 ms 640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 512 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 5 ms 384 KB Output is correct
14 Correct 4 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 5 ms 384 KB Output is correct
17 Correct 8 ms 640 KB Output is correct
18 Correct 7 ms 640 KB Output is correct
19 Correct 10 ms 768 KB Output is correct
20 Correct 8 ms 640 KB Output is correct
21 Correct 10 ms 768 KB Output is correct
22 Correct 10 ms 640 KB Output is correct
23 Correct 10 ms 640 KB Output is correct
24 Correct 517 ms 15848 KB Output is correct
25 Correct 264 ms 27720 KB Output is correct
26 Correct 712 ms 28340 KB Output is correct
27 Correct 250 ms 27740 KB Output is correct
28 Correct 436 ms 27004 KB Output is correct
29 Correct 191 ms 20984 KB Output is correct
30 Correct 1012 ms 31184 KB Output is correct
31 Correct 121 ms 16104 KB Output is correct
32 Correct 115 ms 12524 KB Output is correct
33 Correct 623 ms 27840 KB Output is correct
34 Correct 716 ms 29520 KB Output is correct
35 Correct 968 ms 24912 KB Output is correct
36 Correct 933 ms 24808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 512 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 5 ms 384 KB Output is correct
14 Correct 4 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 5 ms 384 KB Output is correct
17 Correct 8 ms 640 KB Output is correct
18 Correct 7 ms 640 KB Output is correct
19 Correct 10 ms 768 KB Output is correct
20 Correct 8 ms 640 KB Output is correct
21 Correct 10 ms 768 KB Output is correct
22 Correct 10 ms 640 KB Output is correct
23 Correct 10 ms 640 KB Output is correct
24 Correct 517 ms 15848 KB Output is correct
25 Correct 264 ms 27720 KB Output is correct
26 Correct 712 ms 28340 KB Output is correct
27 Correct 250 ms 27740 KB Output is correct
28 Correct 436 ms 27004 KB Output is correct
29 Correct 191 ms 20984 KB Output is correct
30 Correct 1012 ms 31184 KB Output is correct
31 Correct 121 ms 16104 KB Output is correct
32 Correct 115 ms 12524 KB Output is correct
33 Correct 623 ms 27840 KB Output is correct
34 Correct 716 ms 29520 KB Output is correct
35 Correct 968 ms 24912 KB Output is correct
36 Correct 933 ms 24808 KB Output is correct
37 Correct 554 ms 31488 KB Output is correct
38 Correct 283 ms 30812 KB Output is correct
39 Correct 716 ms 31696 KB Output is correct
40 Correct 686 ms 31828 KB Output is correct
41 Correct 5 ms 384 KB Output is correct
42 Correct 1050 ms 34668 KB Output is correct
43 Correct 649 ms 30808 KB Output is correct
44 Correct 726 ms 32348 KB Output is correct
45 Correct 994 ms 27984 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 512 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 5 ms 384 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 5 ms 384 KB Output is correct
14 Correct 4 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 5 ms 384 KB Output is correct
17 Correct 8 ms 640 KB Output is correct
18 Correct 7 ms 640 KB Output is correct
19 Correct 10 ms 768 KB Output is correct
20 Correct 8 ms 640 KB Output is correct
21 Correct 10 ms 768 KB Output is correct
22 Correct 10 ms 640 KB Output is correct
23 Correct 10 ms 640 KB Output is correct
24 Correct 517 ms 15848 KB Output is correct
25 Correct 264 ms 27720 KB Output is correct
26 Correct 712 ms 28340 KB Output is correct
27 Correct 250 ms 27740 KB Output is correct
28 Correct 436 ms 27004 KB Output is correct
29 Correct 191 ms 20984 KB Output is correct
30 Correct 1012 ms 31184 KB Output is correct
31 Correct 121 ms 16104 KB Output is correct
32 Correct 115 ms 12524 KB Output is correct
33 Correct 623 ms 27840 KB Output is correct
34 Correct 716 ms 29520 KB Output is correct
35 Correct 968 ms 24912 KB Output is correct
36 Correct 933 ms 24808 KB Output is correct
37 Correct 554 ms 31488 KB Output is correct
38 Correct 283 ms 30812 KB Output is correct
39 Correct 716 ms 31696 KB Output is correct
40 Correct 686 ms 31828 KB Output is correct
41 Correct 5 ms 384 KB Output is correct
42 Correct 1050 ms 34668 KB Output is correct
43 Correct 649 ms 30808 KB Output is correct
44 Correct 726 ms 32348 KB Output is correct
45 Correct 994 ms 27984 KB Output is correct
46 Correct 3051 ms 104116 KB Output is correct
47 Correct 1410 ms 102204 KB Output is correct
48 Correct 4091 ms 114052 KB Output is correct
49 Correct 3723 ms 114712 KB Output is correct
50 Correct 7066 ms 119048 KB Output is correct
51 Correct 4094 ms 100316 KB Output is correct
52 Correct 3904 ms 104664 KB Output is correct
53 Correct 6407 ms 106528 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 664 ms 23632 KB Output is correct
2 Correct 607 ms 30288 KB Output is correct
3 Correct 223 ms 20696 KB Output is correct
4 Correct 511 ms 26204 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 637 ms 28644 KB Output is correct
7 Correct 103 ms 11896 KB Output is correct
8 Correct 108 ms 12024 KB Output is correct
9 Correct 214 ms 20760 KB Output is correct
10 Correct 708 ms 28368 KB Output is correct
11 Correct 162 ms 17656 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 4 ms 384 KB Output is correct
14 Correct 5 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 4 ms 384 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 5 ms 384 KB Output is correct
19 Correct 5 ms 384 KB Output is correct
20 Correct 5 ms 512 KB Output is correct
21 Correct 5 ms 384 KB Output is correct
22 Correct 5 ms 384 KB Output is correct
23 Correct 5 ms 384 KB Output is correct
24 Correct 5 ms 384 KB Output is correct
25 Correct 4 ms 384 KB Output is correct
26 Correct 5 ms 384 KB Output is correct
27 Correct 5 ms 384 KB Output is correct
28 Correct 8 ms 640 KB Output is correct
29 Correct 7 ms 640 KB Output is correct
30 Correct 10 ms 768 KB Output is correct
31 Correct 8 ms 640 KB Output is correct
32 Correct 10 ms 768 KB Output is correct
33 Correct 10 ms 640 KB Output is correct
34 Correct 10 ms 640 KB Output is correct
35 Correct 517 ms 15848 KB Output is correct
36 Correct 264 ms 27720 KB Output is correct
37 Correct 712 ms 28340 KB Output is correct
38 Correct 250 ms 27740 KB Output is correct
39 Correct 436 ms 27004 KB Output is correct
40 Correct 191 ms 20984 KB Output is correct
41 Correct 1012 ms 31184 KB Output is correct
42 Correct 121 ms 16104 KB Output is correct
43 Correct 115 ms 12524 KB Output is correct
44 Correct 623 ms 27840 KB Output is correct
45 Correct 716 ms 29520 KB Output is correct
46 Correct 968 ms 24912 KB Output is correct
47 Correct 933 ms 24808 KB Output is correct
48 Correct 554 ms 31488 KB Output is correct
49 Correct 283 ms 30812 KB Output is correct
50 Correct 716 ms 31696 KB Output is correct
51 Correct 686 ms 31828 KB Output is correct
52 Correct 5 ms 384 KB Output is correct
53 Correct 1050 ms 34668 KB Output is correct
54 Correct 649 ms 30808 KB Output is correct
55 Correct 726 ms 32348 KB Output is correct
56 Correct 994 ms 27984 KB Output is correct
57 Correct 292 ms 31200 KB Output is correct
58 Correct 565 ms 31836 KB Output is correct
59 Correct 1006 ms 32724 KB Output is correct
60 Correct 349 ms 32208 KB Output is correct
61 Correct 392 ms 30928 KB Output is correct
62 Correct 5 ms 384 KB Output is correct
63 Correct 1078 ms 34512 KB Output is correct
64 Correct 659 ms 30808 KB Output is correct
65 Correct 858 ms 32716 KB Output is correct
66 Correct 970 ms 27980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 664 ms 23632 KB Output is correct
2 Correct 607 ms 30288 KB Output is correct
3 Correct 223 ms 20696 KB Output is correct
4 Correct 511 ms 26204 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 637 ms 28644 KB Output is correct
7 Correct 103 ms 11896 KB Output is correct
8 Correct 108 ms 12024 KB Output is correct
9 Correct 214 ms 20760 KB Output is correct
10 Correct 708 ms 28368 KB Output is correct
11 Correct 162 ms 17656 KB Output is correct
12 Correct 5 ms 384 KB Output is correct
13 Correct 4 ms 384 KB Output is correct
14 Correct 5 ms 384 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 4 ms 384 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 5 ms 384 KB Output is correct
19 Correct 5 ms 384 KB Output is correct
20 Correct 5 ms 512 KB Output is correct
21 Correct 5 ms 384 KB Output is correct
22 Correct 5 ms 384 KB Output is correct
23 Correct 5 ms 384 KB Output is correct
24 Correct 5 ms 384 KB Output is correct
25 Correct 4 ms 384 KB Output is correct
26 Correct 5 ms 384 KB Output is correct
27 Correct 5 ms 384 KB Output is correct
28 Correct 8 ms 640 KB Output is correct
29 Correct 7 ms 640 KB Output is correct
30 Correct 10 ms 768 KB Output is correct
31 Correct 8 ms 640 KB Output is correct
32 Correct 10 ms 768 KB Output is correct
33 Correct 10 ms 640 KB Output is correct
34 Correct 10 ms 640 KB Output is correct
35 Correct 517 ms 15848 KB Output is correct
36 Correct 264 ms 27720 KB Output is correct
37 Correct 712 ms 28340 KB Output is correct
38 Correct 250 ms 27740 KB Output is correct
39 Correct 436 ms 27004 KB Output is correct
40 Correct 191 ms 20984 KB Output is correct
41 Correct 1012 ms 31184 KB Output is correct
42 Correct 121 ms 16104 KB Output is correct
43 Correct 115 ms 12524 KB Output is correct
44 Correct 623 ms 27840 KB Output is correct
45 Correct 716 ms 29520 KB Output is correct
46 Correct 968 ms 24912 KB Output is correct
47 Correct 933 ms 24808 KB Output is correct
48 Correct 554 ms 31488 KB Output is correct
49 Correct 283 ms 30812 KB Output is correct
50 Correct 716 ms 31696 KB Output is correct
51 Correct 686 ms 31828 KB Output is correct
52 Correct 5 ms 384 KB Output is correct
53 Correct 1050 ms 34668 KB Output is correct
54 Correct 649 ms 30808 KB Output is correct
55 Correct 726 ms 32348 KB Output is correct
56 Correct 994 ms 27984 KB Output is correct
57 Correct 3051 ms 104116 KB Output is correct
58 Correct 1410 ms 102204 KB Output is correct
59 Correct 4091 ms 114052 KB Output is correct
60 Correct 3723 ms 114712 KB Output is correct
61 Correct 7066 ms 119048 KB Output is correct
62 Correct 4094 ms 100316 KB Output is correct
63 Correct 3904 ms 104664 KB Output is correct
64 Correct 6407 ms 106528 KB Output is correct
65 Correct 292 ms 31200 KB Output is correct
66 Correct 565 ms 31836 KB Output is correct
67 Correct 1006 ms 32724 KB Output is correct
68 Correct 349 ms 32208 KB Output is correct
69 Correct 392 ms 30928 KB Output is correct
70 Correct 5 ms 384 KB Output is correct
71 Correct 1078 ms 34512 KB Output is correct
72 Correct 659 ms 30808 KB Output is correct
73 Correct 858 ms 32716 KB Output is correct
74 Correct 970 ms 27980 KB Output is correct
75 Correct 1464 ms 102552 KB Output is correct
76 Correct 3040 ms 104312 KB Output is correct
77 Correct 5629 ms 114876 KB Output is correct
78 Correct 1715 ms 111600 KB Output is correct
79 Correct 7267 ms 115100 KB Output is correct
80 Correct 3917 ms 94268 KB Output is correct
81 Correct 4849 ms 99000 KB Output is correct
82 Correct 6830 ms 102936 KB Output is correct
83 Correct 7005 ms 104088 KB Output is correct