Submission #767928

# Submission time Handle Problem Language Result Execution time Memory
767928 2023-06-27T09:42:52 Z qwerasdfzxcl Two Dishes (JOI19_dishes) C++17
100 / 100
4412 ms 306528 KB
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
 
struct Block{
	int s, e;
	ll a0;
 
	Block(){}
	Block(int _s, int _e, ll _a0): s(_s), e(_e), a0(_a0) {}
};
 
vector<Block> buf;
 
struct Seg{
	int treeB[2202000];
 
	ll lazyBadd[2202000], lazyBidx[2202000];
 
	void init(int i, int l, int r, ll a[]){
		lazyBadd[i] = 0, lazyBidx[i] = -1;
		if (l==r){
			treeB[i] = 1;
			return;
		}
 
		int m = (l+r)>>1;
		init(i<<1, l, m, a); init(i<<1|1, m+1, r, a);
	}
 
	void propagate(int i, int l, int r){
		if (l==r){
			if (lazyBidx[i]!=-1) treeB[i] = lazyBidx[i];
			if (buf[treeB[i]].s==l) buf[treeB[i]].a0 += lazyBadd[i];
		}
 
		else{
			if (lazyBidx[i]!=-1){
				lazyBidx[i<<1] = lazyBidx[i];
				lazyBadd[i<<1] = 0;
				lazyBidx[i<<1|1] = lazyBidx[i];
				lazyBadd[i<<1|1] = 0;
			}
 
			lazyBadd[i<<1] += lazyBadd[i];
			lazyBadd[i<<1|1] += lazyBadd[i];
		}
 
		lazyBidx[i] = -1;
		lazyBadd[i] = 0;
	}
 
	void updateB(int i, int l, int r, int s, int e, int x){
		propagate(i, l, r);
		if (r<s || e<l) return;
		if (s<=l && r<=e){
			lazyBidx[i] = x;
			propagate(i, l, r);
			return;
		}
 
		int m = (l+r)>>1;
		updateB(i<<1, l, m, s, e, x); updateB(i<<1|1, m+1, r, s, e, x);
		// treeV[i] = treeV[i<<1] + treeV[i<<1|1];
	}
 
	void add(int i, int l, int r, int s, int e, int x){
		propagate(i, l, r);
		if (r<s || e<l) return;
		if (s<=l && r<=e){
			lazyBadd[i] += x;
			propagate(i, l, r);
			return;
		}
 
		int m = (l+r)>>1;
		add(i<<1, l, m, s, e, x); add(i<<1|1, m+1, r, s, e, x);
		// treeV[i] = treeV[i<<1] + treeV[i<<1|1];
	}
 
	int queryB(int i, int l, int r, int p){
		propagate(i, l, r);
		if (r<p || p<l) return 0;
		if (l==r) return treeB[i];
 
		int m = (l+r)>>1;
		return queryB(i<<1, l, m, p) | queryB(i<<1|1, m+1, r, p);
	}
}tree;

struct Fenwick{
	ll a[1001000], tree[1001000];
	int sz;

	void update(int p, ll x){
		ll d = x - a[p];
		a[p] = x;
		while(p<=sz){
			tree[p] += d;
			p += p&-p;
		}
	}

	ll sum(int p){
		ll ret = 0;
		while(p){
			ret += tree[p];
			p ^= p&-p;
		}
		return ret;
	}
}treeV;
 
int n, m;
ll A[1001000], B[1001000], S[1001000], T[1001000], P[1001000], Q[1001000];
ll sumA[1001000], sumB[1001000], W[1001000], mxA[1001000], mxB[1001000];
vector<int> Vp[1001000], Vm[1001000];
 
void init(){
	treeV.sz = n+1;
	for (int i=1;i<=n;i++) sumA[i] = sumA[i-1] + A[i];
	for (int i=1;i<=m;i++) sumB[i] = sumB[i-1] + B[i];
 
	for (int i=1;i<=n;i++){
		mxB[i] = upper_bound(sumB, sumB+m+1, S[i] - sumA[i]) - sumB - 1;
		
		if (mxB[i]==-1) W[i] = 0;
		else{
			W[i] = P[i];
			if (W[i] > 0) Vp[mxB[i]].push_back(i);
			else if (W[i] < 0) Vm[mxB[i]].push_back(i);
		}

		treeV.update(i, W[i]);
	}
	for (int i=1;i<=m;i++){
		mxA[i] = upper_bound(sumA, sumA+n+1, T[i] - sumB[i]) - sumA - 1;
	}
 
	// printf("mxB: ");
	// for (int i=1;i<=n;i++) printf("%lld ", mxB[i]);
	// printf("\nmxA: ");
	// for (int i=1;i<=m;i++) printf("%lld ", mxA[i]);
	// printf("\nW: ");
	// for (int i=1;i<=n;i++) printf("%lld ", W[i]);
	// printf("\n");
 
	buf.emplace_back();
	buf.emplace_back(0, n, 0);
	tree.init(1, 0, n, W);
}
 
 
int getidx(int x){
	int ret = tree.queryB(1, 0, n, x);
	if (x > buf[ret].s) tree.queryB(1, 0, n, buf[ret].s);
	return ret;
}
 
ll calc(int x, int idx = -1){
	if (idx==-1) idx = getidx(x);
	return buf[idx].a0 + (treeV.sum(x) - treeV.sum(buf[idx].s)); // tree.queryV(1, 0, n, buf[idx].s+1, x);
}
 
void split(int x){
	int idx = getidx(x);
	
	if (buf[idx].s==x) return;
 
	buf.emplace_back(buf[idx].s, x-1, buf[idx].a0);
	buf[idx].a0 += (treeV.sum(x) - treeV.sum(buf[idx].s)); // tree.queryV(1, 0, n, buf[idx].s+1, x);
	buf[idx].s = x;
 
	tree.updateB(1, 0, n, buf.back().s, x-1, (int)buf.size()-1);
}
 
void merge(int cur, int nxt){
	buf[cur].e = buf[nxt].e;
	tree.updateB(1, 0, n, buf[nxt].s, buf[nxt].e, cur);
}
 
void refresh(int x){
	int cur = getidx(x);
	int re = buf[cur].e;
 
	while(true){
		if (re==n) break;
		
		int nxt = getidx(re+1);
		// printf("cur: (%d, %d, %lld) / nxt: (%d, %d, %lld) / w = %lld\n", buf[cur].s, buf[cur].e, buf[cur].a0, buf[nxt].s, buf[nxt].e, buf[nxt].a0, tree.queryV(1, 0, n, buf[cur].e+1, buf[cur].e+1));
		if (calc(re, cur) + treeV.a[re+1] >= buf[nxt].a0) re = buf[nxt].e;
		else break;
	}
 
	tree.updateB(1, 0, n, buf[cur].e+1, re, cur);
	buf[cur].e = re;
}
 
void updateXp(int x, int w){ // between x-1 and x
	// printf("updateXp: %d\n", x);
	split(x);
	treeV.update(x, w);
}
 
void updateYp(int x, int q){
	// printf("updateYp: %d %d\n", x, q);
	tree.add(1, 0, n, 0, x, q);
	refresh(x);
}
 
void updateYm(int x, int q){
	if (x < n) split(x+1);
	tree.add(1, 0, n, 0, x, q);
}
 
void updateXm(int x){
	treeV.update(x, 0);
	refresh(x-1);
}
 
char FUCKYOU[100'000'000];
char *p = FUCKYOU;
#define SEX(x) (x)=0;while(*p<48)p++;while(47<*p)(x)=((x)<<3)+((x)<<1)+(*p++&15);

int main(){
	fread(FUCKYOU, 1, 100'000'000, stdin);
	SEX(n) SEX(m)
	for (int i=1;i<=n;i++){
		int flag = 0;
		SEX(A[i]) SEX(S[i]) 
		if (*++p==45) flag = 1;
		SEX(P[i])
		if (flag) P[i] = -P[i];
	}
	for (int i=1;i<=m;i++){
		int flag = 0;
		SEX(B[i]) SEX(T[i]) 
		if (*++p==45) flag = 1;
		SEX(Q[i])
		if (flag) Q[i] = -Q[i];
	}

	// ios_base::sync_with_stdio(0);
	// cin.tie(0);
 
	// cin >> n >> m;
	// for (int i=1;i<=n;i++) cin >> A[i] >> S[i] >> P[i];
	// for (int i=1;i<=m;i++) cin >> B[i] >> T[i] >> Q[i];
 
	init();
 
	for (int y=1;y<=m;y++){
		for (auto &x:Vp[y-1]) updateXp(x, 0);
		
		if (Q[y] > 0 && mxA[y] >= 0) updateYp(mxA[y], Q[y]);
		else if (Q[y] < 0 && mxA[y] >= 0) updateYm(mxA[y], Q[y]);
 
		for (auto &x:Vm[y-1]) updateXm(x);
		// for (int x=0;x<=n;x++) printf("%lld ", calc(x));
		// printf("\n");
	}
 
	printf("%lld\n", calc(n));
}

Compilation message

dishes.cpp: In function 'int main()':
dishes.cpp:227:7: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  227 |  fread(FUCKYOU, 1, 100'000'000, stdin);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 320 ms 99620 KB Output is correct
2 Correct 304 ms 99700 KB Output is correct
3 Correct 117 ms 92524 KB Output is correct
4 Correct 229 ms 97500 KB Output is correct
5 Correct 26 ms 47436 KB Output is correct
6 Correct 319 ms 98448 KB Output is correct
7 Correct 44 ms 62712 KB Output is correct
8 Correct 47 ms 78200 KB Output is correct
9 Correct 114 ms 93688 KB Output is correct
10 Correct 365 ms 96016 KB Output is correct
11 Correct 104 ms 86948 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 47444 KB Output is correct
2 Correct 22 ms 47404 KB Output is correct
3 Correct 26 ms 47348 KB Output is correct
4 Correct 22 ms 47456 KB Output is correct
5 Correct 24 ms 47352 KB Output is correct
6 Correct 22 ms 47444 KB Output is correct
7 Correct 28 ms 47444 KB Output is correct
8 Correct 23 ms 47436 KB Output is correct
9 Correct 24 ms 47436 KB Output is correct
10 Correct 29 ms 47452 KB Output is correct
11 Correct 23 ms 47324 KB Output is correct
12 Correct 21 ms 47332 KB Output is correct
13 Correct 22 ms 47444 KB Output is correct
14 Correct 23 ms 47444 KB Output is correct
15 Correct 22 ms 47392 KB Output is correct
16 Correct 23 ms 47352 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 47444 KB Output is correct
2 Correct 22 ms 47404 KB Output is correct
3 Correct 26 ms 47348 KB Output is correct
4 Correct 22 ms 47456 KB Output is correct
5 Correct 24 ms 47352 KB Output is correct
6 Correct 22 ms 47444 KB Output is correct
7 Correct 28 ms 47444 KB Output is correct
8 Correct 23 ms 47436 KB Output is correct
9 Correct 24 ms 47436 KB Output is correct
10 Correct 29 ms 47452 KB Output is correct
11 Correct 23 ms 47324 KB Output is correct
12 Correct 21 ms 47332 KB Output is correct
13 Correct 22 ms 47444 KB Output is correct
14 Correct 23 ms 47444 KB Output is correct
15 Correct 22 ms 47392 KB Output is correct
16 Correct 23 ms 47352 KB Output is correct
17 Correct 24 ms 47940 KB Output is correct
18 Correct 23 ms 47828 KB Output is correct
19 Correct 27 ms 48092 KB Output is correct
20 Correct 27 ms 47948 KB Output is correct
21 Correct 29 ms 47996 KB Output is correct
22 Correct 25 ms 47816 KB Output is correct
23 Correct 32 ms 47908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 47444 KB Output is correct
2 Correct 22 ms 47404 KB Output is correct
3 Correct 26 ms 47348 KB Output is correct
4 Correct 22 ms 47456 KB Output is correct
5 Correct 24 ms 47352 KB Output is correct
6 Correct 22 ms 47444 KB Output is correct
7 Correct 28 ms 47444 KB Output is correct
8 Correct 23 ms 47436 KB Output is correct
9 Correct 24 ms 47436 KB Output is correct
10 Correct 29 ms 47452 KB Output is correct
11 Correct 23 ms 47324 KB Output is correct
12 Correct 21 ms 47332 KB Output is correct
13 Correct 22 ms 47444 KB Output is correct
14 Correct 23 ms 47444 KB Output is correct
15 Correct 22 ms 47392 KB Output is correct
16 Correct 23 ms 47352 KB Output is correct
17 Correct 24 ms 47940 KB Output is correct
18 Correct 23 ms 47828 KB Output is correct
19 Correct 27 ms 48092 KB Output is correct
20 Correct 27 ms 47948 KB Output is correct
21 Correct 29 ms 47996 KB Output is correct
22 Correct 25 ms 47816 KB Output is correct
23 Correct 32 ms 47908 KB Output is correct
24 Correct 202 ms 93788 KB Output is correct
25 Correct 116 ms 89260 KB Output is correct
26 Correct 197 ms 99280 KB Output is correct
27 Correct 149 ms 89448 KB Output is correct
28 Correct 238 ms 91952 KB Output is correct
29 Correct 112 ms 90432 KB Output is correct
30 Correct 603 ms 97076 KB Output is correct
31 Correct 44 ms 61164 KB Output is correct
32 Correct 96 ms 78552 KB Output is correct
33 Correct 347 ms 92940 KB Output is correct
34 Correct 463 ms 95428 KB Output is correct
35 Correct 618 ms 90376 KB Output is correct
36 Correct 606 ms 90428 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 47444 KB Output is correct
2 Correct 22 ms 47404 KB Output is correct
3 Correct 26 ms 47348 KB Output is correct
4 Correct 22 ms 47456 KB Output is correct
5 Correct 24 ms 47352 KB Output is correct
6 Correct 22 ms 47444 KB Output is correct
7 Correct 28 ms 47444 KB Output is correct
8 Correct 23 ms 47436 KB Output is correct
9 Correct 24 ms 47436 KB Output is correct
10 Correct 29 ms 47452 KB Output is correct
11 Correct 23 ms 47324 KB Output is correct
12 Correct 21 ms 47332 KB Output is correct
13 Correct 22 ms 47444 KB Output is correct
14 Correct 23 ms 47444 KB Output is correct
15 Correct 22 ms 47392 KB Output is correct
16 Correct 23 ms 47352 KB Output is correct
17 Correct 24 ms 47940 KB Output is correct
18 Correct 23 ms 47828 KB Output is correct
19 Correct 27 ms 48092 KB Output is correct
20 Correct 27 ms 47948 KB Output is correct
21 Correct 29 ms 47996 KB Output is correct
22 Correct 25 ms 47816 KB Output is correct
23 Correct 32 ms 47908 KB Output is correct
24 Correct 202 ms 93788 KB Output is correct
25 Correct 116 ms 89260 KB Output is correct
26 Correct 197 ms 99280 KB Output is correct
27 Correct 149 ms 89448 KB Output is correct
28 Correct 238 ms 91952 KB Output is correct
29 Correct 112 ms 90432 KB Output is correct
30 Correct 603 ms 97076 KB Output is correct
31 Correct 44 ms 61164 KB Output is correct
32 Correct 96 ms 78552 KB Output is correct
33 Correct 347 ms 92940 KB Output is correct
34 Correct 463 ms 95428 KB Output is correct
35 Correct 618 ms 90376 KB Output is correct
36 Correct 606 ms 90428 KB Output is correct
37 Correct 198 ms 102584 KB Output is correct
38 Correct 178 ms 92556 KB Output is correct
39 Correct 411 ms 99676 KB Output is correct
40 Correct 431 ms 99768 KB Output is correct
41 Correct 27 ms 47436 KB Output is correct
42 Correct 625 ms 100204 KB Output is correct
43 Correct 436 ms 96656 KB Output is correct
44 Correct 446 ms 99080 KB Output is correct
45 Correct 631 ms 94096 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 47444 KB Output is correct
2 Correct 22 ms 47404 KB Output is correct
3 Correct 26 ms 47348 KB Output is correct
4 Correct 22 ms 47456 KB Output is correct
5 Correct 24 ms 47352 KB Output is correct
6 Correct 22 ms 47444 KB Output is correct
7 Correct 28 ms 47444 KB Output is correct
8 Correct 23 ms 47436 KB Output is correct
9 Correct 24 ms 47436 KB Output is correct
10 Correct 29 ms 47452 KB Output is correct
11 Correct 23 ms 47324 KB Output is correct
12 Correct 21 ms 47332 KB Output is correct
13 Correct 22 ms 47444 KB Output is correct
14 Correct 23 ms 47444 KB Output is correct
15 Correct 22 ms 47392 KB Output is correct
16 Correct 23 ms 47352 KB Output is correct
17 Correct 24 ms 47940 KB Output is correct
18 Correct 23 ms 47828 KB Output is correct
19 Correct 27 ms 48092 KB Output is correct
20 Correct 27 ms 47948 KB Output is correct
21 Correct 29 ms 47996 KB Output is correct
22 Correct 25 ms 47816 KB Output is correct
23 Correct 32 ms 47908 KB Output is correct
24 Correct 202 ms 93788 KB Output is correct
25 Correct 116 ms 89260 KB Output is correct
26 Correct 197 ms 99280 KB Output is correct
27 Correct 149 ms 89448 KB Output is correct
28 Correct 238 ms 91952 KB Output is correct
29 Correct 112 ms 90432 KB Output is correct
30 Correct 603 ms 97076 KB Output is correct
31 Correct 44 ms 61164 KB Output is correct
32 Correct 96 ms 78552 KB Output is correct
33 Correct 347 ms 92940 KB Output is correct
34 Correct 463 ms 95428 KB Output is correct
35 Correct 618 ms 90376 KB Output is correct
36 Correct 606 ms 90428 KB Output is correct
37 Correct 198 ms 102584 KB Output is correct
38 Correct 178 ms 92556 KB Output is correct
39 Correct 411 ms 99676 KB Output is correct
40 Correct 431 ms 99768 KB Output is correct
41 Correct 27 ms 47436 KB Output is correct
42 Correct 625 ms 100204 KB Output is correct
43 Correct 436 ms 96656 KB Output is correct
44 Correct 446 ms 99080 KB Output is correct
45 Correct 631 ms 94096 KB Output is correct
46 Correct 1043 ms 306528 KB Output is correct
47 Correct 753 ms 261240 KB Output is correct
48 Correct 2089 ms 293372 KB Output is correct
49 Correct 1829 ms 293420 KB Output is correct
50 Correct 4354 ms 295436 KB Output is correct
51 Correct 2143 ms 272300 KB Output is correct
52 Correct 2440 ms 278800 KB Output is correct
53 Correct 4178 ms 263560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 320 ms 99620 KB Output is correct
2 Correct 304 ms 99700 KB Output is correct
3 Correct 117 ms 92524 KB Output is correct
4 Correct 229 ms 97500 KB Output is correct
5 Correct 26 ms 47436 KB Output is correct
6 Correct 319 ms 98448 KB Output is correct
7 Correct 44 ms 62712 KB Output is correct
8 Correct 47 ms 78200 KB Output is correct
9 Correct 114 ms 93688 KB Output is correct
10 Correct 365 ms 96016 KB Output is correct
11 Correct 104 ms 86948 KB Output is correct
12 Correct 22 ms 47444 KB Output is correct
13 Correct 22 ms 47404 KB Output is correct
14 Correct 26 ms 47348 KB Output is correct
15 Correct 22 ms 47456 KB Output is correct
16 Correct 24 ms 47352 KB Output is correct
17 Correct 22 ms 47444 KB Output is correct
18 Correct 28 ms 47444 KB Output is correct
19 Correct 23 ms 47436 KB Output is correct
20 Correct 24 ms 47436 KB Output is correct
21 Correct 29 ms 47452 KB Output is correct
22 Correct 23 ms 47324 KB Output is correct
23 Correct 21 ms 47332 KB Output is correct
24 Correct 22 ms 47444 KB Output is correct
25 Correct 23 ms 47444 KB Output is correct
26 Correct 22 ms 47392 KB Output is correct
27 Correct 23 ms 47352 KB Output is correct
28 Correct 24 ms 47940 KB Output is correct
29 Correct 23 ms 47828 KB Output is correct
30 Correct 27 ms 48092 KB Output is correct
31 Correct 27 ms 47948 KB Output is correct
32 Correct 29 ms 47996 KB Output is correct
33 Correct 25 ms 47816 KB Output is correct
34 Correct 32 ms 47908 KB Output is correct
35 Correct 202 ms 93788 KB Output is correct
36 Correct 116 ms 89260 KB Output is correct
37 Correct 197 ms 99280 KB Output is correct
38 Correct 149 ms 89448 KB Output is correct
39 Correct 238 ms 91952 KB Output is correct
40 Correct 112 ms 90432 KB Output is correct
41 Correct 603 ms 97076 KB Output is correct
42 Correct 44 ms 61164 KB Output is correct
43 Correct 96 ms 78552 KB Output is correct
44 Correct 347 ms 92940 KB Output is correct
45 Correct 463 ms 95428 KB Output is correct
46 Correct 618 ms 90376 KB Output is correct
47 Correct 606 ms 90428 KB Output is correct
48 Correct 198 ms 102584 KB Output is correct
49 Correct 178 ms 92556 KB Output is correct
50 Correct 411 ms 99676 KB Output is correct
51 Correct 431 ms 99768 KB Output is correct
52 Correct 27 ms 47436 KB Output is correct
53 Correct 625 ms 100204 KB Output is correct
54 Correct 436 ms 96656 KB Output is correct
55 Correct 446 ms 99080 KB Output is correct
56 Correct 631 ms 94096 KB Output is correct
57 Correct 152 ms 99504 KB Output is correct
58 Correct 203 ms 97904 KB Output is correct
59 Correct 274 ms 101660 KB Output is correct
60 Correct 336 ms 97340 KB Output is correct
61 Correct 121 ms 89804 KB Output is correct
62 Correct 27 ms 47352 KB Output is correct
63 Correct 685 ms 101856 KB Output is correct
64 Correct 377 ms 96712 KB Output is correct
65 Correct 496 ms 99512 KB Output is correct
66 Correct 628 ms 95052 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 320 ms 99620 KB Output is correct
2 Correct 304 ms 99700 KB Output is correct
3 Correct 117 ms 92524 KB Output is correct
4 Correct 229 ms 97500 KB Output is correct
5 Correct 26 ms 47436 KB Output is correct
6 Correct 319 ms 98448 KB Output is correct
7 Correct 44 ms 62712 KB Output is correct
8 Correct 47 ms 78200 KB Output is correct
9 Correct 114 ms 93688 KB Output is correct
10 Correct 365 ms 96016 KB Output is correct
11 Correct 104 ms 86948 KB Output is correct
12 Correct 22 ms 47444 KB Output is correct
13 Correct 22 ms 47404 KB Output is correct
14 Correct 26 ms 47348 KB Output is correct
15 Correct 22 ms 47456 KB Output is correct
16 Correct 24 ms 47352 KB Output is correct
17 Correct 22 ms 47444 KB Output is correct
18 Correct 28 ms 47444 KB Output is correct
19 Correct 23 ms 47436 KB Output is correct
20 Correct 24 ms 47436 KB Output is correct
21 Correct 29 ms 47452 KB Output is correct
22 Correct 23 ms 47324 KB Output is correct
23 Correct 21 ms 47332 KB Output is correct
24 Correct 22 ms 47444 KB Output is correct
25 Correct 23 ms 47444 KB Output is correct
26 Correct 22 ms 47392 KB Output is correct
27 Correct 23 ms 47352 KB Output is correct
28 Correct 24 ms 47940 KB Output is correct
29 Correct 23 ms 47828 KB Output is correct
30 Correct 27 ms 48092 KB Output is correct
31 Correct 27 ms 47948 KB Output is correct
32 Correct 29 ms 47996 KB Output is correct
33 Correct 25 ms 47816 KB Output is correct
34 Correct 32 ms 47908 KB Output is correct
35 Correct 202 ms 93788 KB Output is correct
36 Correct 116 ms 89260 KB Output is correct
37 Correct 197 ms 99280 KB Output is correct
38 Correct 149 ms 89448 KB Output is correct
39 Correct 238 ms 91952 KB Output is correct
40 Correct 112 ms 90432 KB Output is correct
41 Correct 603 ms 97076 KB Output is correct
42 Correct 44 ms 61164 KB Output is correct
43 Correct 96 ms 78552 KB Output is correct
44 Correct 347 ms 92940 KB Output is correct
45 Correct 463 ms 95428 KB Output is correct
46 Correct 618 ms 90376 KB Output is correct
47 Correct 606 ms 90428 KB Output is correct
48 Correct 198 ms 102584 KB Output is correct
49 Correct 178 ms 92556 KB Output is correct
50 Correct 411 ms 99676 KB Output is correct
51 Correct 431 ms 99768 KB Output is correct
52 Correct 27 ms 47436 KB Output is correct
53 Correct 625 ms 100204 KB Output is correct
54 Correct 436 ms 96656 KB Output is correct
55 Correct 446 ms 99080 KB Output is correct
56 Correct 631 ms 94096 KB Output is correct
57 Correct 1043 ms 306528 KB Output is correct
58 Correct 753 ms 261240 KB Output is correct
59 Correct 2089 ms 293372 KB Output is correct
60 Correct 1829 ms 293420 KB Output is correct
61 Correct 4354 ms 295436 KB Output is correct
62 Correct 2143 ms 272300 KB Output is correct
63 Correct 2440 ms 278800 KB Output is correct
64 Correct 4178 ms 263560 KB Output is correct
65 Correct 152 ms 99504 KB Output is correct
66 Correct 203 ms 97904 KB Output is correct
67 Correct 274 ms 101660 KB Output is correct
68 Correct 336 ms 97340 KB Output is correct
69 Correct 121 ms 89804 KB Output is correct
70 Correct 27 ms 47352 KB Output is correct
71 Correct 685 ms 101856 KB Output is correct
72 Correct 377 ms 96712 KB Output is correct
73 Correct 496 ms 99512 KB Output is correct
74 Correct 628 ms 95052 KB Output is correct
75 Correct 640 ms 292832 KB Output is correct
76 Correct 916 ms 280032 KB Output is correct
77 Correct 1336 ms 296196 KB Output is correct
78 Correct 1717 ms 279508 KB Output is correct
79 Correct 4383 ms 300196 KB Output is correct
80 Correct 2177 ms 275376 KB Output is correct
81 Correct 3019 ms 283160 KB Output is correct
82 Correct 4412 ms 267180 KB Output is correct
83 Correct 4081 ms 287184 KB Output is correct