답안 #63593

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
63593 2018-08-02T08:42:32 Z zetapi Alternating Current (BOI18_alternating) C++14
100 / 100
107 ms 15480 KB
#include <bits/stdc++.h>
using namespace std;

#define pb  push_back
#define mp  make_pair
#define int long long
#define itr ::iterator 

#define start  first
#define length second.first

typedef pair<int,int>  pii;

const int MAX=1e5;

bool cmp(const pair<int,pii> X,const pair<int,pii> Y)
{
	if(X.start==Y.start)
		return X.length>Y.length;
	return X.start<Y.start;
}

vector<pair<int,pii>> arr;
vector<int> vec,Enclosed[MAX];

int N,M,X,Y,par[MAX],mark[MAX];	
int len,cur,pre;

int root(int X)
{
	if(par[X]==X)
		return X;
	return par[X]=root(par[X]);
}

bool Subset(int X,int Y)
{
	int RelativeStart=(arr[X].start-arr[Y].start+N)%N;
	return RelativeStart+arr[X].length<=arr[Y].length;
}

void Alternate()
{
	for(int A=0;A<vec.size();A++)
		mark[arr[vec[A]].second.second]=A%2;
	for(int A=0;A<vec.size();A++)
	{
		for(auto B:Enclosed[vec[A]])
			mark[arr[B].second.second]=mark[arr[vec[A]].second.second]^1;
	}
	return ;
}

bool ok()
{
	int BIT[MAX];
	for(int A=0;A<2;A++)
	{
		for(int B=0;B<N;B++)
			BIT[B]=0;
		for(int B=0;B<M;B++)
		{
			if(mark[arr[B].second.second]!=A)
				continue;
			//cout<<"original index "<<B<<" start "<<arr[B].start<<"  length "<<arr[B].length<<"\n";
			if(arr[B].start+arr[B].length-1>=N)
			{
				BIT[0]++;
				BIT[arr[B].start]++;
				BIT[(arr[B].start+arr[B].length-1)%N+1]--;
			}
			else
			{
				BIT[arr[B].start]++;
				BIT[arr[B].start+arr[B].length]--;
			}	
		}
		for(int A=0;A<N;A++)
		{
			BIT[A+1]+=BIT[A];
			if(!BIT[A])
				return false;
		}
	}
	return true;
}

bool ok(int L,int R,int col)
{
	int Start=vec[L];
	int End=vec[R];
	int len=(End-Start+M-1)%M+1;
	int high=arr[Start].start;
	for(int A=0;A<len;A++)
	{
		int cur=(Start+A)%M;
		if(mark[arr[cur].second.second]!=col)
			continue;
		int now=arr[cur].start;
		if(cur<Start)
			now+=N;
		if(now>high)
			return false;
		high=max(high,now+arr[cur].length);
	}
	int now=arr[End].start;
	if(End<=Start)
		now+=N;
	return now<=high;
}

void color(int X,int C)
{
	if(C>=0)
		mark[arr[vec[X]].second.second]=C;
	for(auto A:Enclosed[vec[X]])
		mark[arr[A].second.second]=!mark[arr[vec[X]].second.second];
	return ;
}

signed main()
{
	ios_base::sync_with_stdio(false);

	cin>>N>>M;
	for(int A=0;A<M;A++)
	{
		par[A]=A;
		cin>>X>>Y;
		X--;
		Y--;
		len=(Y-X+N)%N+1;
		arr.pb(mp(X,mp(len,A)));
	}	
	sort(arr.begin(),arr.end(),cmp);
	pre=0;
	for(int A=1;A<2*M;A++)
	{
		cur=A%M;
		if(Subset(cur,pre))
			par[cur]=pre;
		else
			pre=cur;	
	}
	for(int A=0;A<M;A++)
	{
		cur=root(A);
		if(A==cur)
			vec.pb(A);
		else
			Enclosed[cur].pb(A);
	}
	if(!(vec.size()%2))
	{
		Alternate();
		if(ok())
			for(int A=0;A<M;A++)
				cout<<mark[A];
		else
			cout<<"impossible\n";
		return 0;
	}
	else
	{
		for(int A=0;A<vec.size();A++)
		{
			int a=(A+0+vec.size())%vec.size();
			int b=(A+1+vec.size())%vec.size();
			int c=(A+2+vec.size())%vec.size();
			int d=(A+3+vec.size())%vec.size();	
			color(a,1);
			color(b,0);
			color(c,0);
			color(d,1);
			if(ok(a,d,1))
			{
				for(int A=0;A<vec.size();A++)
				{
					int cur=(d+A)%vec.size();
					if(cur==a or cur==b or cur==c or cur==d)
						continue;
					mark[arr[vec[cur]].second.second]=!mark[arr[vec[(cur-1+vec.size())%vec.size()]].second.second];
				}
				for(int A=0;A<vec.size();A++)
					color(A,-1);
				if(ok())
				{
					for(int A=0;A<M;A++)
						cout<<mark[A];
					return 0;
				}
				else
					cout<<"impossible";
				return 0;
			}
		}
	}
	cout<<"impossible";
	return 0;
}

Compilation message

alternating.cpp: In function 'void Alternate()':
alternating.cpp:44:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int A=0;A<vec.size();A++)
              ~^~~~~~~~~~~
alternating.cpp:46:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int A=0;A<vec.size();A++)
              ~^~~~~~~~~~~
alternating.cpp: In function 'int main()':
alternating.cpp:165:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int A=0;A<vec.size();A++)
               ~^~~~~~~~~~~
alternating.cpp:177:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int A=0;A<vec.size();A++)
                 ~^~~~~~~~~~~
alternating.cpp:184:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int A=0;A<vec.size();A++)
                 ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 2680 KB Output is correct
2 Correct 4 ms 2788 KB Output is correct
3 Correct 5 ms 2788 KB Output is correct
4 Correct 5 ms 2812 KB Output is correct
5 Correct 5 ms 2876 KB Output is correct
6 Correct 4 ms 2924 KB Output is correct
7 Correct 4 ms 2924 KB Output is correct
8 Correct 4 ms 2924 KB Output is correct
9 Correct 5 ms 2924 KB Output is correct
10 Correct 5 ms 2924 KB Output is correct
11 Correct 6 ms 2924 KB Output is correct
12 Correct 5 ms 2924 KB Output is correct
13 Correct 4 ms 2924 KB Output is correct
14 Correct 5 ms 2924 KB Output is correct
15 Correct 6 ms 2924 KB Output is correct
16 Correct 5 ms 2924 KB Output is correct
17 Correct 5 ms 2924 KB Output is correct
18 Correct 5 ms 2924 KB Output is correct
19 Correct 5 ms 2924 KB Output is correct
20 Correct 6 ms 2924 KB Output is correct
21 Correct 4 ms 2924 KB Output is correct
22 Correct 5 ms 2944 KB Output is correct
23 Correct 5 ms 2944 KB Output is correct
24 Correct 5 ms 2944 KB Output is correct
25 Correct 5 ms 2944 KB Output is correct
26 Correct 5 ms 3004 KB Output is correct
27 Correct 6 ms 3004 KB Output is correct
28 Correct 6 ms 3004 KB Output is correct
29 Correct 5 ms 3004 KB Output is correct
30 Correct 6 ms 3004 KB Output is correct
31 Correct 5 ms 3004 KB Output is correct
32 Correct 5 ms 3004 KB Output is correct
33 Correct 7 ms 3004 KB Output is correct
34 Correct 5 ms 3004 KB Output is correct
35 Correct 6 ms 3004 KB Output is correct
36 Correct 6 ms 3004 KB Output is correct
37 Correct 4 ms 3004 KB Output is correct
38 Correct 6 ms 3004 KB Output is correct
39 Correct 5 ms 3004 KB Output is correct
40 Correct 5 ms 3004 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 2680 KB Output is correct
2 Correct 4 ms 2788 KB Output is correct
3 Correct 5 ms 2788 KB Output is correct
4 Correct 5 ms 2812 KB Output is correct
5 Correct 5 ms 2876 KB Output is correct
6 Correct 4 ms 2924 KB Output is correct
7 Correct 4 ms 2924 KB Output is correct
8 Correct 4 ms 2924 KB Output is correct
9 Correct 5 ms 2924 KB Output is correct
10 Correct 5 ms 2924 KB Output is correct
11 Correct 6 ms 2924 KB Output is correct
12 Correct 5 ms 2924 KB Output is correct
13 Correct 4 ms 2924 KB Output is correct
14 Correct 5 ms 2924 KB Output is correct
15 Correct 6 ms 2924 KB Output is correct
16 Correct 5 ms 2924 KB Output is correct
17 Correct 5 ms 2924 KB Output is correct
18 Correct 5 ms 2924 KB Output is correct
19 Correct 5 ms 2924 KB Output is correct
20 Correct 6 ms 2924 KB Output is correct
21 Correct 4 ms 2924 KB Output is correct
22 Correct 5 ms 2944 KB Output is correct
23 Correct 5 ms 2944 KB Output is correct
24 Correct 5 ms 2944 KB Output is correct
25 Correct 5 ms 2944 KB Output is correct
26 Correct 5 ms 3004 KB Output is correct
27 Correct 6 ms 3004 KB Output is correct
28 Correct 6 ms 3004 KB Output is correct
29 Correct 5 ms 3004 KB Output is correct
30 Correct 6 ms 3004 KB Output is correct
31 Correct 5 ms 3004 KB Output is correct
32 Correct 5 ms 3004 KB Output is correct
33 Correct 7 ms 3004 KB Output is correct
34 Correct 5 ms 3004 KB Output is correct
35 Correct 6 ms 3004 KB Output is correct
36 Correct 6 ms 3004 KB Output is correct
37 Correct 4 ms 3004 KB Output is correct
38 Correct 6 ms 3004 KB Output is correct
39 Correct 5 ms 3004 KB Output is correct
40 Correct 5 ms 3004 KB Output is correct
41 Correct 6 ms 3004 KB Output is correct
42 Correct 4 ms 3004 KB Output is correct
43 Correct 4 ms 3004 KB Output is correct
44 Correct 6 ms 3004 KB Output is correct
45 Correct 6 ms 3004 KB Output is correct
46 Correct 4 ms 3004 KB Output is correct
47 Correct 5 ms 3004 KB Output is correct
48 Correct 5 ms 3004 KB Output is correct
49 Correct 4 ms 3004 KB Output is correct
50 Correct 5 ms 3004 KB Output is correct
51 Correct 4 ms 3004 KB Output is correct
52 Correct 5 ms 3068 KB Output is correct
53 Correct 5 ms 3068 KB Output is correct
54 Correct 5 ms 3068 KB Output is correct
55 Correct 5 ms 3068 KB Output is correct
56 Correct 5 ms 3068 KB Output is correct
57 Correct 6 ms 3068 KB Output is correct
58 Correct 5 ms 3068 KB Output is correct
59 Correct 4 ms 3068 KB Output is correct
60 Correct 4 ms 3068 KB Output is correct
61 Correct 4 ms 3068 KB Output is correct
62 Correct 4 ms 3068 KB Output is correct
63 Correct 4 ms 3068 KB Output is correct
64 Correct 5 ms 3068 KB Output is correct
65 Correct 4 ms 3068 KB Output is correct
66 Correct 5 ms 3068 KB Output is correct
67 Correct 5 ms 3068 KB Output is correct
68 Correct 5 ms 3068 KB Output is correct
69 Correct 6 ms 3068 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 2680 KB Output is correct
2 Correct 4 ms 2788 KB Output is correct
3 Correct 5 ms 2788 KB Output is correct
4 Correct 5 ms 2812 KB Output is correct
5 Correct 5 ms 2876 KB Output is correct
6 Correct 4 ms 2924 KB Output is correct
7 Correct 4 ms 2924 KB Output is correct
8 Correct 4 ms 2924 KB Output is correct
9 Correct 5 ms 2924 KB Output is correct
10 Correct 5 ms 2924 KB Output is correct
11 Correct 6 ms 2924 KB Output is correct
12 Correct 5 ms 2924 KB Output is correct
13 Correct 4 ms 2924 KB Output is correct
14 Correct 5 ms 2924 KB Output is correct
15 Correct 6 ms 2924 KB Output is correct
16 Correct 5 ms 2924 KB Output is correct
17 Correct 5 ms 2924 KB Output is correct
18 Correct 5 ms 2924 KB Output is correct
19 Correct 5 ms 2924 KB Output is correct
20 Correct 6 ms 2924 KB Output is correct
21 Correct 4 ms 2924 KB Output is correct
22 Correct 5 ms 2944 KB Output is correct
23 Correct 5 ms 2944 KB Output is correct
24 Correct 5 ms 2944 KB Output is correct
25 Correct 5 ms 2944 KB Output is correct
26 Correct 5 ms 3004 KB Output is correct
27 Correct 6 ms 3004 KB Output is correct
28 Correct 6 ms 3004 KB Output is correct
29 Correct 5 ms 3004 KB Output is correct
30 Correct 6 ms 3004 KB Output is correct
31 Correct 5 ms 3004 KB Output is correct
32 Correct 5 ms 3004 KB Output is correct
33 Correct 7 ms 3004 KB Output is correct
34 Correct 5 ms 3004 KB Output is correct
35 Correct 6 ms 3004 KB Output is correct
36 Correct 6 ms 3004 KB Output is correct
37 Correct 4 ms 3004 KB Output is correct
38 Correct 6 ms 3004 KB Output is correct
39 Correct 5 ms 3004 KB Output is correct
40 Correct 5 ms 3004 KB Output is correct
41 Correct 6 ms 3004 KB Output is correct
42 Correct 4 ms 3004 KB Output is correct
43 Correct 4 ms 3004 KB Output is correct
44 Correct 6 ms 3004 KB Output is correct
45 Correct 6 ms 3004 KB Output is correct
46 Correct 4 ms 3004 KB Output is correct
47 Correct 5 ms 3004 KB Output is correct
48 Correct 5 ms 3004 KB Output is correct
49 Correct 4 ms 3004 KB Output is correct
50 Correct 5 ms 3004 KB Output is correct
51 Correct 4 ms 3004 KB Output is correct
52 Correct 5 ms 3068 KB Output is correct
53 Correct 5 ms 3068 KB Output is correct
54 Correct 5 ms 3068 KB Output is correct
55 Correct 5 ms 3068 KB Output is correct
56 Correct 5 ms 3068 KB Output is correct
57 Correct 6 ms 3068 KB Output is correct
58 Correct 5 ms 3068 KB Output is correct
59 Correct 4 ms 3068 KB Output is correct
60 Correct 4 ms 3068 KB Output is correct
61 Correct 4 ms 3068 KB Output is correct
62 Correct 4 ms 3068 KB Output is correct
63 Correct 4 ms 3068 KB Output is correct
64 Correct 5 ms 3068 KB Output is correct
65 Correct 4 ms 3068 KB Output is correct
66 Correct 5 ms 3068 KB Output is correct
67 Correct 5 ms 3068 KB Output is correct
68 Correct 5 ms 3068 KB Output is correct
69 Correct 6 ms 3068 KB Output is correct
70 Correct 5 ms 3068 KB Output is correct
71 Correct 6 ms 3068 KB Output is correct
72 Correct 5 ms 3068 KB Output is correct
73 Correct 5 ms 3068 KB Output is correct
74 Correct 5 ms 3068 KB Output is correct
75 Correct 5 ms 3068 KB Output is correct
76 Correct 5 ms 3068 KB Output is correct
77 Correct 6 ms 3068 KB Output is correct
78 Correct 5 ms 3068 KB Output is correct
79 Correct 5 ms 3068 KB Output is correct
80 Correct 5 ms 3068 KB Output is correct
81 Correct 4 ms 3068 KB Output is correct
82 Correct 5 ms 3068 KB Output is correct
83 Correct 5 ms 3068 KB Output is correct
84 Correct 7 ms 3068 KB Output is correct
85 Correct 5 ms 3068 KB Output is correct
86 Correct 5 ms 3068 KB Output is correct
87 Correct 7 ms 3068 KB Output is correct
88 Correct 5 ms 3068 KB Output is correct
89 Correct 5 ms 3068 KB Output is correct
90 Correct 6 ms 3068 KB Output is correct
91 Correct 5 ms 3068 KB Output is correct
92 Correct 6 ms 3068 KB Output is correct
93 Correct 6 ms 3068 KB Output is correct
94 Correct 5 ms 3068 KB Output is correct
95 Correct 5 ms 3068 KB Output is correct
96 Correct 6 ms 3068 KB Output is correct
97 Correct 7 ms 3068 KB Output is correct
98 Correct 6 ms 3068 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 73 ms 9588 KB Output is correct
2 Correct 6 ms 9588 KB Output is correct
3 Correct 35 ms 9588 KB Output is correct
4 Correct 34 ms 9588 KB Output is correct
5 Correct 77 ms 9588 KB Output is correct
6 Correct 82 ms 9588 KB Output is correct
7 Correct 92 ms 9588 KB Output is correct
8 Correct 9 ms 9588 KB Output is correct
9 Correct 9 ms 9588 KB Output is correct
10 Correct 85 ms 9588 KB Output is correct
11 Correct 60 ms 9588 KB Output is correct
12 Correct 75 ms 9588 KB Output is correct
13 Correct 5 ms 9588 KB Output is correct
14 Correct 6 ms 9588 KB Output is correct
15 Correct 107 ms 9624 KB Output is correct
16 Correct 32 ms 9624 KB Output is correct
17 Correct 75 ms 9624 KB Output is correct
18 Correct 81 ms 9624 KB Output is correct
19 Correct 9 ms 9624 KB Output is correct
20 Correct 89 ms 9624 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 2680 KB Output is correct
2 Correct 4 ms 2788 KB Output is correct
3 Correct 5 ms 2788 KB Output is correct
4 Correct 5 ms 2812 KB Output is correct
5 Correct 5 ms 2876 KB Output is correct
6 Correct 4 ms 2924 KB Output is correct
7 Correct 4 ms 2924 KB Output is correct
8 Correct 4 ms 2924 KB Output is correct
9 Correct 5 ms 2924 KB Output is correct
10 Correct 5 ms 2924 KB Output is correct
11 Correct 6 ms 2924 KB Output is correct
12 Correct 5 ms 2924 KB Output is correct
13 Correct 4 ms 2924 KB Output is correct
14 Correct 5 ms 2924 KB Output is correct
15 Correct 6 ms 2924 KB Output is correct
16 Correct 5 ms 2924 KB Output is correct
17 Correct 5 ms 2924 KB Output is correct
18 Correct 5 ms 2924 KB Output is correct
19 Correct 5 ms 2924 KB Output is correct
20 Correct 6 ms 2924 KB Output is correct
21 Correct 4 ms 2924 KB Output is correct
22 Correct 5 ms 2944 KB Output is correct
23 Correct 5 ms 2944 KB Output is correct
24 Correct 5 ms 2944 KB Output is correct
25 Correct 5 ms 2944 KB Output is correct
26 Correct 5 ms 3004 KB Output is correct
27 Correct 6 ms 3004 KB Output is correct
28 Correct 6 ms 3004 KB Output is correct
29 Correct 5 ms 3004 KB Output is correct
30 Correct 6 ms 3004 KB Output is correct
31 Correct 5 ms 3004 KB Output is correct
32 Correct 5 ms 3004 KB Output is correct
33 Correct 7 ms 3004 KB Output is correct
34 Correct 5 ms 3004 KB Output is correct
35 Correct 6 ms 3004 KB Output is correct
36 Correct 6 ms 3004 KB Output is correct
37 Correct 4 ms 3004 KB Output is correct
38 Correct 6 ms 3004 KB Output is correct
39 Correct 5 ms 3004 KB Output is correct
40 Correct 5 ms 3004 KB Output is correct
41 Correct 6 ms 3004 KB Output is correct
42 Correct 4 ms 3004 KB Output is correct
43 Correct 4 ms 3004 KB Output is correct
44 Correct 6 ms 3004 KB Output is correct
45 Correct 6 ms 3004 KB Output is correct
46 Correct 4 ms 3004 KB Output is correct
47 Correct 5 ms 3004 KB Output is correct
48 Correct 5 ms 3004 KB Output is correct
49 Correct 4 ms 3004 KB Output is correct
50 Correct 5 ms 3004 KB Output is correct
51 Correct 4 ms 3004 KB Output is correct
52 Correct 5 ms 3068 KB Output is correct
53 Correct 5 ms 3068 KB Output is correct
54 Correct 5 ms 3068 KB Output is correct
55 Correct 5 ms 3068 KB Output is correct
56 Correct 5 ms 3068 KB Output is correct
57 Correct 6 ms 3068 KB Output is correct
58 Correct 5 ms 3068 KB Output is correct
59 Correct 4 ms 3068 KB Output is correct
60 Correct 4 ms 3068 KB Output is correct
61 Correct 4 ms 3068 KB Output is correct
62 Correct 4 ms 3068 KB Output is correct
63 Correct 4 ms 3068 KB Output is correct
64 Correct 5 ms 3068 KB Output is correct
65 Correct 4 ms 3068 KB Output is correct
66 Correct 5 ms 3068 KB Output is correct
67 Correct 5 ms 3068 KB Output is correct
68 Correct 5 ms 3068 KB Output is correct
69 Correct 6 ms 3068 KB Output is correct
70 Correct 5 ms 3068 KB Output is correct
71 Correct 6 ms 3068 KB Output is correct
72 Correct 5 ms 3068 KB Output is correct
73 Correct 5 ms 3068 KB Output is correct
74 Correct 5 ms 3068 KB Output is correct
75 Correct 5 ms 3068 KB Output is correct
76 Correct 5 ms 3068 KB Output is correct
77 Correct 6 ms 3068 KB Output is correct
78 Correct 5 ms 3068 KB Output is correct
79 Correct 5 ms 3068 KB Output is correct
80 Correct 5 ms 3068 KB Output is correct
81 Correct 4 ms 3068 KB Output is correct
82 Correct 5 ms 3068 KB Output is correct
83 Correct 5 ms 3068 KB Output is correct
84 Correct 7 ms 3068 KB Output is correct
85 Correct 5 ms 3068 KB Output is correct
86 Correct 5 ms 3068 KB Output is correct
87 Correct 7 ms 3068 KB Output is correct
88 Correct 5 ms 3068 KB Output is correct
89 Correct 5 ms 3068 KB Output is correct
90 Correct 6 ms 3068 KB Output is correct
91 Correct 5 ms 3068 KB Output is correct
92 Correct 6 ms 3068 KB Output is correct
93 Correct 6 ms 3068 KB Output is correct
94 Correct 5 ms 3068 KB Output is correct
95 Correct 5 ms 3068 KB Output is correct
96 Correct 6 ms 3068 KB Output is correct
97 Correct 7 ms 3068 KB Output is correct
98 Correct 6 ms 3068 KB Output is correct
99 Correct 73 ms 9588 KB Output is correct
100 Correct 6 ms 9588 KB Output is correct
101 Correct 35 ms 9588 KB Output is correct
102 Correct 34 ms 9588 KB Output is correct
103 Correct 77 ms 9588 KB Output is correct
104 Correct 82 ms 9588 KB Output is correct
105 Correct 92 ms 9588 KB Output is correct
106 Correct 9 ms 9588 KB Output is correct
107 Correct 9 ms 9588 KB Output is correct
108 Correct 85 ms 9588 KB Output is correct
109 Correct 60 ms 9588 KB Output is correct
110 Correct 75 ms 9588 KB Output is correct
111 Correct 5 ms 9588 KB Output is correct
112 Correct 6 ms 9588 KB Output is correct
113 Correct 107 ms 9624 KB Output is correct
114 Correct 32 ms 9624 KB Output is correct
115 Correct 75 ms 9624 KB Output is correct
116 Correct 81 ms 9624 KB Output is correct
117 Correct 9 ms 9624 KB Output is correct
118 Correct 89 ms 9624 KB Output is correct
119 Correct 6 ms 9624 KB Output is correct
120 Correct 80 ms 9624 KB Output is correct
121 Correct 38 ms 9624 KB Output is correct
122 Correct 5 ms 9624 KB Output is correct
123 Correct 12 ms 9624 KB Output is correct
124 Correct 31 ms 9624 KB Output is correct
125 Correct 38 ms 9624 KB Output is correct
126 Correct 7 ms 9624 KB Output is correct
127 Correct 18 ms 9624 KB Output is correct
128 Correct 63 ms 11488 KB Output is correct
129 Correct 45 ms 11488 KB Output is correct
130 Correct 61 ms 11488 KB Output is correct
131 Correct 7 ms 11488 KB Output is correct
132 Correct 6 ms 11488 KB Output is correct
133 Correct 77 ms 14372 KB Output is correct
134 Correct 28 ms 14372 KB Output is correct
135 Correct 6 ms 14372 KB Output is correct
136 Correct 47 ms 14372 KB Output is correct
137 Correct 62 ms 15480 KB Output is correct
138 Correct 8 ms 15480 KB Output is correct