답안 #386392

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
386392 2021-04-06T13:53:40 Z MatheusLealV 푸드 코트 (JOI21_foodcourt) C++17
100 / 100
745 ms 43880 KB
#pragma GCC optimize ("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define N 250020
// #define int long long
typedef long long ll;
#define pb push_back
using namespace std;
const ll inf = (ll)(2e15);
struct node{
	#define l (2*nod)
	#define r (2*nod + 1)
	#define mid ((a + b)/2)
	ll max1, max2;
	ll lazy;
	node(ll x = 0){
		max1 = x;
		max2 = -inf;
		lazy=0;
	}
} tree[4*N];

void merge(int nod){
	tree[nod].max1 = max(tree[l].max1, tree[r].max1);
	tree[nod].max2 = -inf;
	if(tree[l].max1 != tree[nod].max1) tree[nod].max2 = max(tree[nod].max2, tree[l].max1);
	if(tree[l].max2 != tree[nod].max1) tree[nod].max2 = max(tree[nod].max2, tree[l].max2);
	if(tree[r].max1 != tree[nod].max1) tree[nod].max2 = max(tree[nod].max2, tree[r].max1);
	if(tree[r].max2 != tree[nod].max1) tree[nod].max2 = max(tree[nod].max2, tree[r].max2);
}
void build(int nod, int a, int b){
	if(a == b){
		tree[nod] = node(0);
		return;
	}
	build(l, a, mid), build(r, mid + 1, b);
	merge(nod);
}
void propaga(int nod, int a, int b){
	if(a != b){
		if((tree[l].max1+tree[l].lazy) > tree[nod].max1){
			tree[l].max1 = tree[nod].max1-tree[l].lazy;
		}
		if(tree[r].max1+tree[r].lazy > tree[nod].max1){
			tree[r].max1 = tree[nod].max1-tree[r].lazy;
		}
		tree[l].lazy += tree[nod].lazy;
		tree[r].lazy += tree[nod].lazy;
	}
	tree[nod].max1 += tree[nod].lazy;
	tree[nod].max2 += tree[nod].lazy;
	tree[nod].lazy=0;
}
void upd(int nod, int a, int b, int i, int j, ll x){
	propaga(nod, a, b);
	if(j < a or i > b or tree[nod].max1 <= x) return;
	if(i <= a and j >= b and tree[nod].max1 > x and x > tree[nod].max2){
		tree[nod].max1 = x;
		return;
	}
	upd(l, a, mid, i, j, x);upd(r, mid + 1, b, i, j, x);
	merge(nod);
}
int L[N], R[N], C[N], K[N];

void upd2(int nod, int a, int b, int &tmp){
	propaga(nod,a,b);
	if(R[tmp]<a or L[tmp]>b)return;
	if(L[tmp]<=a and R[tmp] >= b){
		tree[nod].lazy -= K[tmp];
		propaga(nod,a,b);
		return;
	}
	upd2(l,a,mid,tmp),upd2(r,mid+1,b,tmp);
	merge(nod);
}
ll query(int nod, int a, int b, int i){
	propaga(nod, a, b);
	if(a==b) return tree[nod].max1;
	if(i <= mid) return query(l, a,mid,i);
	return query(r, mid + 1, b, i);
}
int n, m, q;
struct service{
	int i, st, en,id,ans;
	ll removed, b;
	service(int i1,ll removed1,ll b1,int st1,int en1,int id1,int ans1){
		i=i1;removed=removed1;b=b1;st=st1;en=en1;id=id1;ans=ans1;
	}
};
vector<service> Q;

ll bit[N];
void bit_upd(int x, ll v){
	assert(x!=0);
	for(int i = x; i < N; i += (i&-i)) bit[i]+=v;
}
ll bit_query(int x){
	assert(x!=0);
	ll sum = 0;
	for(int i =x;i>0;i-=(i&-i))sum+=bit[i];
	return sum;
}
vector<int> check[N];

ll seg[4*N], lazy[4*N];
ll w[N];
void build1(int nod, int a, int b){
	if(a==b){
		seg[nod] = Q[a].b + Q[a].removed;
		return; 
	}
	build1(l,a,mid);build1(r,mid+1,b);
	seg[nod]=min(seg[l], seg[r]);
}
void prop(int nod, int a, int b){
	seg[nod] += lazy[nod];
	if(a!=b){
		lazy[l]+=lazy[nod];
		lazy[r]+=lazy[nod];
	}
	lazy[nod]=0;
}

void tset(int nod,int a, int b,int &tmp){
	prop(nod, a, b);
	if(R[tmp]<Q[a].i or L[tmp]>Q[b].i) return;
	if(L[tmp]<=Q[a].i and R[tmp] >= Q[b].i){
		lazy[nod]-=K[tmp];
		prop(nod,a,b);
		return;
	}
	tset(l,a,mid,tmp);tset(r,mid+1,b, tmp);
	seg[nod]=min(seg[l],seg[r]);
}
int ans[N];
//look for values less than or equal to 0
void look(int nod, int a, int b, int &tmp){
	prop(nod,a,b);
	if(seg[nod] > 0) return;
	if(a==b){
		seg[nod] = inf;
		if(Q[a].en >= tmp)ans[Q[a].st]=C[tmp];
		return;
	}
	look(l,a,mid,tmp),look(r,mid+1,b,tmp);
	seg[nod]=min(seg[l], seg[r]);
}
int findL(int i){
	int st = 0, en = (int)Q.size() - 1,md,best=-1;
	while(en >= st){
		md=(st+en)/2;
		if(Q[md].i >= L[i]){
			best=md;
			en=md-1;
		}
		else st=md+1;
	}
	return best;
}
int findR(int i){
	int st = 0, en = (int)Q.size() - 1,md,best=-1;
	while(en >= st){
		md=(st+en)/2;
		if(Q[md].i <= R[i]){
			best=md;
			st = md + 1;;
		}
		else en=md-1;
	}
	return best;	
}
inline void fastscan(int &number) { 
    bool negative = false; 
    register int c; 
    number = 0; 
      c = getchar(); 
    if (c=='-') { 
        negative = true; 
  
        c = getchar(); 
    } 
    for (; (c>47 && c<58); c=getchar()) 
        number = number *10 + c - 48; 
  
    if (negative) 
        number *= -1; 
}
inline void fastscanll(ll &number) { 
    bool negative = false; 
    register int c; 
    number = 0; 
      c = getchar(); 
    if (c=='-') { 
        negative = true; 
  
        c = getchar(); 
    } 
    for (; (c>47 && c<58); c=getchar()) 
        number = number *10 + c - 48; 
  
    if (negative) 
        number *= -1; 
}
int main(){
	// ios::sync_with_stdio(false); cin.tie(0);cout.tie(0);
	fastscan(n);fastscan(m);fastscan(q);
	for(int i = 0; i < 4*N; i++) tree[i] = node(0);
	build(1,1,n);
	int tmp = 0,j = 0,tm2=q+1;
	for(int i = 1, t, a,b ,c; i <= q; i++){
		fastscan(t);
		if(t == 1){
			++tmp;
			fastscan(L[tmp]);fastscan(R[tmp]);fastscan(C[tmp]);fastscan(K[tmp]);
			// cin>>L[tmp]>>R[tmp]>>C[tmp]>>K[tmp];
			upd2(1,1,n,tmp);
			// upd(1,1,n,L[tmp],R[tmp],0);
			bit_upd(L[tmp],K[tmp]);
			bit_upd(R[tmp]+1,-K[tmp]);
		}
		else if(t == 2){
			fastscan(a);fastscan(b);fastscan(c);
			// cin>>a>>b>>c;
			L[tm2]=a;R[tm2]=b;K[tm2]=-c;
			upd2(1,1,n,tm2);
			upd(1,1,n,1,n,0);
		}
		else{
			// upd(1,1,n,1,n,0);
			ll b;
			++j;
			fastscan(a);fastscanll(b);
			ll removed = bit_query(a)+query(1,1,n,a);
			Q.pb({a, removed, b, j, tmp,i,0});
		}
	}
	sort(Q.begin(), Q.end(), [&](auto a, auto b){
		return a.i<b.i;
	});

	build1(1,0,(int)(Q.size()) - 1);

	for(int i = 1; i <= tmp; i++){
		if(L[i]>=0 and R[i] >= 0) tset(1,0,(int)(Q.size()) - 1,i);
		if(L[i]>=0 and R[i] >= 0) look(1,0,(int)(Q.size()) - 1,i);
	}
	
	for(int i = 0; i < Q.size(); i++) printf("%d\n",ans[i+1]);
}

Compilation message

foodcourt.cpp: In function 'void fastscan(int&)':
foodcourt.cpp:175:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  175 |     register int c;
      |                  ^
foodcourt.cpp: In function 'void fastscanll(ll&)':
foodcourt.cpp:191:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  191 |     register int c;
      |                  ^
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:249:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<service>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  249 |  for(int i = 0; i < Q.size(); i++) printf("%d\n",ans[i+1]);
      |                 ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 29804 KB Output is correct
2 Correct 22 ms 29932 KB Output is correct
3 Correct 22 ms 29804 KB Output is correct
4 Correct 23 ms 29804 KB Output is correct
5 Correct 21 ms 29932 KB Output is correct
6 Correct 21 ms 29932 KB Output is correct
7 Correct 23 ms 29824 KB Output is correct
8 Correct 22 ms 29804 KB Output is correct
9 Correct 22 ms 29804 KB Output is correct
10 Correct 22 ms 29804 KB Output is correct
11 Correct 22 ms 29804 KB Output is correct
12 Correct 23 ms 29804 KB Output is correct
13 Correct 21 ms 29932 KB Output is correct
14 Correct 21 ms 29932 KB Output is correct
15 Correct 22 ms 29804 KB Output is correct
16 Correct 22 ms 29932 KB Output is correct
17 Correct 25 ms 29804 KB Output is correct
18 Correct 23 ms 29932 KB Output is correct
19 Correct 22 ms 29904 KB Output is correct
20 Correct 24 ms 29804 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 29804 KB Output is correct
2 Correct 22 ms 29932 KB Output is correct
3 Correct 22 ms 29804 KB Output is correct
4 Correct 23 ms 29804 KB Output is correct
5 Correct 21 ms 29932 KB Output is correct
6 Correct 21 ms 29932 KB Output is correct
7 Correct 23 ms 29824 KB Output is correct
8 Correct 22 ms 29804 KB Output is correct
9 Correct 22 ms 29804 KB Output is correct
10 Correct 22 ms 29804 KB Output is correct
11 Correct 22 ms 29804 KB Output is correct
12 Correct 23 ms 29804 KB Output is correct
13 Correct 21 ms 29932 KB Output is correct
14 Correct 21 ms 29932 KB Output is correct
15 Correct 22 ms 29804 KB Output is correct
16 Correct 22 ms 29932 KB Output is correct
17 Correct 25 ms 29804 KB Output is correct
18 Correct 23 ms 29932 KB Output is correct
19 Correct 22 ms 29904 KB Output is correct
20 Correct 24 ms 29804 KB Output is correct
21 Correct 24 ms 29932 KB Output is correct
22 Correct 23 ms 29932 KB Output is correct
23 Correct 22 ms 29804 KB Output is correct
24 Correct 23 ms 29804 KB Output is correct
25 Correct 21 ms 29804 KB Output is correct
26 Correct 22 ms 29832 KB Output is correct
27 Correct 22 ms 29900 KB Output is correct
28 Correct 22 ms 29804 KB Output is correct
29 Correct 22 ms 29932 KB Output is correct
30 Correct 23 ms 29804 KB Output is correct
31 Correct 23 ms 29804 KB Output is correct
32 Correct 23 ms 29932 KB Output is correct
33 Correct 21 ms 29932 KB Output is correct
34 Correct 25 ms 29932 KB Output is correct
35 Correct 25 ms 29932 KB Output is correct
36 Correct 22 ms 29932 KB Output is correct
37 Correct 22 ms 29804 KB Output is correct
38 Correct 24 ms 29804 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 133 ms 32660 KB Output is correct
2 Correct 133 ms 32100 KB Output is correct
3 Correct 141 ms 32736 KB Output is correct
4 Correct 133 ms 32736 KB Output is correct
5 Correct 148 ms 32088 KB Output is correct
6 Correct 171 ms 32100 KB Output is correct
7 Correct 41 ms 32160 KB Output is correct
8 Correct 38 ms 32224 KB Output is correct
9 Correct 143 ms 32532 KB Output is correct
10 Correct 146 ms 31972 KB Output is correct
11 Correct 142 ms 31972 KB Output is correct
12 Correct 140 ms 31972 KB Output is correct
13 Correct 114 ms 32740 KB Output is correct
14 Correct 128 ms 32932 KB Output is correct
15 Correct 114 ms 32056 KB Output is correct
16 Correct 124 ms 32168 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 639 ms 40436 KB Output is correct
2 Correct 469 ms 37316 KB Output is correct
3 Correct 663 ms 40916 KB Output is correct
4 Correct 447 ms 37340 KB Output is correct
5 Correct 430 ms 36960 KB Output is correct
6 Correct 636 ms 38688 KB Output is correct
7 Correct 114 ms 38996 KB Output is correct
8 Correct 142 ms 38996 KB Output is correct
9 Correct 664 ms 43284 KB Output is correct
10 Correct 719 ms 43280 KB Output is correct
11 Correct 611 ms 38204 KB Output is correct
12 Correct 626 ms 38236 KB Output is correct
13 Correct 617 ms 38108 KB Output is correct
14 Correct 636 ms 38224 KB Output is correct
15 Correct 716 ms 38228 KB Output is correct
16 Correct 641 ms 38268 KB Output is correct
17 Correct 651 ms 38108 KB Output is correct
18 Correct 631 ms 38108 KB Output is correct
19 Correct 647 ms 38108 KB Output is correct
20 Correct 745 ms 38084 KB Output is correct
21 Correct 686 ms 38244 KB Output is correct
22 Correct 654 ms 38236 KB Output is correct
23 Correct 650 ms 38108 KB Output is correct
24 Correct 647 ms 38208 KB Output is correct
25 Correct 450 ms 39136 KB Output is correct
26 Correct 453 ms 39124 KB Output is correct
27 Correct 495 ms 38364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 29804 KB Output is correct
2 Correct 22 ms 29932 KB Output is correct
3 Correct 22 ms 29804 KB Output is correct
4 Correct 23 ms 29804 KB Output is correct
5 Correct 21 ms 29932 KB Output is correct
6 Correct 21 ms 29932 KB Output is correct
7 Correct 23 ms 29824 KB Output is correct
8 Correct 22 ms 29804 KB Output is correct
9 Correct 22 ms 29804 KB Output is correct
10 Correct 22 ms 29804 KB Output is correct
11 Correct 22 ms 29804 KB Output is correct
12 Correct 23 ms 29804 KB Output is correct
13 Correct 21 ms 29932 KB Output is correct
14 Correct 21 ms 29932 KB Output is correct
15 Correct 22 ms 29804 KB Output is correct
16 Correct 22 ms 29932 KB Output is correct
17 Correct 25 ms 29804 KB Output is correct
18 Correct 23 ms 29932 KB Output is correct
19 Correct 22 ms 29904 KB Output is correct
20 Correct 24 ms 29804 KB Output is correct
21 Correct 133 ms 32660 KB Output is correct
22 Correct 133 ms 32100 KB Output is correct
23 Correct 141 ms 32736 KB Output is correct
24 Correct 133 ms 32736 KB Output is correct
25 Correct 148 ms 32088 KB Output is correct
26 Correct 171 ms 32100 KB Output is correct
27 Correct 41 ms 32160 KB Output is correct
28 Correct 38 ms 32224 KB Output is correct
29 Correct 143 ms 32532 KB Output is correct
30 Correct 146 ms 31972 KB Output is correct
31 Correct 142 ms 31972 KB Output is correct
32 Correct 140 ms 31972 KB Output is correct
33 Correct 114 ms 32740 KB Output is correct
34 Correct 128 ms 32932 KB Output is correct
35 Correct 114 ms 32056 KB Output is correct
36 Correct 124 ms 32168 KB Output is correct
37 Correct 118 ms 32736 KB Output is correct
38 Correct 107 ms 31844 KB Output is correct
39 Correct 32 ms 31332 KB Output is correct
40 Correct 39 ms 31460 KB Output is correct
41 Correct 119 ms 32100 KB Output is correct
42 Correct 126 ms 32100 KB Output is correct
43 Correct 136 ms 32100 KB Output is correct
44 Correct 135 ms 32100 KB Output is correct
45 Correct 132 ms 32100 KB Output is correct
46 Correct 143 ms 32100 KB Output is correct
47 Correct 48 ms 32352 KB Output is correct
48 Correct 112 ms 32352 KB Output is correct
49 Correct 118 ms 31460 KB Output is correct
50 Correct 137 ms 31716 KB Output is correct
51 Correct 170 ms 31972 KB Output is correct
52 Correct 166 ms 31968 KB Output is correct
53 Correct 96 ms 31528 KB Output is correct
54 Correct 118 ms 32228 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 113 ms 33248 KB Output is correct
2 Correct 122 ms 33376 KB Output is correct
3 Correct 125 ms 33504 KB Output is correct
4 Correct 94 ms 32848 KB Output is correct
5 Correct 110 ms 33236 KB Output is correct
6 Correct 127 ms 33516 KB Output is correct
7 Correct 44 ms 32736 KB Output is correct
8 Correct 52 ms 32736 KB Output is correct
9 Correct 68 ms 32992 KB Output is correct
10 Correct 85 ms 32352 KB Output is correct
11 Correct 115 ms 32992 KB Output is correct
12 Correct 120 ms 32992 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 29804 KB Output is correct
2 Correct 22 ms 29932 KB Output is correct
3 Correct 22 ms 29804 KB Output is correct
4 Correct 23 ms 29804 KB Output is correct
5 Correct 21 ms 29932 KB Output is correct
6 Correct 21 ms 29932 KB Output is correct
7 Correct 23 ms 29824 KB Output is correct
8 Correct 22 ms 29804 KB Output is correct
9 Correct 22 ms 29804 KB Output is correct
10 Correct 22 ms 29804 KB Output is correct
11 Correct 22 ms 29804 KB Output is correct
12 Correct 23 ms 29804 KB Output is correct
13 Correct 21 ms 29932 KB Output is correct
14 Correct 21 ms 29932 KB Output is correct
15 Correct 22 ms 29804 KB Output is correct
16 Correct 22 ms 29932 KB Output is correct
17 Correct 25 ms 29804 KB Output is correct
18 Correct 23 ms 29932 KB Output is correct
19 Correct 22 ms 29904 KB Output is correct
20 Correct 24 ms 29804 KB Output is correct
21 Correct 24 ms 29932 KB Output is correct
22 Correct 23 ms 29932 KB Output is correct
23 Correct 22 ms 29804 KB Output is correct
24 Correct 23 ms 29804 KB Output is correct
25 Correct 21 ms 29804 KB Output is correct
26 Correct 22 ms 29832 KB Output is correct
27 Correct 22 ms 29900 KB Output is correct
28 Correct 22 ms 29804 KB Output is correct
29 Correct 22 ms 29932 KB Output is correct
30 Correct 23 ms 29804 KB Output is correct
31 Correct 23 ms 29804 KB Output is correct
32 Correct 23 ms 29932 KB Output is correct
33 Correct 21 ms 29932 KB Output is correct
34 Correct 25 ms 29932 KB Output is correct
35 Correct 25 ms 29932 KB Output is correct
36 Correct 22 ms 29932 KB Output is correct
37 Correct 22 ms 29804 KB Output is correct
38 Correct 24 ms 29804 KB Output is correct
39 Correct 133 ms 32660 KB Output is correct
40 Correct 133 ms 32100 KB Output is correct
41 Correct 141 ms 32736 KB Output is correct
42 Correct 133 ms 32736 KB Output is correct
43 Correct 148 ms 32088 KB Output is correct
44 Correct 171 ms 32100 KB Output is correct
45 Correct 41 ms 32160 KB Output is correct
46 Correct 38 ms 32224 KB Output is correct
47 Correct 143 ms 32532 KB Output is correct
48 Correct 146 ms 31972 KB Output is correct
49 Correct 142 ms 31972 KB Output is correct
50 Correct 140 ms 31972 KB Output is correct
51 Correct 114 ms 32740 KB Output is correct
52 Correct 128 ms 32932 KB Output is correct
53 Correct 114 ms 32056 KB Output is correct
54 Correct 124 ms 32168 KB Output is correct
55 Correct 118 ms 32736 KB Output is correct
56 Correct 107 ms 31844 KB Output is correct
57 Correct 32 ms 31332 KB Output is correct
58 Correct 39 ms 31460 KB Output is correct
59 Correct 119 ms 32100 KB Output is correct
60 Correct 126 ms 32100 KB Output is correct
61 Correct 136 ms 32100 KB Output is correct
62 Correct 135 ms 32100 KB Output is correct
63 Correct 132 ms 32100 KB Output is correct
64 Correct 143 ms 32100 KB Output is correct
65 Correct 48 ms 32352 KB Output is correct
66 Correct 112 ms 32352 KB Output is correct
67 Correct 118 ms 31460 KB Output is correct
68 Correct 137 ms 31716 KB Output is correct
69 Correct 170 ms 31972 KB Output is correct
70 Correct 166 ms 31968 KB Output is correct
71 Correct 96 ms 31528 KB Output is correct
72 Correct 118 ms 32228 KB Output is correct
73 Correct 113 ms 33248 KB Output is correct
74 Correct 122 ms 33376 KB Output is correct
75 Correct 125 ms 33504 KB Output is correct
76 Correct 94 ms 32848 KB Output is correct
77 Correct 110 ms 33236 KB Output is correct
78 Correct 127 ms 33516 KB Output is correct
79 Correct 44 ms 32736 KB Output is correct
80 Correct 52 ms 32736 KB Output is correct
81 Correct 68 ms 32992 KB Output is correct
82 Correct 85 ms 32352 KB Output is correct
83 Correct 115 ms 32992 KB Output is correct
84 Correct 120 ms 32992 KB Output is correct
85 Correct 122 ms 32608 KB Output is correct
86 Correct 128 ms 32736 KB Output is correct
87 Correct 118 ms 31972 KB Output is correct
88 Correct 168 ms 32228 KB Output is correct
89 Correct 99 ms 31588 KB Output is correct
90 Correct 119 ms 32100 KB Output is correct
91 Correct 112 ms 31716 KB Output is correct
92 Correct 111 ms 31716 KB Output is correct
93 Correct 129 ms 32100 KB Output is correct
94 Correct 127 ms 32096 KB Output is correct
95 Correct 125 ms 31972 KB Output is correct
96 Correct 133 ms 32100 KB Output is correct
97 Correct 148 ms 32100 KB Output is correct
98 Correct 121 ms 31844 KB Output is correct
99 Correct 51 ms 32352 KB Output is correct
100 Correct 97 ms 32096 KB Output is correct
101 Correct 114 ms 32480 KB Output is correct
102 Correct 117 ms 32100 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 29804 KB Output is correct
2 Correct 22 ms 29932 KB Output is correct
3 Correct 22 ms 29804 KB Output is correct
4 Correct 23 ms 29804 KB Output is correct
5 Correct 21 ms 29932 KB Output is correct
6 Correct 21 ms 29932 KB Output is correct
7 Correct 23 ms 29824 KB Output is correct
8 Correct 22 ms 29804 KB Output is correct
9 Correct 22 ms 29804 KB Output is correct
10 Correct 22 ms 29804 KB Output is correct
11 Correct 22 ms 29804 KB Output is correct
12 Correct 23 ms 29804 KB Output is correct
13 Correct 21 ms 29932 KB Output is correct
14 Correct 21 ms 29932 KB Output is correct
15 Correct 22 ms 29804 KB Output is correct
16 Correct 22 ms 29932 KB Output is correct
17 Correct 25 ms 29804 KB Output is correct
18 Correct 23 ms 29932 KB Output is correct
19 Correct 22 ms 29904 KB Output is correct
20 Correct 24 ms 29804 KB Output is correct
21 Correct 24 ms 29932 KB Output is correct
22 Correct 23 ms 29932 KB Output is correct
23 Correct 22 ms 29804 KB Output is correct
24 Correct 23 ms 29804 KB Output is correct
25 Correct 21 ms 29804 KB Output is correct
26 Correct 22 ms 29832 KB Output is correct
27 Correct 22 ms 29900 KB Output is correct
28 Correct 22 ms 29804 KB Output is correct
29 Correct 22 ms 29932 KB Output is correct
30 Correct 23 ms 29804 KB Output is correct
31 Correct 23 ms 29804 KB Output is correct
32 Correct 23 ms 29932 KB Output is correct
33 Correct 21 ms 29932 KB Output is correct
34 Correct 25 ms 29932 KB Output is correct
35 Correct 25 ms 29932 KB Output is correct
36 Correct 22 ms 29932 KB Output is correct
37 Correct 22 ms 29804 KB Output is correct
38 Correct 24 ms 29804 KB Output is correct
39 Correct 133 ms 32660 KB Output is correct
40 Correct 133 ms 32100 KB Output is correct
41 Correct 141 ms 32736 KB Output is correct
42 Correct 133 ms 32736 KB Output is correct
43 Correct 148 ms 32088 KB Output is correct
44 Correct 171 ms 32100 KB Output is correct
45 Correct 41 ms 32160 KB Output is correct
46 Correct 38 ms 32224 KB Output is correct
47 Correct 143 ms 32532 KB Output is correct
48 Correct 146 ms 31972 KB Output is correct
49 Correct 142 ms 31972 KB Output is correct
50 Correct 140 ms 31972 KB Output is correct
51 Correct 114 ms 32740 KB Output is correct
52 Correct 128 ms 32932 KB Output is correct
53 Correct 114 ms 32056 KB Output is correct
54 Correct 124 ms 32168 KB Output is correct
55 Correct 639 ms 40436 KB Output is correct
56 Correct 469 ms 37316 KB Output is correct
57 Correct 663 ms 40916 KB Output is correct
58 Correct 447 ms 37340 KB Output is correct
59 Correct 430 ms 36960 KB Output is correct
60 Correct 636 ms 38688 KB Output is correct
61 Correct 114 ms 38996 KB Output is correct
62 Correct 142 ms 38996 KB Output is correct
63 Correct 664 ms 43284 KB Output is correct
64 Correct 719 ms 43280 KB Output is correct
65 Correct 611 ms 38204 KB Output is correct
66 Correct 626 ms 38236 KB Output is correct
67 Correct 617 ms 38108 KB Output is correct
68 Correct 636 ms 38224 KB Output is correct
69 Correct 716 ms 38228 KB Output is correct
70 Correct 641 ms 38268 KB Output is correct
71 Correct 651 ms 38108 KB Output is correct
72 Correct 631 ms 38108 KB Output is correct
73 Correct 647 ms 38108 KB Output is correct
74 Correct 745 ms 38084 KB Output is correct
75 Correct 686 ms 38244 KB Output is correct
76 Correct 654 ms 38236 KB Output is correct
77 Correct 650 ms 38108 KB Output is correct
78 Correct 647 ms 38208 KB Output is correct
79 Correct 450 ms 39136 KB Output is correct
80 Correct 453 ms 39124 KB Output is correct
81 Correct 495 ms 38364 KB Output is correct
82 Correct 118 ms 32736 KB Output is correct
83 Correct 107 ms 31844 KB Output is correct
84 Correct 32 ms 31332 KB Output is correct
85 Correct 39 ms 31460 KB Output is correct
86 Correct 119 ms 32100 KB Output is correct
87 Correct 126 ms 32100 KB Output is correct
88 Correct 136 ms 32100 KB Output is correct
89 Correct 135 ms 32100 KB Output is correct
90 Correct 132 ms 32100 KB Output is correct
91 Correct 143 ms 32100 KB Output is correct
92 Correct 48 ms 32352 KB Output is correct
93 Correct 112 ms 32352 KB Output is correct
94 Correct 118 ms 31460 KB Output is correct
95 Correct 137 ms 31716 KB Output is correct
96 Correct 170 ms 31972 KB Output is correct
97 Correct 166 ms 31968 KB Output is correct
98 Correct 96 ms 31528 KB Output is correct
99 Correct 118 ms 32228 KB Output is correct
100 Correct 113 ms 33248 KB Output is correct
101 Correct 122 ms 33376 KB Output is correct
102 Correct 125 ms 33504 KB Output is correct
103 Correct 94 ms 32848 KB Output is correct
104 Correct 110 ms 33236 KB Output is correct
105 Correct 127 ms 33516 KB Output is correct
106 Correct 44 ms 32736 KB Output is correct
107 Correct 52 ms 32736 KB Output is correct
108 Correct 68 ms 32992 KB Output is correct
109 Correct 85 ms 32352 KB Output is correct
110 Correct 115 ms 32992 KB Output is correct
111 Correct 120 ms 32992 KB Output is correct
112 Correct 122 ms 32608 KB Output is correct
113 Correct 128 ms 32736 KB Output is correct
114 Correct 118 ms 31972 KB Output is correct
115 Correct 168 ms 32228 KB Output is correct
116 Correct 99 ms 31588 KB Output is correct
117 Correct 119 ms 32100 KB Output is correct
118 Correct 112 ms 31716 KB Output is correct
119 Correct 111 ms 31716 KB Output is correct
120 Correct 129 ms 32100 KB Output is correct
121 Correct 127 ms 32096 KB Output is correct
122 Correct 125 ms 31972 KB Output is correct
123 Correct 133 ms 32100 KB Output is correct
124 Correct 148 ms 32100 KB Output is correct
125 Correct 121 ms 31844 KB Output is correct
126 Correct 51 ms 32352 KB Output is correct
127 Correct 97 ms 32096 KB Output is correct
128 Correct 114 ms 32480 KB Output is correct
129 Correct 117 ms 32100 KB Output is correct
130 Correct 614 ms 41260 KB Output is correct
131 Correct 435 ms 37212 KB Output is correct
132 Correct 672 ms 41500 KB Output is correct
133 Correct 579 ms 38684 KB Output is correct
134 Correct 490 ms 37980 KB Output is correct
135 Correct 591 ms 39016 KB Output is correct
136 Correct 626 ms 43860 KB Output is correct
137 Correct 683 ms 43880 KB Output is correct
138 Correct 559 ms 38316 KB Output is correct
139 Correct 601 ms 38364 KB Output is correct
140 Correct 617 ms 38396 KB Output is correct
141 Correct 576 ms 38364 KB Output is correct
142 Correct 597 ms 38364 KB Output is correct
143 Correct 627 ms 38404 KB Output is correct
144 Correct 580 ms 38492 KB Output is correct
145 Correct 643 ms 38552 KB Output is correct
146 Correct 628 ms 38320 KB Output is correct
147 Correct 638 ms 38496 KB Output is correct
148 Correct 674 ms 38388 KB Output is correct
149 Correct 622 ms 38396 KB Output is correct
150 Correct 170 ms 39480 KB Output is correct
151 Correct 470 ms 39416 KB Output is correct
152 Correct 447 ms 39380 KB Output is correct
153 Correct 469 ms 38492 KB Output is correct