답안 #842740

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
842740 2023-09-03T10:28:15 Z errorgorn 봉쇄 시간 (IOI23_closing) C++17
100 / 100
583 ms 37064 KB
#include "closing.h"
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define ii pair<int,int>
#define iii tuple<int,int,int>
#define fi first
#define se second
#define endl '\n'

#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define lb lower_bound
#define ub upper_bound

#define rep(x,start,end) for(int x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

const int INF=2e18;

int n,k;
vector<ii> al[200005];

int w[2][200005];

void dfs(int i,int p,int ww,int idx){
	w[idx][i]=ww;
	for (auto [it,www]:al[i]){
		if (it==p) continue;
		dfs(it,i,ww+www,idx);
	}
}

vector<int> s,b;
vector<int> ps,pb;
int banidx;

int gb(int i){
	if (banidx<=i) return b[i+1];
	else return b[i];
}

int gpb(int i){
	if (banidx<=i) return pb[i+1]-b[banidx];
	else return pb[i];
}

ii get(int v){
	ii res;
	
	int lo=0,hi=sz(s),mi;
	while (hi-lo>1){
		mi=hi+lo>>1;
		if (s[mi]<=v/2) lo=mi;
		else hi=mi;
	}
	
	res.fi=lo;
	
	lo=0,hi=sz(b)-(banidx!=INF),mi;
	while (hi-lo>1){
		mi=hi+lo>>1;
		if (gb(mi)<=v) lo=mi;
		else hi=mi;
	}
	
	res.se=lo;
	return res;
}

vector<int> V;

int get(int lim,int ban){
	if (lim<0) return -INF;
	if (ban==INF) banidx=INF;
	else banidx=lb(all(b),ban)-b.begin();
	
	//cout<<"debug: "<<lim<<" "<<ban<<endl;
	//rep(x,0,sz(s)) cout<<ps[x]<<" "; cout<<endl;
	//rep(x,0,sz(b)-1) cout<<gpb(x)<<" "; cout<<endl;
	
	int lo=0,hi=sz(V),mi;
	while (hi-lo>1){
		mi=hi+lo>>1;
		
		auto temp=get(V[mi]);
		if (ps[temp.fi]+gpb(temp.se)<=lim) lo=mi;
		else hi=mi;
	}
	
	hi=V[lo+1];
	lo=V[lo];
	auto t1=get(lo),t2=get(hi);
	
	int si=t1.fi,bi=t1.se;
	lim-=ps[si]+gpb(bi);
	
	int temp=min(lim/hi,t2.se-t1.se);
	lim-=temp*hi;
	bi+=temp;
	
	if (hi>=2){
		temp=min(lim/(hi/2),t2.fi-t1.fi);
		lim-=temp*(hi/2);
		si+=temp;
	}
	
	if (lim-s[si+1]>=0) return si+bi*2+1;
	if (lim+s[si]-gb(bi+1)>=0) return si+bi*2+1;
	return si+bi*2;
}

signed max_score(signed N, signed X, signed Y, int K,
              vector<signed> UU, vector<signed> VV, vector<signed> WW){
	
	n=N,k=K;
	
	rep(x,0,n) al[x].clear();
	s.clear(),b.clear();
	
	rep(x,0,n-1){
		al[UU[x]].pub({VV[x],WW[x]});
		al[VV[x]].pub({UU[x],WW[x]});
	}
	
	dfs(X,-1,0,0);
	dfs(Y,-1,0,1);
	
	rep(x,0,n){
		if (w[0][x]>w[1][x]) swap(w[0][x],w[1][x]);
		w[1][x]-=w[0][x];
	}
	
	//rep(x,0,n) cout<<w[0][x]<<" "; cout<<endl;
	//rep(x,0,n) cout<<w[1][x]<<" "; cout<<endl;
	
	vector<int> v;
	rep(x,0,n) v.pub(w[0][x]);
	sort(all(v));
	
	int ans=0,curr=0;
	while (ans<n && curr+v[ans]<=k) curr+=v[ans],ans++;
	
	int d=w[1][X],extra=0;
	rep(x,0,n){
		if (2*w[0][x]+w[1][x]==d){
			k-=w[0][x];
			s.pub(w[1][x]);
			extra++;
		}
		else if (w[0][x]<=w[1][x]) s.pub(w[0][x]),s.pub(w[1][x]);
		else b.pub(w[0][x]+w[1][x]);
	}
	
	s.pub(0),s.pub(INF);
	b.pub(0),b.pub(INF);
	sort(all(s));
	sort(all(b));
	
	V={0};
	for (auto it:s) V.pub(it*2);
	for (auto it:b) V.pub(it);
	sort(all(V));
	V.erase(unique(all(V)),V.end());
	
	//for (auto it:s) cout<<it<<" "; cout<<endl;
	//for (auto it:b) cout<<it<<" "; cout<<endl;
	//for (auto it:V) cout<<it<<" "; cout<<endl;
	
	ps=s,pb=b;
	rep(x,1,sz(ps)) ps[x]+=ps[x-1];
	rep(x,1,sz(pb)) pb[x]+=pb[x-1];
	
	ans=max(ans,extra+get(k,INF));
	rep(x,0,n) if (2*w[0][x]+w[1][x]!=d && w[0][x]>w[1][x]){
		ans=max(ans,extra+get(k-w[0][x],w[0][x]+w[1][x])+1);
	}
	
	return ans;
}

Compilation message

closing.cpp: In function 'std::pair<long long int, long long int> get(long long int)':
closing.cpp:59:8: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   59 |   mi=hi+lo>>1;
      |      ~~^~~
closing.cpp:66:32: warning: right operand of comma operator has no effect [-Wunused-value]
   66 |  lo=0,hi=sz(b)-(banidx!=INF),mi;
      |                                ^
closing.cpp:68:8: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   68 |   mi=hi+lo>>1;
      |      ~~^~~
closing.cpp: In function 'long long int get(long long int, long long int)':
closing.cpp:90:8: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   90 |   mi=hi+lo>>1;
      |      ~~^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 8028 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 155 ms 37064 KB Output is correct
2 Correct 150 ms 35992 KB Output is correct
3 Correct 77 ms 10576 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 8024 KB Output is correct
2 Correct 2 ms 8280 KB Output is correct
3 Correct 2 ms 8028 KB Output is correct
4 Correct 2 ms 8028 KB Output is correct
5 Correct 3 ms 8024 KB Output is correct
6 Correct 2 ms 8280 KB Output is correct
7 Correct 2 ms 8024 KB Output is correct
8 Correct 2 ms 8028 KB Output is correct
9 Correct 2 ms 8024 KB Output is correct
10 Correct 2 ms 8024 KB Output is correct
11 Correct 2 ms 8028 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 8024 KB Output is correct
2 Correct 2 ms 8280 KB Output is correct
3 Correct 2 ms 8028 KB Output is correct
4 Correct 2 ms 8028 KB Output is correct
5 Correct 3 ms 8024 KB Output is correct
6 Correct 2 ms 8280 KB Output is correct
7 Correct 2 ms 8024 KB Output is correct
8 Correct 2 ms 8028 KB Output is correct
9 Correct 2 ms 8024 KB Output is correct
10 Correct 2 ms 8024 KB Output is correct
11 Correct 2 ms 8028 KB Output is correct
12 Correct 2 ms 8024 KB Output is correct
13 Correct 2 ms 8024 KB Output is correct
14 Correct 2 ms 8024 KB Output is correct
15 Correct 2 ms 8024 KB Output is correct
16 Correct 2 ms 8024 KB Output is correct
17 Correct 3 ms 8024 KB Output is correct
18 Correct 2 ms 8280 KB Output is correct
19 Correct 2 ms 8024 KB Output is correct
20 Correct 3 ms 8028 KB Output is correct
21 Correct 2 ms 8024 KB Output is correct
22 Correct 2 ms 8024 KB Output is correct
23 Correct 2 ms 8024 KB Output is correct
24 Correct 2 ms 8024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 8024 KB Output is correct
2 Correct 2 ms 8280 KB Output is correct
3 Correct 2 ms 8028 KB Output is correct
4 Correct 2 ms 8028 KB Output is correct
5 Correct 3 ms 8024 KB Output is correct
6 Correct 2 ms 8280 KB Output is correct
7 Correct 2 ms 8024 KB Output is correct
8 Correct 2 ms 8028 KB Output is correct
9 Correct 2 ms 8024 KB Output is correct
10 Correct 2 ms 8024 KB Output is correct
11 Correct 2 ms 8028 KB Output is correct
12 Correct 2 ms 8024 KB Output is correct
13 Correct 2 ms 8024 KB Output is correct
14 Correct 2 ms 8024 KB Output is correct
15 Correct 2 ms 8024 KB Output is correct
16 Correct 2 ms 8024 KB Output is correct
17 Correct 3 ms 8024 KB Output is correct
18 Correct 2 ms 8280 KB Output is correct
19 Correct 2 ms 8024 KB Output is correct
20 Correct 3 ms 8028 KB Output is correct
21 Correct 2 ms 8024 KB Output is correct
22 Correct 2 ms 8024 KB Output is correct
23 Correct 2 ms 8024 KB Output is correct
24 Correct 2 ms 8024 KB Output is correct
25 Correct 4 ms 8024 KB Output is correct
26 Correct 5 ms 8540 KB Output is correct
27 Correct 3 ms 8280 KB Output is correct
28 Correct 3 ms 8284 KB Output is correct
29 Correct 4 ms 8540 KB Output is correct
30 Correct 3 ms 8280 KB Output is correct
31 Correct 3 ms 8536 KB Output is correct
32 Correct 3 ms 8536 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 8028 KB Output is correct
2 Correct 2 ms 8024 KB Output is correct
3 Correct 2 ms 8280 KB Output is correct
4 Correct 2 ms 8028 KB Output is correct
5 Correct 2 ms 8028 KB Output is correct
6 Correct 3 ms 8024 KB Output is correct
7 Correct 2 ms 8024 KB Output is correct
8 Correct 2 ms 8028 KB Output is correct
9 Correct 2 ms 8024 KB Output is correct
10 Correct 2 ms 8028 KB Output is correct
11 Correct 2 ms 8024 KB Output is correct
12 Correct 2 ms 8024 KB Output is correct
13 Correct 2 ms 8024 KB Output is correct
14 Correct 2 ms 8024 KB Output is correct
15 Correct 2 ms 8024 KB Output is correct
16 Correct 2 ms 8024 KB Output is correct
17 Correct 2 ms 8024 KB Output is correct
18 Correct 2 ms 8024 KB Output is correct
19 Correct 2 ms 8024 KB Output is correct
20 Correct 2 ms 8024 KB Output is correct
21 Correct 2 ms 8024 KB Output is correct
22 Correct 2 ms 8024 KB Output is correct
23 Correct 2 ms 8024 KB Output is correct
24 Correct 2 ms 8024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 8028 KB Output is correct
2 Correct 2 ms 8024 KB Output is correct
3 Correct 2 ms 8280 KB Output is correct
4 Correct 2 ms 8028 KB Output is correct
5 Correct 2 ms 8028 KB Output is correct
6 Correct 3 ms 8024 KB Output is correct
7 Correct 2 ms 8280 KB Output is correct
8 Correct 2 ms 8024 KB Output is correct
9 Correct 2 ms 8028 KB Output is correct
10 Correct 2 ms 8024 KB Output is correct
11 Correct 2 ms 8024 KB Output is correct
12 Correct 2 ms 8028 KB Output is correct
13 Correct 2 ms 8024 KB Output is correct
14 Correct 2 ms 8024 KB Output is correct
15 Correct 2 ms 8024 KB Output is correct
16 Correct 2 ms 8024 KB Output is correct
17 Correct 2 ms 8024 KB Output is correct
18 Correct 3 ms 8024 KB Output is correct
19 Correct 2 ms 8024 KB Output is correct
20 Correct 2 ms 8028 KB Output is correct
21 Correct 2 ms 8024 KB Output is correct
22 Correct 2 ms 8028 KB Output is correct
23 Correct 2 ms 8024 KB Output is correct
24 Correct 2 ms 8024 KB Output is correct
25 Correct 2 ms 8024 KB Output is correct
26 Correct 2 ms 8024 KB Output is correct
27 Correct 2 ms 8024 KB Output is correct
28 Correct 2 ms 8024 KB Output is correct
29 Correct 2 ms 8024 KB Output is correct
30 Correct 2 ms 8024 KB Output is correct
31 Correct 2 ms 8024 KB Output is correct
32 Correct 2 ms 8024 KB Output is correct
33 Correct 2 ms 8024 KB Output is correct
34 Correct 2 ms 8024 KB Output is correct
35 Correct 2 ms 8024 KB Output is correct
36 Correct 2 ms 8024 KB Output is correct
37 Correct 2 ms 8028 KB Output is correct
38 Correct 2 ms 8024 KB Output is correct
39 Correct 2 ms 8024 KB Output is correct
40 Correct 3 ms 8024 KB Output is correct
41 Correct 2 ms 8024 KB Output is correct
42 Correct 3 ms 8280 KB Output is correct
43 Correct 2 ms 8024 KB Output is correct
44 Correct 2 ms 8024 KB Output is correct
45 Correct 2 ms 8024 KB Output is correct
46 Correct 2 ms 8024 KB Output is correct
47 Correct 2 ms 8024 KB Output is correct
48 Correct 2 ms 8024 KB Output is correct
49 Correct 2 ms 8024 KB Output is correct
50 Correct 2 ms 8024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 8028 KB Output is correct
2 Correct 2 ms 8024 KB Output is correct
3 Correct 2 ms 8280 KB Output is correct
4 Correct 2 ms 8028 KB Output is correct
5 Correct 2 ms 8028 KB Output is correct
6 Correct 3 ms 8024 KB Output is correct
7 Correct 2 ms 8280 KB Output is correct
8 Correct 2 ms 8024 KB Output is correct
9 Correct 2 ms 8028 KB Output is correct
10 Correct 2 ms 8024 KB Output is correct
11 Correct 2 ms 8024 KB Output is correct
12 Correct 2 ms 8028 KB Output is correct
13 Correct 2 ms 8024 KB Output is correct
14 Correct 2 ms 8024 KB Output is correct
15 Correct 2 ms 8024 KB Output is correct
16 Correct 2 ms 8024 KB Output is correct
17 Correct 2 ms 8024 KB Output is correct
18 Correct 3 ms 8024 KB Output is correct
19 Correct 2 ms 8280 KB Output is correct
20 Correct 2 ms 8024 KB Output is correct
21 Correct 3 ms 8028 KB Output is correct
22 Correct 2 ms 8024 KB Output is correct
23 Correct 2 ms 8024 KB Output is correct
24 Correct 2 ms 8024 KB Output is correct
25 Correct 2 ms 8024 KB Output is correct
26 Correct 2 ms 8024 KB Output is correct
27 Correct 2 ms 8028 KB Output is correct
28 Correct 2 ms 8024 KB Output is correct
29 Correct 2 ms 8028 KB Output is correct
30 Correct 2 ms 8024 KB Output is correct
31 Correct 2 ms 8024 KB Output is correct
32 Correct 2 ms 8024 KB Output is correct
33 Correct 2 ms 8024 KB Output is correct
34 Correct 2 ms 8024 KB Output is correct
35 Correct 2 ms 8024 KB Output is correct
36 Correct 2 ms 8024 KB Output is correct
37 Correct 2 ms 8024 KB Output is correct
38 Correct 2 ms 8024 KB Output is correct
39 Correct 2 ms 8024 KB Output is correct
40 Correct 2 ms 8024 KB Output is correct
41 Correct 2 ms 8024 KB Output is correct
42 Correct 2 ms 8024 KB Output is correct
43 Correct 2 ms 8024 KB Output is correct
44 Correct 2 ms 8028 KB Output is correct
45 Correct 2 ms 8024 KB Output is correct
46 Correct 2 ms 8024 KB Output is correct
47 Correct 3 ms 8024 KB Output is correct
48 Correct 2 ms 8024 KB Output is correct
49 Correct 3 ms 8280 KB Output is correct
50 Correct 2 ms 8024 KB Output is correct
51 Correct 2 ms 8024 KB Output is correct
52 Correct 2 ms 8024 KB Output is correct
53 Correct 2 ms 8024 KB Output is correct
54 Correct 2 ms 8024 KB Output is correct
55 Correct 2 ms 8024 KB Output is correct
56 Correct 2 ms 8024 KB Output is correct
57 Correct 2 ms 8024 KB Output is correct
58 Correct 2 ms 8028 KB Output is correct
59 Correct 2 ms 8028 KB Output is correct
60 Correct 2 ms 8024 KB Output is correct
61 Correct 2 ms 8280 KB Output is correct
62 Correct 2 ms 8024 KB Output is correct
63 Correct 2 ms 8028 KB Output is correct
64 Correct 3 ms 8024 KB Output is correct
65 Correct 2 ms 8024 KB Output is correct
66 Correct 2 ms 8024 KB Output is correct
67 Correct 2 ms 8028 KB Output is correct
68 Correct 2 ms 8024 KB Output is correct
69 Correct 3 ms 8028 KB Output is correct
70 Correct 2 ms 8028 KB Output is correct
71 Correct 2 ms 8280 KB Output is correct
72 Correct 2 ms 8028 KB Output is correct
73 Correct 2 ms 8024 KB Output is correct
74 Correct 2 ms 8024 KB Output is correct
75 Correct 2 ms 8024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 8028 KB Output is correct
2 Correct 2 ms 8024 KB Output is correct
3 Correct 2 ms 8280 KB Output is correct
4 Correct 2 ms 8028 KB Output is correct
5 Correct 2 ms 8028 KB Output is correct
6 Correct 3 ms 8024 KB Output is correct
7 Correct 2 ms 8280 KB Output is correct
8 Correct 2 ms 8024 KB Output is correct
9 Correct 2 ms 8028 KB Output is correct
10 Correct 2 ms 8024 KB Output is correct
11 Correct 2 ms 8024 KB Output is correct
12 Correct 2 ms 8028 KB Output is correct
13 Correct 2 ms 8024 KB Output is correct
14 Correct 2 ms 8024 KB Output is correct
15 Correct 2 ms 8024 KB Output is correct
16 Correct 2 ms 8024 KB Output is correct
17 Correct 2 ms 8024 KB Output is correct
18 Correct 3 ms 8024 KB Output is correct
19 Correct 2 ms 8280 KB Output is correct
20 Correct 2 ms 8024 KB Output is correct
21 Correct 3 ms 8028 KB Output is correct
22 Correct 2 ms 8024 KB Output is correct
23 Correct 2 ms 8024 KB Output is correct
24 Correct 2 ms 8024 KB Output is correct
25 Correct 2 ms 8024 KB Output is correct
26 Correct 4 ms 8024 KB Output is correct
27 Correct 5 ms 8540 KB Output is correct
28 Correct 3 ms 8280 KB Output is correct
29 Correct 3 ms 8284 KB Output is correct
30 Correct 4 ms 8540 KB Output is correct
31 Correct 3 ms 8280 KB Output is correct
32 Correct 3 ms 8536 KB Output is correct
33 Correct 3 ms 8536 KB Output is correct
34 Correct 2 ms 8024 KB Output is correct
35 Correct 2 ms 8028 KB Output is correct
36 Correct 2 ms 8024 KB Output is correct
37 Correct 2 ms 8028 KB Output is correct
38 Correct 2 ms 8024 KB Output is correct
39 Correct 2 ms 8024 KB Output is correct
40 Correct 2 ms 8024 KB Output is correct
41 Correct 2 ms 8024 KB Output is correct
42 Correct 2 ms 8024 KB Output is correct
43 Correct 2 ms 8024 KB Output is correct
44 Correct 2 ms 8024 KB Output is correct
45 Correct 2 ms 8024 KB Output is correct
46 Correct 2 ms 8024 KB Output is correct
47 Correct 2 ms 8024 KB Output is correct
48 Correct 2 ms 8024 KB Output is correct
49 Correct 2 ms 8024 KB Output is correct
50 Correct 2 ms 8024 KB Output is correct
51 Correct 2 ms 8024 KB Output is correct
52 Correct 2 ms 8028 KB Output is correct
53 Correct 2 ms 8024 KB Output is correct
54 Correct 2 ms 8024 KB Output is correct
55 Correct 3 ms 8024 KB Output is correct
56 Correct 2 ms 8024 KB Output is correct
57 Correct 3 ms 8280 KB Output is correct
58 Correct 2 ms 8024 KB Output is correct
59 Correct 2 ms 8024 KB Output is correct
60 Correct 2 ms 8024 KB Output is correct
61 Correct 2 ms 8024 KB Output is correct
62 Correct 2 ms 8024 KB Output is correct
63 Correct 2 ms 8024 KB Output is correct
64 Correct 2 ms 8024 KB Output is correct
65 Correct 2 ms 8024 KB Output is correct
66 Correct 2 ms 8028 KB Output is correct
67 Correct 2 ms 8028 KB Output is correct
68 Correct 2 ms 8024 KB Output is correct
69 Correct 2 ms 8280 KB Output is correct
70 Correct 2 ms 8024 KB Output is correct
71 Correct 2 ms 8028 KB Output is correct
72 Correct 3 ms 8024 KB Output is correct
73 Correct 2 ms 8024 KB Output is correct
74 Correct 2 ms 8024 KB Output is correct
75 Correct 2 ms 8028 KB Output is correct
76 Correct 2 ms 8024 KB Output is correct
77 Correct 3 ms 8028 KB Output is correct
78 Correct 2 ms 8028 KB Output is correct
79 Correct 2 ms 8280 KB Output is correct
80 Correct 2 ms 8028 KB Output is correct
81 Correct 2 ms 8024 KB Output is correct
82 Correct 2 ms 8024 KB Output is correct
83 Correct 2 ms 8024 KB Output is correct
84 Correct 3 ms 8024 KB Output is correct
85 Correct 4 ms 8024 KB Output is correct
86 Correct 3 ms 8024 KB Output is correct
87 Correct 5 ms 8024 KB Output is correct
88 Correct 5 ms 8024 KB Output is correct
89 Correct 6 ms 8284 KB Output is correct
90 Correct 6 ms 8280 KB Output is correct
91 Correct 6 ms 8280 KB Output is correct
92 Correct 4 ms 8280 KB Output is correct
93 Correct 5 ms 8284 KB Output is correct
94 Correct 3 ms 8536 KB Output is correct
95 Correct 5 ms 8540 KB Output is correct
96 Correct 3 ms 8536 KB Output is correct
97 Correct 4 ms 8536 KB Output is correct
98 Correct 6 ms 8280 KB Output is correct
99 Correct 5 ms 8280 KB Output is correct
100 Correct 4 ms 8280 KB Output is correct
101 Correct 4 ms 8024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 8028 KB Output is correct
2 Correct 2 ms 8024 KB Output is correct
3 Correct 2 ms 8280 KB Output is correct
4 Correct 2 ms 8028 KB Output is correct
5 Correct 2 ms 8028 KB Output is correct
6 Correct 3 ms 8024 KB Output is correct
7 Correct 2 ms 8280 KB Output is correct
8 Correct 2 ms 8024 KB Output is correct
9 Correct 2 ms 8028 KB Output is correct
10 Correct 2 ms 8024 KB Output is correct
11 Correct 2 ms 8024 KB Output is correct
12 Correct 2 ms 8028 KB Output is correct
13 Correct 2 ms 8024 KB Output is correct
14 Correct 2 ms 8024 KB Output is correct
15 Correct 2 ms 8024 KB Output is correct
16 Correct 2 ms 8024 KB Output is correct
17 Correct 2 ms 8024 KB Output is correct
18 Correct 3 ms 8024 KB Output is correct
19 Correct 2 ms 8280 KB Output is correct
20 Correct 2 ms 8024 KB Output is correct
21 Correct 3 ms 8028 KB Output is correct
22 Correct 2 ms 8024 KB Output is correct
23 Correct 2 ms 8024 KB Output is correct
24 Correct 2 ms 8024 KB Output is correct
25 Correct 2 ms 8024 KB Output is correct
26 Correct 4 ms 8024 KB Output is correct
27 Correct 5 ms 8540 KB Output is correct
28 Correct 3 ms 8280 KB Output is correct
29 Correct 3 ms 8284 KB Output is correct
30 Correct 4 ms 8540 KB Output is correct
31 Correct 3 ms 8280 KB Output is correct
32 Correct 3 ms 8536 KB Output is correct
33 Correct 3 ms 8536 KB Output is correct
34 Correct 2 ms 8024 KB Output is correct
35 Correct 2 ms 8028 KB Output is correct
36 Correct 2 ms 8024 KB Output is correct
37 Correct 2 ms 8028 KB Output is correct
38 Correct 2 ms 8024 KB Output is correct
39 Correct 2 ms 8024 KB Output is correct
40 Correct 2 ms 8024 KB Output is correct
41 Correct 2 ms 8024 KB Output is correct
42 Correct 2 ms 8024 KB Output is correct
43 Correct 2 ms 8024 KB Output is correct
44 Correct 2 ms 8024 KB Output is correct
45 Correct 2 ms 8024 KB Output is correct
46 Correct 2 ms 8024 KB Output is correct
47 Correct 2 ms 8024 KB Output is correct
48 Correct 2 ms 8024 KB Output is correct
49 Correct 2 ms 8024 KB Output is correct
50 Correct 2 ms 8024 KB Output is correct
51 Correct 2 ms 8024 KB Output is correct
52 Correct 2 ms 8028 KB Output is correct
53 Correct 2 ms 8024 KB Output is correct
54 Correct 2 ms 8024 KB Output is correct
55 Correct 3 ms 8024 KB Output is correct
56 Correct 2 ms 8024 KB Output is correct
57 Correct 3 ms 8280 KB Output is correct
58 Correct 2 ms 8024 KB Output is correct
59 Correct 2 ms 8024 KB Output is correct
60 Correct 2 ms 8024 KB Output is correct
61 Correct 2 ms 8024 KB Output is correct
62 Correct 2 ms 8024 KB Output is correct
63 Correct 2 ms 8024 KB Output is correct
64 Correct 2 ms 8024 KB Output is correct
65 Correct 2 ms 8024 KB Output is correct
66 Correct 2 ms 8028 KB Output is correct
67 Correct 2 ms 8028 KB Output is correct
68 Correct 2 ms 8024 KB Output is correct
69 Correct 2 ms 8280 KB Output is correct
70 Correct 2 ms 8024 KB Output is correct
71 Correct 2 ms 8028 KB Output is correct
72 Correct 3 ms 8024 KB Output is correct
73 Correct 2 ms 8024 KB Output is correct
74 Correct 2 ms 8024 KB Output is correct
75 Correct 2 ms 8028 KB Output is correct
76 Correct 2 ms 8024 KB Output is correct
77 Correct 3 ms 8028 KB Output is correct
78 Correct 2 ms 8028 KB Output is correct
79 Correct 2 ms 8280 KB Output is correct
80 Correct 2 ms 8028 KB Output is correct
81 Correct 2 ms 8024 KB Output is correct
82 Correct 2 ms 8024 KB Output is correct
83 Correct 2 ms 8024 KB Output is correct
84 Correct 3 ms 8024 KB Output is correct
85 Correct 4 ms 8024 KB Output is correct
86 Correct 3 ms 8024 KB Output is correct
87 Correct 5 ms 8024 KB Output is correct
88 Correct 5 ms 8024 KB Output is correct
89 Correct 6 ms 8284 KB Output is correct
90 Correct 6 ms 8280 KB Output is correct
91 Correct 6 ms 8280 KB Output is correct
92 Correct 4 ms 8280 KB Output is correct
93 Correct 5 ms 8284 KB Output is correct
94 Correct 3 ms 8536 KB Output is correct
95 Correct 5 ms 8540 KB Output is correct
96 Correct 3 ms 8536 KB Output is correct
97 Correct 4 ms 8536 KB Output is correct
98 Correct 6 ms 8280 KB Output is correct
99 Correct 5 ms 8280 KB Output is correct
100 Correct 4 ms 8280 KB Output is correct
101 Correct 4 ms 8024 KB Output is correct
102 Correct 99 ms 10576 KB Output is correct
103 Correct 120 ms 10448 KB Output is correct
104 Correct 278 ms 35144 KB Output is correct
105 Correct 233 ms 12560 KB Output is correct
106 Correct 257 ms 11740 KB Output is correct
107 Correct 68 ms 33724 KB Output is correct
108 Correct 71 ms 35520 KB Output is correct
109 Correct 86 ms 34488 KB Output is correct
110 Correct 508 ms 30012 KB Output is correct
111 Correct 437 ms 31568 KB Output is correct
112 Correct 165 ms 29704 KB Output is correct
113 Correct 168 ms 28868 KB Output is correct
114 Correct 155 ms 29148 KB Output is correct
115 Correct 105 ms 35084 KB Output is correct
116 Correct 522 ms 31436 KB Output is correct
117 Correct 196 ms 36984 KB Output is correct
118 Correct 583 ms 29644 KB Output is correct
119 Correct 233 ms 14724 KB Output is correct
120 Correct 116 ms 10804 KB Output is correct