답안 #978220

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
978220 2024-05-09T04:06:42 Z model_code Tricolor Lights (JOI24_tricolor) C++17
100 / 100
123 ms 8288 KB
//L=28

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef __int128 lll;
using ull = unsigned long long;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define si(x) ll(x.size())
#define rep(i,n) for(ll i=0;i<n;i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define rng(i,l,r) for(ll i=l;i<r;i++)
#define gnr(i,l,r) for(ll i=r-1;i>=l;i--)
#define fore(i, a) for(auto &&i : a)
#define fore2(a, b, v) for(auto &&[a, b] : v)
#define fore3(a, b, c, v) for(auto &&[a, b, c] : v)

#include "Anna.h"

namespace{

vector<int> de_Bruijn(int typ){
	//ternaries of 3 digits
	//except numbers whose digits are all (1 or 2) (ex. 121)

	//also exept

	//typ=0: 
	//typ=1: 010,101
	//typ=2: 000,010,101
	//typ=3: 010,101,020,202

	ll len=3;
	//make graph
	ll n=pow(3,len-1);
	vector<vector<pair<ll,ll> > >g(n);
	auto valid=[&](ll x){
		//valid as an edge?
		if(typ>=1&&x==3)return 0;
		if(typ>=1&&x==9+1)return 0;
		if(typ==2&&x==0)return 0;
		if(typ==3&&x==2*3)return 0;
		if(typ==3&&x==2*9+2*1)return 0;
		rep(_,len){
			if(x%3==0)return 1;
			x/=3;
		}
		return 0;
	};
	rep(i,3*n)if(valid(i)){
		ll x=i/3;
		ll y=i%n;
		g[x].eb(y,i%3);
	}

	// {
	// 	vector<int> cnt(n,0);
	// 	rep(i,n)rep(j,si(g[i]))cnt[g[i][j].first]++;
	// 	rep(i,n)if(cnt[i]!=si(g[i])){
	// 		cout<<"invalid graph: degree sum is not 0"<<endl;
	// 	}
	// }

	//generate sequence (get an euler cycle of the graph)
	vector<int> ans;
	function<void(ll,ll)> dfs=[&](ll x,ll col){
		while(si(g[x])){
			auto [nxt,ncol]=g[x].back();
			g[x].pop_back();
			dfs(nxt,ncol);
		}
		ans.pb(col);
	};
	ll start_vertex=0;
	dfs(start_vertex,-1);
	ans.pop_back();
	reverse(all(ans));
	return ans;
}

}

pair<string,int> anna(int N,string S){
	string str="RGB";
	int B=9,L=28;
	const int TYP=4; 
	string T;
	rep(i,N+B)T+='#';
	ll id=0;

	//make 4 de_Bruijn-like sequences of period 19, 17, 16, 15
	//they make a de_Bruijn-like sequence of period LCM(19,17,16,15)
	vector<int> seq[TYP];
	rep(typ,TYP)seq[typ]=de_Bruijn(typ);

	rep(i,N/B+1){
		//repeat blocks 
		//control differnce of adjacent digits mod 3
		//a block is: (?) * ? * ? * ? * (1 or 2)
		//	?: over control
		//	*: fully under control (either 0,1,2)
		rep(typ,TYP){
			//write de Bruijn_like sequences at *s
			rep(x,3)if(str[x]!=S[id]){
				rep(y,3)if(str[y]!=S[id+1]){
					if((x-y+3)%3==seq[typ][i%si(seq[typ])]){
						T[id++]=str[x];
						T[id++]=str[y];
						x=y=3;
					}
				}
			}
		}
		rep(x,3)if(str[x]!=S[id]&&str[x]!=T[id-1]){
			T[id++]=str[x];
			break;
		}
	}
	while(si(T)>N)T.pop_back();
	if(L>N)L=N;
	return {T,L};
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef __int128 lll;
using ull = unsigned long long;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define si(x) ll(x.size())
#define rep(i,n) for(ll i=0;i<n;i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define rng(i,l,r) for(ll i=l;i<r;i++)
#define gnr(i,l,r) for(ll i=r-1;i>=l;i--)
#define fore(i, a) for(auto &&i : a)
#define fore2(a, b, v) for(auto &&[a, b] : v)
#define fore3(a, b, c, v) for(auto &&[a, b, c] : v)
#include "Bruno.h"

namespace{
	int N,L;
	const int B=9,TYP=4;

//same as Anna
vector<int> de_Bruijn(int typ){
	//ternaries of 3 digits
	//except numbers whose digits are all (1 or 2) (ex. 121)

	//also exept

	//typ=0: 
	//typ=1: 010,101
	//typ=2: 000,010,101
	//typ=3: 010,101,020,202

	ll len=3;
	//make graph
	ll n=pow(3,len-1);
	vector<vector<pair<ll,ll> > >g(n);
	auto valid=[&](ll x){
		//valid as an edge?
		if(typ>=1&&x==3)return 0;
		if(typ>=1&&x==9+1)return 0;
		if(typ==2&&x==0)return 0;
		if(typ==3&&x==2*3)return 0;
		if(typ==3&&x==2*9+2*1)return 0;
		rep(_,len){
			if(x%3==0)return 1;
			x/=3;
		}
		return 0;
	};
	rep(i,3*n)if(valid(i)){
		ll x=i/3;
		ll y=i%n;
		g[x].eb(y,i%3);
	}

	// {
	// 	vector<int> cnt(n,0);
	// 	rep(i,n)rep(j,si(g[i]))cnt[g[i][j].first]++;
	// 	rep(i,n)if(cnt[i]!=si(g[i])){
	// 		cout<<"invalid graph: degree sum is not 0"<<endl;
	// 	}
	// }

	//generate sequence (get an euler cycle of the graph)
	vector<int> ans;
	function<void(ll,ll)> dfs=[&](ll x,ll col){
		while(si(g[x])){
			auto [nxt,ncol]=g[x].back();
			g[x].pop_back();
			dfs(nxt,ncol);
		}
		ans.pb(col);
	};
	ll start_vertex=0;
	dfs(start_vertex,-1);
	ans.pop_back();
	reverse(all(ans));
	return ans;
}

vector<int> seq[TYP];
map<ll,ll> rv[TYP];
map<tuple<ll,ll,ll,ll>,ll> block_id;

}

void init(int n,int l){
	N=n,L=l;
	//pre-calculate the difference sequence Anna generates
	ll bruijn_len=3;
	rep(typ,TYP){
		seq[typ]=de_Bruijn(typ);
		ll x=0;
		rep(i,si(seq[typ])+bruijn_len-1){
			x%=(ll)pow(3,bruijn_len-1);
			x=x*3+seq[typ][i%si(seq[typ])];
			if(i-(bruijn_len-1)>=0){
				rv[typ][x]=i-(bruijn_len-1);
			}
		}
	}
	rep(i,N/B+1){
		block_id[make_tuple(i%si(seq[0]),i%si(seq[1]),i%si(seq[2]),i%si(seq[3]))]=i;
	}
}

int bruno(string U){
	string str="RGB";
	if(N==L)return 1;

	//calculate difference sequence
	vll v;
	rep(i,L-1){
		rep(x,3)if(str[x]==U[i]){
			rep(y,3)if(str[y]==U[i+1]){
				v.pb((x-y+3)%3);
			}
		}
	}

	int s; // s...where a block starts at
	{
		//for each remainder mod B(block size), see whether 0s exist in the given defference sequence (length L-1).
		//It can be "No" for only 0,2,4,6,8th places (cf. a block is: ? * ? * ? * ? * (1 or 2) )
		//always "Yes" for 1,3,5,7th places, since we generated de_Bruijn-like sequences in that way
		//always "No" for 8th place.
		//we can determine which is the 8th place, seeing the distance parities of "No" places.
		vector<int> exzero(B,0);
		rep(i,si(v)){
			exzero[i%B]|=v[i]==0;
		}
		vll nonzeros;
		rep(i,B)if(!exzero[i])nonzeros.pb(i);
		if(si(nonzeros)==1){
			s=nonzeros[0];
		}
		else{
			s=nonzeros.back();
			rep(i,si(nonzeros)-1){
				if((nonzeros[i+1]-nonzeros[i])%2==1){
					s=nonzeros[i];
					break;
				}
			}
		}
	}

	//calculate block's place using pre-calculated dictionary (patterns -> number)
	vll pos;
	rep(typ,TYP){
		ll x=0;
		rep(i,si(v))if(i%B==(s+2+2*typ)%B){
			x=x*3+v[i];
		}
		ll pos_=rv[typ][x];
		if(s+2+2*typ-B<0)pos_=(pos_-1+si(seq[typ]))%si(seq[typ]);
		pos.pb(pos_);
	}
	ll res=block_id[make_tuple(pos[0],pos[1],pos[2],pos[3])];
	return res*B+B-2-s+1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 1400 KB Output is correct
2 Correct 23 ms 1288 KB Output is correct
3 Correct 39 ms 1360 KB Output is correct
4 Correct 25 ms 1288 KB Output is correct
5 Correct 32 ms 1324 KB Output is correct
6 Correct 33 ms 1288 KB Output is correct
7 Correct 31 ms 1792 KB Output is correct
8 Correct 55 ms 1324 KB Output is correct
9 Correct 28 ms 1360 KB Output is correct
10 Correct 41 ms 1364 KB Output is correct
11 Correct 37 ms 1344 KB Output is correct
12 Correct 39 ms 1580 KB Output is correct
13 Correct 39 ms 1320 KB Output is correct
14 Correct 30 ms 1332 KB Output is correct
15 Correct 29 ms 1320 KB Output is correct
16 Correct 39 ms 1312 KB Output is correct
17 Correct 30 ms 1296 KB Output is correct
18 Correct 47 ms 1316 KB Output is correct
19 Correct 35 ms 1320 KB Output is correct
20 Correct 33 ms 1332 KB Output is correct
21 Correct 62 ms 1324 KB Output is correct
22 Correct 31 ms 1396 KB Output is correct
23 Correct 30 ms 1288 KB Output is correct
24 Correct 30 ms 1344 KB Output is correct
25 Correct 31 ms 1356 KB Output is correct
26 Correct 32 ms 1292 KB Output is correct
27 Correct 31 ms 1340 KB Output is correct
28 Correct 32 ms 1328 KB Output is correct
29 Correct 32 ms 1412 KB Output is correct
30 Correct 32 ms 1296 KB Output is correct
31 Correct 32 ms 1624 KB Output is correct
32 Correct 31 ms 1340 KB Output is correct
33 Correct 65 ms 1324 KB Output is correct
34 Correct 24 ms 1296 KB Output is correct
35 Correct 25 ms 1316 KB Output is correct
36 Correct 31 ms 1292 KB Output is correct
37 Correct 32 ms 1336 KB Output is correct
38 Correct 32 ms 1368 KB Output is correct
39 Correct 32 ms 1400 KB Output is correct
40 Correct 36 ms 1324 KB Output is correct
41 Correct 60 ms 1376 KB Output is correct
42 Correct 31 ms 1364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 1400 KB Output is correct
2 Correct 23 ms 1288 KB Output is correct
3 Correct 39 ms 1360 KB Output is correct
4 Correct 25 ms 1288 KB Output is correct
5 Correct 32 ms 1324 KB Output is correct
6 Correct 33 ms 1288 KB Output is correct
7 Correct 31 ms 1792 KB Output is correct
8 Correct 55 ms 1324 KB Output is correct
9 Correct 28 ms 1360 KB Output is correct
10 Correct 41 ms 1364 KB Output is correct
11 Correct 37 ms 1344 KB Output is correct
12 Correct 39 ms 1580 KB Output is correct
13 Correct 39 ms 1320 KB Output is correct
14 Correct 30 ms 1332 KB Output is correct
15 Correct 29 ms 1320 KB Output is correct
16 Correct 39 ms 1312 KB Output is correct
17 Correct 30 ms 1296 KB Output is correct
18 Correct 47 ms 1316 KB Output is correct
19 Correct 35 ms 1320 KB Output is correct
20 Correct 33 ms 1332 KB Output is correct
21 Correct 62 ms 1324 KB Output is correct
22 Correct 31 ms 1396 KB Output is correct
23 Correct 30 ms 1288 KB Output is correct
24 Correct 30 ms 1344 KB Output is correct
25 Correct 31 ms 1356 KB Output is correct
26 Correct 32 ms 1292 KB Output is correct
27 Correct 31 ms 1340 KB Output is correct
28 Correct 32 ms 1328 KB Output is correct
29 Correct 32 ms 1412 KB Output is correct
30 Correct 32 ms 1296 KB Output is correct
31 Correct 32 ms 1624 KB Output is correct
32 Correct 31 ms 1340 KB Output is correct
33 Correct 65 ms 1324 KB Output is correct
34 Correct 24 ms 1296 KB Output is correct
35 Correct 25 ms 1316 KB Output is correct
36 Correct 31 ms 1292 KB Output is correct
37 Correct 32 ms 1336 KB Output is correct
38 Correct 32 ms 1368 KB Output is correct
39 Correct 32 ms 1400 KB Output is correct
40 Correct 36 ms 1324 KB Output is correct
41 Correct 60 ms 1376 KB Output is correct
42 Correct 31 ms 1364 KB Output is correct
43 Correct 41 ms 1404 KB Output is correct
44 Correct 37 ms 1332 KB Output is correct
45 Correct 39 ms 1340 KB Output is correct
46 Correct 38 ms 1396 KB Output is correct
47 Correct 36 ms 1356 KB Output is correct
48 Correct 37 ms 1320 KB Output is correct
49 Correct 36 ms 1292 KB Output is correct
50 Correct 55 ms 1320 KB Output is correct
51 Correct 36 ms 1372 KB Output is correct
52 Correct 36 ms 1584 KB Output is correct
53 Correct 40 ms 1364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 1400 KB Output is correct
2 Correct 23 ms 1288 KB Output is correct
3 Correct 39 ms 1360 KB Output is correct
4 Correct 25 ms 1288 KB Output is correct
5 Correct 32 ms 1324 KB Output is correct
6 Correct 33 ms 1288 KB Output is correct
7 Correct 31 ms 1792 KB Output is correct
8 Correct 55 ms 1324 KB Output is correct
9 Correct 28 ms 1360 KB Output is correct
10 Correct 41 ms 1364 KB Output is correct
11 Correct 37 ms 1344 KB Output is correct
12 Correct 39 ms 1580 KB Output is correct
13 Correct 39 ms 1320 KB Output is correct
14 Correct 30 ms 1332 KB Output is correct
15 Correct 29 ms 1320 KB Output is correct
16 Correct 39 ms 1312 KB Output is correct
17 Correct 30 ms 1296 KB Output is correct
18 Correct 47 ms 1316 KB Output is correct
19 Correct 35 ms 1320 KB Output is correct
20 Correct 33 ms 1332 KB Output is correct
21 Correct 62 ms 1324 KB Output is correct
22 Correct 31 ms 1396 KB Output is correct
23 Correct 30 ms 1288 KB Output is correct
24 Correct 30 ms 1344 KB Output is correct
25 Correct 31 ms 1356 KB Output is correct
26 Correct 32 ms 1292 KB Output is correct
27 Correct 31 ms 1340 KB Output is correct
28 Correct 32 ms 1328 KB Output is correct
29 Correct 32 ms 1412 KB Output is correct
30 Correct 32 ms 1296 KB Output is correct
31 Correct 32 ms 1624 KB Output is correct
32 Correct 31 ms 1340 KB Output is correct
33 Correct 65 ms 1324 KB Output is correct
34 Correct 24 ms 1296 KB Output is correct
35 Correct 25 ms 1316 KB Output is correct
36 Correct 31 ms 1292 KB Output is correct
37 Correct 32 ms 1336 KB Output is correct
38 Correct 32 ms 1368 KB Output is correct
39 Correct 32 ms 1400 KB Output is correct
40 Correct 36 ms 1324 KB Output is correct
41 Correct 60 ms 1376 KB Output is correct
42 Correct 31 ms 1364 KB Output is correct
43 Correct 41 ms 1404 KB Output is correct
44 Correct 37 ms 1332 KB Output is correct
45 Correct 39 ms 1340 KB Output is correct
46 Correct 38 ms 1396 KB Output is correct
47 Correct 36 ms 1356 KB Output is correct
48 Correct 37 ms 1320 KB Output is correct
49 Correct 36 ms 1292 KB Output is correct
50 Correct 55 ms 1320 KB Output is correct
51 Correct 36 ms 1372 KB Output is correct
52 Correct 36 ms 1584 KB Output is correct
53 Correct 40 ms 1364 KB Output is correct
54 Correct 35 ms 1380 KB Output is correct
55 Correct 38 ms 1392 KB Output is correct
56 Correct 38 ms 1288 KB Output is correct
57 Correct 36 ms 1388 KB Output is correct
58 Correct 36 ms 1336 KB Output is correct
59 Correct 36 ms 1584 KB Output is correct
60 Correct 37 ms 1408 KB Output is correct
61 Correct 37 ms 1576 KB Output is correct
62 Correct 35 ms 1324 KB Output is correct
63 Correct 36 ms 1352 KB Output is correct
64 Correct 39 ms 1368 KB Output is correct
65 Correct 35 ms 1376 KB Output is correct
66 Correct 56 ms 1316 KB Output is correct
67 Correct 34 ms 1292 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 1400 KB Output is correct
2 Correct 23 ms 1288 KB Output is correct
3 Correct 39 ms 1360 KB Output is correct
4 Correct 25 ms 1288 KB Output is correct
5 Correct 32 ms 1324 KB Output is correct
6 Correct 33 ms 1288 KB Output is correct
7 Correct 31 ms 1792 KB Output is correct
8 Correct 55 ms 1324 KB Output is correct
9 Correct 28 ms 1360 KB Output is correct
10 Correct 41 ms 1364 KB Output is correct
11 Correct 37 ms 1344 KB Output is correct
12 Correct 39 ms 1580 KB Output is correct
13 Correct 39 ms 1320 KB Output is correct
14 Correct 30 ms 1332 KB Output is correct
15 Correct 29 ms 1320 KB Output is correct
16 Correct 39 ms 1312 KB Output is correct
17 Correct 30 ms 1296 KB Output is correct
18 Correct 47 ms 1316 KB Output is correct
19 Correct 35 ms 1320 KB Output is correct
20 Correct 33 ms 1332 KB Output is correct
21 Correct 62 ms 1324 KB Output is correct
22 Correct 31 ms 1396 KB Output is correct
23 Correct 30 ms 1288 KB Output is correct
24 Correct 30 ms 1344 KB Output is correct
25 Correct 31 ms 1356 KB Output is correct
26 Correct 32 ms 1292 KB Output is correct
27 Correct 31 ms 1340 KB Output is correct
28 Correct 32 ms 1328 KB Output is correct
29 Correct 32 ms 1412 KB Output is correct
30 Correct 32 ms 1296 KB Output is correct
31 Correct 32 ms 1624 KB Output is correct
32 Correct 31 ms 1340 KB Output is correct
33 Correct 65 ms 1324 KB Output is correct
34 Correct 24 ms 1296 KB Output is correct
35 Correct 25 ms 1316 KB Output is correct
36 Correct 31 ms 1292 KB Output is correct
37 Correct 32 ms 1336 KB Output is correct
38 Correct 32 ms 1368 KB Output is correct
39 Correct 32 ms 1400 KB Output is correct
40 Correct 36 ms 1324 KB Output is correct
41 Correct 60 ms 1376 KB Output is correct
42 Correct 31 ms 1364 KB Output is correct
43 Correct 41 ms 1404 KB Output is correct
44 Correct 37 ms 1332 KB Output is correct
45 Correct 39 ms 1340 KB Output is correct
46 Correct 38 ms 1396 KB Output is correct
47 Correct 36 ms 1356 KB Output is correct
48 Correct 37 ms 1320 KB Output is correct
49 Correct 36 ms 1292 KB Output is correct
50 Correct 55 ms 1320 KB Output is correct
51 Correct 36 ms 1372 KB Output is correct
52 Correct 36 ms 1584 KB Output is correct
53 Correct 40 ms 1364 KB Output is correct
54 Correct 35 ms 1380 KB Output is correct
55 Correct 38 ms 1392 KB Output is correct
56 Correct 38 ms 1288 KB Output is correct
57 Correct 36 ms 1388 KB Output is correct
58 Correct 36 ms 1336 KB Output is correct
59 Correct 36 ms 1584 KB Output is correct
60 Correct 37 ms 1408 KB Output is correct
61 Correct 37 ms 1576 KB Output is correct
62 Correct 35 ms 1324 KB Output is correct
63 Correct 36 ms 1352 KB Output is correct
64 Correct 39 ms 1368 KB Output is correct
65 Correct 35 ms 1376 KB Output is correct
66 Correct 56 ms 1316 KB Output is correct
67 Correct 34 ms 1292 KB Output is correct
68 Correct 35 ms 1472 KB Output is correct
69 Correct 35 ms 1424 KB Output is correct
70 Correct 44 ms 1404 KB Output is correct
71 Correct 62 ms 1396 KB Output is correct
72 Correct 40 ms 1404 KB Output is correct
73 Correct 36 ms 1404 KB Output is correct
74 Correct 36 ms 1448 KB Output is correct
75 Correct 46 ms 1412 KB Output is correct
76 Correct 37 ms 1424 KB Output is correct
77 Correct 40 ms 1428 KB Output is correct
78 Correct 36 ms 1296 KB Output is correct
79 Correct 37 ms 1464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 1292 KB Output is correct
2 Correct 24 ms 1336 KB Output is correct
3 Correct 48 ms 1308 KB Output is correct
4 Correct 25 ms 1348 KB Output is correct
5 Correct 31 ms 1292 KB Output is correct
6 Correct 31 ms 1548 KB Output is correct
7 Correct 31 ms 1324 KB Output is correct
8 Correct 32 ms 1388 KB Output is correct
9 Correct 35 ms 1344 KB Output is correct
10 Correct 34 ms 1356 KB Output is correct
11 Correct 41 ms 1332 KB Output is correct
12 Correct 35 ms 1320 KB Output is correct
13 Correct 45 ms 1388 KB Output is correct
14 Correct 38 ms 1428 KB Output is correct
15 Correct 81 ms 8100 KB Output is correct
16 Correct 69 ms 8288 KB Output is correct
17 Correct 80 ms 8036 KB Output is correct
18 Correct 26 ms 1288 KB Output is correct
19 Correct 24 ms 1332 KB Output is correct
20 Correct 40 ms 1288 KB Output is correct
21 Correct 40 ms 1356 KB Output is correct
22 Correct 27 ms 1284 KB Output is correct
23 Correct 32 ms 1416 KB Output is correct
24 Correct 32 ms 1324 KB Output is correct
25 Correct 30 ms 1396 KB Output is correct
26 Correct 35 ms 1288 KB Output is correct
27 Correct 31 ms 1292 KB Output is correct
28 Correct 31 ms 1360 KB Output is correct
29 Correct 31 ms 1352 KB Output is correct
30 Correct 30 ms 1388 KB Output is correct
31 Correct 64 ms 1340 KB Output is correct
32 Correct 31 ms 1388 KB Output is correct
33 Correct 60 ms 1396 KB Output is correct
34 Correct 31 ms 1288 KB Output is correct
35 Correct 60 ms 1324 KB Output is correct
36 Correct 31 ms 1288 KB Output is correct
37 Correct 32 ms 1368 KB Output is correct
38 Correct 32 ms 1332 KB Output is correct
39 Correct 32 ms 1352 KB Output is correct
40 Correct 33 ms 1288 KB Output is correct
41 Correct 32 ms 1360 KB Output is correct
42 Correct 32 ms 1336 KB Output is correct
43 Correct 33 ms 1288 KB Output is correct
44 Correct 34 ms 1352 KB Output is correct
45 Correct 34 ms 1288 KB Output is correct
46 Correct 33 ms 1296 KB Output is correct
47 Correct 33 ms 1400 KB Output is correct
48 Correct 35 ms 1300 KB Output is correct
49 Correct 35 ms 1364 KB Output is correct
50 Correct 57 ms 1324 KB Output is correct
51 Correct 37 ms 1360 KB Output is correct
52 Correct 51 ms 1404 KB Output is correct
53 Correct 39 ms 1412 KB Output is correct
54 Correct 56 ms 2828 KB Output is correct
55 Correct 90 ms 8036 KB Output is correct
56 Correct 123 ms 8036 KB Output is correct
57 Correct 90 ms 8008 KB Output is correct
58 Correct 25 ms 1356 KB Output is correct
59 Correct 27 ms 1288 KB Output is correct
60 Correct 37 ms 1356 KB Output is correct
61 Correct 59 ms 1320 KB Output is correct
62 Correct 57 ms 1332 KB Output is correct
63 Correct 35 ms 1336 KB Output is correct
64 Correct 43 ms 1332 KB Output is correct
65 Correct 41 ms 1332 KB Output is correct
66 Correct 44 ms 1404 KB Output is correct
67 Correct 37 ms 1256 KB Output is correct
68 Correct 37 ms 1424 KB Output is correct
69 Correct 100 ms 8172 KB Output is correct
70 Correct 78 ms 8148 KB Output is correct
71 Correct 82 ms 8156 KB Output is correct
72 Correct 35 ms 1352 KB Output is correct
73 Correct 36 ms 1372 KB Output is correct
74 Correct 53 ms 1324 KB Output is correct
75 Correct 37 ms 1320 KB Output is correct
76 Correct 63 ms 1396 KB Output is correct
77 Correct 45 ms 1292 KB Output is correct
78 Correct 96 ms 8152 KB Output is correct
79 Correct 86 ms 8036 KB Output is correct
80 Correct 95 ms 8036 KB Output is correct
81 Correct 38 ms 1324 KB Output is correct
82 Correct 58 ms 1316 KB Output is correct
83 Correct 35 ms 1332 KB Output is correct
84 Correct 42 ms 1336 KB Output is correct
85 Correct 52 ms 1328 KB Output is correct
86 Correct 54 ms 1312 KB Output is correct
87 Correct 57 ms 1392 KB Output is correct
88 Correct 39 ms 1336 KB Output is correct
89 Correct 35 ms 1332 KB Output is correct
90 Correct 37 ms 1400 KB Output is correct
91 Correct 57 ms 1396 KB Output is correct
92 Correct 64 ms 1400 KB Output is correct
93 Correct 89 ms 8036 KB Output is correct
94 Correct 100 ms 8036 KB Output is correct
95 Correct 78 ms 8168 KB Output is correct