QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#85308#5689. 喵了个喵 IIfengyuyueAC ✓1911ms495796kbC++142.9kb2023-03-07 15:49:262023-03-07 15:49:27

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-07 15:49:27]
  • 评测
  • 测评结果:AC
  • 用时:1911ms
  • 内存:495796kb
  • [2023-03-07 15:49:26]
  • 提交

answer

#include<cstdio>
#include<algorithm>
#define cmin(a,b) (a>(b)?a=(b),1:0)
#define cmax(a,b) (a<(b)?a=(b),1:0)
#define dmin(a,b) ((a)<(b)?(a):(b))
#define dmax(a,b) ((a)>(b)?(a):(b))
namespace io
{
	int F()
	{
		int n=0,F=0;
		char ch;
		while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		ch=='-'?F=1:n=ch-'0';
		while((ch=getchar())>='0'&&ch<='9')n=n*10+ch-'0';
		return F?-n:n;
	}
	long long G()
	{
		long long n=0,F=0;
		char ch;
		while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		ch=='-'?F=1:n=ch-'0';
		while((ch=getchar())>='0'&&ch<='9')n=n*10+ch-'0';
		return F?-n:n;
	}
}
const int maxn = 200002;
const int treesize = 3800003;
const int N=7700004,M=22000000;
struct st{
	int no;
	st *lc, *rc;
}t[treesize],*root[maxn],*pt=t;
int now;
struct edge{
	int to;
	int next;
}e[N+M+2];
int pe=N+1;
void insert(int a,int to){
	e[pe]=(edge){to,e[a].next};
	e[a].next=pe++;
}
void addedge(int a,int to){
	insert(a,to);
	insert(to^1,a^1);
}
int dfc,pb;
int dfn[N],low[N],bl[N],s[N];
int ts;
int pl[maxn][5];
struct po{
	int l,r;
	int no;
}p[maxn];
int pp;
bool operator <(const po &x, const po &y){
	return x.r<y.r;
}
int pno;
st* insert(st* o, int l, int r, int p, int no){
	st* ret = pt++;
	*ret = (st){pno,o->lc,o->rc};
	pno+=2;
	if(l==r){
		addedge(ret->no,no);
		return ret;
	}
	int mid=l+r>>1;
	if(p<=mid){
		ret->lc=insert(o->lc,l,mid,p,no);
	}
	else{
		ret->rc=insert(o->rc,mid+1,r,p,no);
	}
	addedge(ret->no,ret->lc->no);
	addedge(ret->no,ret->rc->no);
	return ret;
}
void insert(st* o, int l, int r, int ll, int rr, int fr){
	if(o==t){
		return;
	}
	if(ll<=l&&rr>=r){
		addedge(fr,o->no);
		return;
	}
	int mid=l+r>>1;
	if(ll<=mid){
		insert(o->lc,l,mid,ll,rr,fr);
	}
	if(rr>mid){
		insert(o->rc,mid+1,r,ll,rr,fr);
	}
}
void dfs(int o){
	low[o]=dfn[o]=++dfc;
	s[++ts]=o;
	for(int p=e[o].next;p;p=e[p].next){
		if(!dfn[e[p].to]){
			dfs(e[p].to);
			cmin(low[o],low[e[p].to]);
		}
		else if(!bl[e[p].to]){
			cmin(low[o],dfn[e[p].to]);
		}
	}
	if(low[o]==dfn[o]){
		++pb;
		do{
			bl[s[ts]]=pb;
		}
		while(s[ts--]!=o);
	}
}
char ans[maxn];
int main()
{
	int n=io::F();
	for(int i=1;i<=4*n;++i){
		int a=io::F();
		pl[a][++pl[a][0]]=i;
	}
	for(int i=1;i<=n;++i){
		p[++pp]=(po){pl[i][1],pl[i][2],pno};
		p[++pp]=(po){pl[i][3],pl[i][4],pno};
		p[++pp]=(po){pl[i][1],pl[i][3],pno+1};
		p[++pp]=(po){pl[i][2],pl[i][4],pno+1};
		pno+=2;
	}
	std::sort(p+1,p+pp+1);
	*pt=(st){pno,t,t};
	pno+=2;
	root[0]=pt++;
	for(int i=1;i<=4*n;++i){
		insert(root[now],1,4*n,p[i].l,4*n,p[i].no);
		root[now+1]=insert(root[now],1,4*n,p[i].l,p[i].no^1);
		++now;
	}
	for(int i=0;i<pno;++i){
		if(!dfn[i]){
			dfs(i);
		}
	}
	for(int i=0;i<pno;i+=2){
		if(bl[i]==bl[i+1]){
			puts("No");
			return 0;
		}
	}
	puts("Yes");
	for(int i=1;i<=4*n;++i){
		if(bl[p[i].no]<bl[p[i].no^1]){
			ans[p[i].l]='0';
			ans[p[i].r]='1';
		}
	}
	puts(ans+1);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 569ms
memory: 375368kb

input:

50000
12725 41478 2443 1096 36968 36898 3393 45898 43154 26629 22985 37972 13935 25628 40196 40293 39791 29109 455 45812 12634 21086 8928 13600 25416 30244 15917 22568 35849 40189 27442 28785 46334 25651 7172 30994 39724 27853 47091 21306 42087 31612 22081 23002 17127 15269 11569 8254 41080 30112 31...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #2:

score: 0
Accepted
time: 587ms
memory: 421512kb

input:

50000
39298 39298 14319 14319 11620 11620 20424 20424 14345 14345 28478 28478 11587 11587 25545 25545 24607 24607 18203 18203 30593 30593 144 144 2117 2117 14201 14201 27012 27012 20683 20683 39367 39367 7902 7902 12365 12365 17601 17601 29145 29145 15133 15133 47765 47765 22205 22205 13706 13706 20...

output:

Yes
01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...

result:

ok correct

Test #3:

score: 0
Accepted
time: 451ms
memory: 383100kb

input:

50000
21684 21684 49246 49246 20339 20339 12374 12374 25130 25130 30869 30869 21854 21854 19251 19251 24016 24016 4812 4812 13915 13915 14386 14386 33943 33943 43449 43449 16175 16175 29984 29984 4712 4712 48795 48795 952 952 3589 3589 34274 34274 12915 12915 6840 6840 23436 23436 15670 15670 3873 3...

output:

Yes
01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...

result:

ok correct

Test #4:

score: 0
Accepted
time: 1332ms
memory: 432196kb

input:

50000
236 236 32031 707 41062 32031 37516 21446 707 41062 37516 21446 26170 44004 47187 26170 9742 44004 47187 9742 14845 835 14845 43803 4270 835 43803 4270 44275 22853 44275 45825 5286 8810 10767 49050 26809 22853 36108 45825 46063 5286 6289 5206 8810 24938 33324 48973 10767 49050 49412 19286 4152...

output:

Yes
01000100111100010111001001110010000001010100100011000001111110011100000001110011100001110110000000000101011101010101110101100111101000001100011110000011110011110010100001110001100001111000011001110110011100110011000000111000000110101010000101011111010100111011101111101000110000001100110100101100...

result:

ok correct

Test #5:

score: 0
Accepted
time: 1494ms
memory: 430384kb

input:

50000
31692 10868 8109 34968 86 31692 10868 8109 445 38569 31022 34968 86 445 38569 37143 31022 34848 37143 34848 16972 16972 49187 4897 3916 2354 45320 49187 4897 3916 2354 12356 45320 30732 12356 30732 43451 43451 32288 32288 46985 46985 12183 12183 48726 48726 32168 32168 16071 16071 33304 33304 ...

output:

Yes
00000111000111101011010000011110101101010101010101010101001010100110110101000000101101100010001111100101101100111100100100010010101111101100100010011001111001000011111101010010110001110100110100000001101000110001100011101100011011000100011111010000111110011001001001000110001011010111000001000000...

result:

ok correct

Test #6:

score: 0
Accepted
time: 1368ms
memory: 431776kb

input:

50000
47495 24797 47495 24797 15994 5403 31166 15335 15994 5403 31166 14675 15335 37320 14675 13007 37320 1837 13007 1837 39037 9932 39037 20263 9932 22331 28895 28737 30264 20263 22331 28590 38050 29802 10883 28895 27990 21537 28737 30264 39689 24549 29304 10917 45017 31830 28590 38050 29802 10883 ...

output:

Yes
00110000111010101011001010000110000100110000001111010011000010100111010110111111001010000111111001010010001010110100111001000101001110010110011101011101011000111010111101010011000110001100100011001011110101010011010101110100011011001100100110001001001010101010000111000101010001000010001100011001...

result:

ok correct

Test #7:

score: 0
Accepted
time: 1373ms
memory: 430884kb

input:

50000
18102 43117 27415 37524 18102 16822 16312 43117 7789 27415 45334 23016 37524 31793 16822 49363 16312 7789 6418 20049 21563 45334 23016 37890 9126 3903 1480 31793 986 34399 12516 49363 6418 8156 20049 29819 21563 37890 9126 3903 47923 36627 32199 1480 3828 18134 986 26441 34399 12516 43272 8156...

output:

Yes
00001001010010101100011000010001101011110001001011011001111010011110010011010010010110011100110110001001111011011011001101010100010110000110111100001111000011000011100110110111000010101101100010010011000101011100011101011100111100011100110100101100100010011101001011101100001011000110000011000100...

result:

ok correct

Test #8:

score: 0
Accepted
time: 1368ms
memory: 431356kb

input:

50000
38285 37031 26462 658 38285 37031 16051 16770 26462 4681 658 11899 16051 25086 38746 2671 16770 4681 11899 44009 47963 25086 38746 28318 2671 5587 44009 47963 30860 14523 28318 5587 30860 7840 22642 14523 7840 22642 1032 44497 1032 49925 44497 49925 21149 21149 20159 44895 20159 44895 30921 52...

output:

Yes
00001100101010001110011010110011100111001011010011000000011000100101001101110010100111010000000100100110101000001110110101010011000001100100110010010001101110011101110000100110011001000111100100000100011011010001100101110110110010011100001111110100000011110000111011001001110000000101001000001011...

result:

ok correct

Test #9:

score: 0
Accepted
time: 1432ms
memory: 429672kb

input:

50000
30092 33668 30092 3700 46771 33668 42373 48152 31960 810 4068 3700 46771 42373 48152 45408 31960 810 30681 18130 13049 4068 45408 17941 4482 49474 42117 30681 18130 13049 22624 21743 31487 17941 4482 42647 49474 42117 22624 25169 9715 21743 394 31487 42647 25169 5269 43799 9715 12047 394 5269 ...

output:

Yes
00100100000111101100011000011100011011100101110010110111010101001011001011010000110111010100010001111100100111010100100100101011110100110101010101010011000111001010000001010101110101001100100111010101110110110011010010011101000110110001101000010101111001011011010010100010000001111010001001111100...

result:

ok correct

Test #10:

score: 0
Accepted
time: 1392ms
memory: 432144kb

input:

50000
38813 25500 1580 38813 25500 1580 14884 47511 14884 12186 39074 5417 10487 43546 47511 12186 39074 5417 38290 38378 45431 13743 14877 3993 10487 4183 30835 15261 15132 42200 43546 7557 1705 42396 38290 38378 22975 38295 45431 13743 21729 13147 14877 5079 22717 32500 14147 3993 4183 30835 19779...

output:

Yes
00011100100000111100000010000010001100110010000111010110101101101100101011100111100111011101110011000001010000011000000100011101000011010010100000000010100001010110110110011110100100101101100110001111110000000000011011000110000111101111001010101111100010101011110101101001100110010000011001100110...

result:

ok correct

Test #11:

score: 0
Accepted
time: 1356ms
memory: 432444kb

input:

50000
23978 23978 2638 2638 29521 4576 29521 4576 36584 36584 21016 21016 7450 7450 40155 28489 8579 40155 3704 28489 8579 3704 2013 2013 5333 31328 9858 5333 31328 30056 23988 6920 9858 39214 30056 24719 23988 6920 39214 24719 10989 10989 29143 44716 29143 5803 44716 5803 5120 5120 41582 41582 4857...

output:

Yes
01010011010101000101110100011000101011110100101101010100110101010011001010001101001000110000000000100101100001000010100000100100010110101111111010110001110010010101110111010111001110011001100110010111011110011100100011111000010110101000101000101011111100101011101001011110000000110100001011100011...

result:

ok correct

Test #12:

score: 0
Accepted
time: 1376ms
memory: 431776kb

input:

50000
31346 31834 31346 31834 13746 13746 9736 21124 20061 36300 9736 21124 20061 44739 36300 26728 22196 44739 18472 34047 8056 29591 26728 22196 30114 25453 18472 34047 8056 39198 29591 30114 42946 25453 20436 45094 39198 36609 42946 42715 31802 36623 9880 20436 45094 27959 36609 42715 27673 35798...

output:

Yes
00110100001110100100001100111011010010100001101100011110010000111111001001001010010010110011100101111100010101110110110010001000010010010011010101010001100011110111111001100010101110001011101100111011010100001010110000010100110010011011011111100001100100000111110111101100110000101001001101010100...

result:

ok correct

Test #13:

score: 0
Accepted
time: 1365ms
memory: 431428kb

input:

50000
21602 21602 17711 17711 1336 9892 21347 1336 9892 21347 42549 42549 19829 32985 19829 32985 37952 37952 17321 17321 46808 29204 46808 12625 1774 29204 14426 12625 25228 7508 16907 29443 43763 1774 14426 25228 7508 16907 29443 10624 8495 28232 43763 35101 39874 26321 10024 39335 24954 20099 226...

output:

Yes
01010001110100110101001001010000011111100010000000011100010111110000001100111101011101000001100000100000000111111110011000001100010110110111011011010110000010010110101100001010000111110000100101010100011000001001111111110110001011000110001001100110101101001001000000000000011001011100000000001100...

result:

ok correct

Test #14:

score: 0
Accepted
time: 1467ms
memory: 431032kb

input:

50000
49075 37727 49075 37727 1785 1785 33945 18330 33945 18330 19044 18851 19044 18851 39898 39898 47520 46740 47520 46740 95 95 47564 12232 28128 47564 12232 34087 21888 15824 28128 16042 34087 21888 44039 3592 35353 16119 15824 16042 44039 7847 3592 44978 35353 7768 1508 16119 7847 44978 23734 77...

output:

Yes
00110100110011010011010001100010110000111010100111011000011001010010000001000011110011011010110100001100111010010101111111010001010111000111001011001100100110011011001100000001010110111001000001110110110000011100010111010010101101000011111000100101010100111110011000101100111110111001011010001011...

result:

ok correct

Test #15:

score: 0
Accepted
time: 1436ms
memory: 432772kb

input:

50000
18759 35198 10445 18759 33195 35198 927 10445 33195 927 2106 2106 26788 26788 35465 35465 4269 4596 43614 3774 4269 4596 43614 3774 45081 204 16968 45081 3696 26616 11647 204 45098 2125 16968 14595 3696 26616 11647 45098 10517 9389 7065 2125 30441 14595 10517 13069 41328 18899 36480 36118 1243...

output:

Yes
00010101110101010000111100010001001011110001011000000011101010101011010001110101100000011010100111000111011111000001010110111010111110100101110100110011000000011110110111001100110100100000101111001000001100001001101111111101001010101111001011000111010011010101010001001111000011100000101010011101...

result:

ok correct

Test #16:

score: 0
Accepted
time: 1328ms
memory: 431328kb

input:

50000
25145 48896 25061 25145 48896 25061 47844 47844 24843 24843 48820 48820 34491 37095 34491 25058 37095 26571 25058 46411 42396 16920 26571 46411 42396 4180 48738 13968 32764 25005 16920 20170 4180 48738 16659 13968 32764 25005 20170 16659 48870 48870 43429 43429 43286 43286 23963 23963 1537 460...

output:

Yes
00011101010100101010001110000010110111110101010100001001110110110001101101000110010011110100100101101001000110100011111100110101010010100111010101010100001000001110100001001000110001111100100000100000001001010001010101111110001101010100110111010010110010111000111001010100111010110011000110110000...

result:

ok correct

Test #17:

score: 0
Accepted
time: 1447ms
memory: 430884kb

input:

50000
40452 40452 7158 7158 671 671 2105 33633 2105 36571 33633 37070 26129 41921 36571 31194 37070 6560 26129 27965 21363 41921 31194 31861 6560 27965 21363 31861 37510 37510 7918 30320 7918 30320 8949 8949 26122 26122 19380 19380 29956 29956 24678 37988 24678 37988 155 24638 155 5689 24638 5689 25...

output:

Yes
01010100101000101010011011110100110101010100110010110001110101001010100011100110100110010001111001110101000101000000000001000000011101000001111101110000110001101110110000110011000000011011100101000010100000010011100011000101110100111011011101100110100111100100111001010011100110000110010110101110...

result:

ok correct

Test #18:

score: 0
Accepted
time: 1359ms
memory: 430172kb

input:

50000
41221 26987 1917 41221 26987 1917 21556 21556 49630 4083 49630 4083 40384 40384 9087 48389 9087 31801 5543 48389 20377 31801 5543 20377 39518 18138 39518 48446 31767 18138 48446 31767 29011 29011 27948 27948 39077 3939 11093 4611 30268 25500 27819 8217 47669 39077 3939 11093 4611 48119 41266 4...

output:

Yes
00011101001101001001011100100111010100000000011110000110111111001010011110100100010011101010001001000110110111010100111110101101010100110001101100101011000100100101011000101010110000001010011010000100100011111111010100101110100000011111011101110011110100011010101001011010100001001011010011001011...

result:

ok correct

Test #19:

score: 0
Accepted
time: 1424ms
memory: 432484kb

input:

50000
2744 2744 26477 35367 2307 16354 26477 35367 2307 16354 29861 26809 29861 26809 17333 17333 14575 6961 14575 6961 14631 36275 14631 6348 36275 39790 6348 7436 49842 38469 1907 29058 39790 7436 38281 18879 49842 38469 1907 29058 39703 6524 13380 9471 3521 43918 38281 18879 39703 20894 6524 2626...

output:

Yes
01000011110011010011001010100000110011110000001110100101111101101001110010011001001011110100011101010100100110011010011011010000110000101001100010101010101000101110000111100101100001111101110100100000111011011010010111111101000001110011100000100110011111001010110000100111010110001011010001001000...

result:

ok correct

Test #20:

score: 0
Accepted
time: 1405ms
memory: 431596kb

input:

50000
19459 19459 3055 41047 3055 41047 18463 18463 21521 21521 21820 21820 42326 48657 42326 48657 48799 30660 48799 30660 29800 23740 29800 40300 30988 21885 23740 40300 30988 39161 32819 47399 6419 21885 39161 10494 32819 47399 6419 10494 7804 19481 7804 39347 10434 19481 39347 11728 10434 16163 ...

output:

Yes
01001101010100110011001000111000011011110010011010100001111010110000101101110000100011110111010101001101010100011101010010110000111100110101000011101100110101000011101000000101101010110011101000010011011000001001111011011111100110000000110101101000010100101101000111011101000101001101000100110100...

result:

ok correct

Test #21:

score: 0
Accepted
time: 1527ms
memory: 432508kb

input:

50000
20607 47291 20607 47291 24451 1207 24451 8320 22320 1207 3819 8320 22320 3819 33165 14167 38195 33165 5378 37269 24490 45444 14167 49019 38195 20063 5378 37269 9217 24490 45444 2203 49019 20063 13016 16716 9217 15611 2799 2203 13016 16716 43922 15611 2799 30659 43922 30659 8669 8669 19582 3062...

output:

Yes
00110010010111000100001010110110110010011101101101001011010010001010000111101001101111010100011100110001011001001111010010100001101111010100110101001101010101001100101010110100001101100011001010011110110101001001101101010101010100110000101110110001011101010100010010011010001110000111011111010010...

result:

ok correct

Test #22:

score: 0
Accepted
time: 1365ms
memory: 431212kb

input:

50000
33568 39530 33568 22289 39530 22007 4556 8684 22289 2474 17464 22007 4556 8684 38915 2474 17464 4338 38915 4338 29070 29070 45861 18402 45861 4910 18402 5764 16945 34402 4910 5764 11912 16945 34402 30477 25992 10671 45761 11912 976 30477 28638 25992 10671 43856 45761 976 38000 34527 33415 2863...

output:

Yes
00101000100111011011010010100011011000010101101100010000001011111011101100001100110100101111000010101100010001100111011100101110101010010001110000000011011000110011000100110010011111111110000011011111101110110010000110101111010011000111001001000100110111011101010000010101110110100101100100000001...

result:

ok correct

Test #23:

score: 0
Accepted
time: 1422ms
memory: 431316kb

input:

50000
36900 48126 36900 4308 48126 4308 20511 38778 28918 20511 15106 38778 29228 28918 9146 15106 25045 29228 9146 25045 27858 27858 47458 49063 47458 49063 41661 41661 46866 46866 37796 37796 13337 4587 13337 4587 14017 14017 32433 25670 15905 32433 25670 28321 36850 15905 28321 36850 45952 45952 ...

output:

Yes
00101100010101010111010011010101001101000110011101010011001000101100100010110011111010100100000011001011100110000100100011100111010111011011010001001110101100011000101001000110011010001111000011101111100111100111000111100010001111110010110100100101000000000110101011111010111010101100010110110100...

result:

ok correct

Test #24:

score: 0
Accepted
time: 1495ms
memory: 432032kb

input:

50000
29874 38453 44698 30849 23291 49907 16851 41602 40126 17244 14211 1362 31761 35542 48273 25556 24391 10438 1588 41143 30011 36364 29725 21136 36539 5124 35937 16945 49982 47936 36950 11592 39434 6639 19424 10470 4458 11586 24370 28884 11935 23500 14781 23478 24205 24147 5630 37214 29047 3946 3...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok correct

Test #25:

score: 0
Accepted
time: 1474ms
memory: 431208kb

input:

50000
14339 26480 27653 41743 25038 19653 41425 25256 49765 927 8527 18846 41135 18645 7841 19684 18807 17068 42703 15914 45022 19392 13789 14039 45042 19174 35051 21117 11956 38649 41907 33151 36975 12915 846 11578 41843 2336 22696 11890 49443 49582 20042 15791 20667 42732 26403 24075 1513 18578 61...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #26:

score: 0
Accepted
time: 1514ms
memory: 430260kb

input:

50000
41962 10541 8979 33882 1672 46435 3699 12001 13745 39456 36135 41962 10541 8979 33882 1672 46435 3699 12001 13745 39456 36135 1607 26382 944 40334 37719 17455 3269 22948 24149 28989 9015 34497 42022 15668 31671 41655 41008 30724 644 22420 3699 15244 20593 11294 48248 4159 27941 37331 48732 289...

output:

Yes
00000000000111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #27:

score: 0
Accepted
time: 1482ms
memory: 429440kb

input:

50000
35817 13475 9693 1121 43535 27561 6265 1917 32910 11854 9278 26018 3125 22948 34843 44579 34948 37403 23162 8622 34950 12817 41401 17049 18633 2742 45946 39079 28703 6767 45531 32583 41198 22786 37242 21215 4295 12809 29116 45290 14845 35587 44404 29672 44329 28597 2938 18126 2323 9173 24932 1...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #28:

score: 0
Accepted
time: 1490ms
memory: 432416kb

input:

50000
8430 5179 24473 19902 18136 24312 10379 8922 43152 49782 20490 773 46144 9833 9102 48467 12731 11781 42558 40852 41680 4461 10474 25975 39732 22208 26505 46716 2815 24484 5614 17437 17623 43343 11303 44896 4252 8037 27798 44193 36389 30605 21009 4789 4214 45706 8051 43892 36609 34834 24581 356...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #29:

score: 0
Accepted
time: 1476ms
memory: 431904kb

input:

50000
13579 28406 30122 4526 45623 30212 9773 6929 16773 2717 13965 22745 11872 32136 6124 22116 8236 13579 43272 46683 13710 8691 21874 12030 30835 30023 53 36688 29312 9163 39353 14171 39155 40027 30076 104 10809 3395 32468 28481 42600 32870 42324 44679 15870 25146 22076 21578 4943 6368 20494 4078...

output:

Yes
00000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #30:

score: 0
Accepted
time: 1501ms
memory: 432420kb

input:

50000
28887 22721 17341 8774 7665 27021 18883 29481 732 22853 22839 2962 29941 48117 36465 40379 13819 23495 28457 4790 24007 40820 16681 5079 29670 7396 13748 36616 42254 8414 28777 353 12460 15313 39579 37786 94 30820 24619 37781 1074 673 24267 31374 3650 45852 35856 2780 49727 22442 41444 28887 2...

output:

Yes
00000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #31:

score: 0
Accepted
time: 1471ms
memory: 431524kb

input:

50000
6595 37805 25444 46547 17442 26572 13264 32922 13749 25491 6595 37805 25444 46547 17442 26572 13264 32922 13749 25491 22798 39769 1128 32041 31999 19387 25066 38729 49065 31929 48425 13061 45661 2717 10710 43261 45851 42111 8294 49492 23801 39483 46926 14221 17698 2229 28319 13593 32339 23499 ...

output:

Yes
00000000001111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #32:

score: 0
Accepted
time: 1429ms
memory: 431764kb

input:

50000
34663 719 8504 14945 37024 17713 12022 32914 37005 37505 48382 3843 8890 97 15411 8721 21590 3805 4917 37895 43794 34531 21647 41829 16650 36079 18782 27225 35653 8656 40284 2130 23407 43514 15116 46228 16127 31798 27758 6727 40547 4765 47365 32925 40685 959 15487 41087 21320 44854 25791 46677...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #33:

score: 0
Accepted
time: 1449ms
memory: 431376kb

input:

50000
43101 35248 45776 42862 2151 23015 34352 49019 13664 35354 8644 33945 9352 12697 31610 24017 18309 49810 41791 45956 18010 48884 9281 41027 33986 18995 1021 16549 17173 10850 44457 6451 38083 4179 33360 14523 10214 6392 35149 43317 27751 43450 39894 27675 19165 2894 49264 43638 2872 44842 1693...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #34:

score: 0
Accepted
time: 1457ms
memory: 431432kb

input:

50000
25848 48862 25889 3594 17575 23691 41038 47669 40504 41201 2028 32561 11986 45073 30768 4890 35213 22819 4378 45375 374 9190 25848 48862 25889 3594 17575 23691 41038 47669 40504 41201 2028 32561 11986 45073 30768 4890 35213 22819 4378 45375 374 9190 38505 17639 11015 44564 47722 38248 12784 20...

output:

Yes
00000000000000000000001111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #35:

score: 0
Accepted
time: 1513ms
memory: 432144kb

input:

50000
35510 9259 27046 28556 39291 15421 10521 29828 6987 23549 8952 43709 33157 17531 36523 9773 25718 44185 29648 46206 9034 23282 37710 42564 47022 21975 44562 11083 32626 46934 35510 9259 27046 28556 39291 15421 10521 29828 6987 23549 8952 43709 33157 17531 36523 9773 25718 44185 29648 46206 903...

output:

Yes
00000000000000000000000000000011111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #36:

score: 0
Accepted
time: 1508ms
memory: 430940kb

input:

50000
8076 27656 19578 27536 34983 17412 30592 3753 23881 30220 14122 19769 3553 20656 37996 21163 12423 28857 24235 47864 42423 23105 41316 16029 38412 2275 5942 15727 28304 34214 40 15469 6323 6882 30224 43939 20746 20252 44407 37749 4109 2235 11568 13172 30767 36468 6628 19964 38983 19529 41127 4...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #37:

score: 0
Accepted
time: 1389ms
memory: 431680kb

input:

50000
37862 22658 24776 7046 37862 22658 24776 7046 39083 14689 34964 3116 7445 40883 18433 37347 27331 23988 42796 39083 14689 34964 3116 7445 40883 18433 37347 27331 23988 42796 32826 30547 23993 25635 28272 47585 38001 36856 48446 3706 33581 17531 37268 42253 32607 39372 39705 26260 7198 1431 279...

output:

Yes
00001111000000000001111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #38:

score: 0
Accepted
time: 1488ms
memory: 431632kb

input:

50000
27722 17334 16381 42100 10665 3624 41509 7035 12155 40437 47960 19257 38675 40511 32600 19120 44494 23761 28323 3310 19371 12534 13775 6869 25731 5217 16297 24145 8044 18710 23521 34147 2219 18156 31794 39710 21994 5182 6299 21219 36726 48833 25310 23316 41887 36582 10064 1398 28261 23161 4014...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok correct

Test #39:

score: 0
Accepted
time: 1555ms
memory: 431496kb

input:

50000
2628 32958 29792 29493 2825 32731 24280 43681 13316 29207 14059 42361 12842 34379 11545 41905 20633 16123 47934 8586 12737 25863 22149 22026 4085 22764 18861 30251 3824 49761 46428 39787 39427 19963 16196 10188 16607 16505 13623 14334 25887 32739 31528 36988 44377 24962 35829 5743 38595 25078 ...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #40:

score: 0
Accepted
time: 1556ms
memory: 432440kb

input:

50000
9463 3805 3371 13476 38073 15750 37601 8636 34448 1708 10483 16343 3401 2183 20941 46040 20807 15572 18172 3555 5284 14332 1911 8648 48381 35059 49784 40540 36793 32890 41083 29474 34023 23774 16018 3261 34806 739 38416 29823 13770 41796 47463 35414 3859 20835 35293 8529 34880 38519 18178 2964...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #41:

score: 0
Accepted
time: 1500ms
memory: 430732kb

input:

50000
5255 5255 35254 43851 35053 30419 6611 26385 38517 22831 28039 22075 40221 36860 18777 11369 7137 28045 43639 8940 5094 9700 15463 12979 13433 889 16539 41587 17592 15949 40154 34248 13740 15840 13908 46754 40921 45810 27995 48879 31097 30891 48719 36815 45206 26102 18521 6210 42745 16387 3794...

output:

Yes
01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #42:

score: 0
Accepted
time: 1509ms
memory: 429896kb

input:

50000
9708 16276 10750 33466 18587 1706 19021 26068 46895 22899 9851 7126 12291 9741 39295 9865 39089 22820 22391 17073 22295 2536 46516 33391 18004 41933 25372 8834 32128 38362 17021 41304 3584 26471 19866 46880 40218 7501 8335 6677 34872 18371 40290 14199 10926 16521 21541 6343 19916 27639 17136 3...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #43:

score: 0
Accepted
time: 1458ms
memory: 431176kb

input:

50000
29625 41950 22782 24495 1489 14762 39632 22334 25999 25762 27266 19203 21507 13534 38918 11591 41119 45120 7824 30096 179 17810 6494 17397 18929 4738 16985 21626 9995 21940 27354 38664 46373 22505 14386 35257 27823 2818 4616 32728 36123 32783 22375 13355 49934 7739 35049 34841 24943 8513 1941 ...

output:

Yes
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok correct

Test #44:

score: 0
Accepted
time: 1911ms
memory: 495656kb

input:

50000
44356 37506 32009 40096 20761 24394 27510 39523 35087 14259 16152 48578 18064 30317 48816 8391 12880 25609 30445 18720 31390 10751 4373 17399 18218 36578 19525 26632 36786 20253 24918 8819 28364 19389 32075 35943 7734 49342 39066 47469 13835 40201 26746 43858 46924 45508 26476 5736 48300 29552...

output:

No

result:

ok correct

Test #45:

score: 0
Accepted
time: 1855ms
memory: 493772kb

input:

50000
25125 27367 45933 48430 25863 22525 5013 14715 11102 1951 11107 44614 24309 36891 26566 37722 10771 30368 8767 11381 39194 34596 33268 2431 9507 1923 43785 49445 33710 36205 28248 14004 29314 21573 39369 25309 15616 16307 19310 39491 17522 21076 34778 20935 28757 41805 37606 4454 46108 44392 2...

output:

No

result:

ok correct

Test #46:

score: 0
Accepted
time: 1758ms
memory: 495796kb

input:

50000
19854 37666 21326 26699 39093 16177 24189 14392 15451 4973 20113 29484 22128 24155 8534 5142 13496 34639 8504 15302 20370 48172 22628 22658 33780 38807 22326 37717 4619 9962 6836 36945 42843 43062 22315 46413 12372 46360 20662 673 19783 44191 9518 45508 22573 7297 46300 42520 13495 31978 27761...

output:

No

result:

ok correct

Test #47:

score: 0
Accepted
time: 1837ms
memory: 493968kb

input:

50000
24885 21279 28861 44926 1251 16961 40812 3007 45631 2377 24883 7810 31700 19460 42317 11249 38746 13849 35082 49155 43190 16113 23450 48236 29718 19449 35574 2508 39554 25459 28632 35622 45118 26546 12555 2734 22708 41120 3661 17180 2803 44605 44005 47554 999 15470 34062 16554 25648 2479 19643...

output:

No

result:

ok correct

Test #48:

score: 0
Accepted
time: 1734ms
memory: 495084kb

input:

50000
39032 47428 33943 22443 30408 44222 37531 26599 3839 17745 33273 21257 38555 36060 40540 45306 28327 39210 14714 14694 16209 26496 33679 30555 27748 74 36183 13042 10370 5495 22470 1068 25042 5116 42136 14636 31073 4608 49920 4375 36659 38563 39756 14331 8400 1344 8072 38285 43232 42913 49715 ...

output:

No

result:

ok correct

Test #49:

score: 0
Accepted
time: 1845ms
memory: 495032kb

input:

50000
42513 3776 33084 365 5150 39034 3452 44050 46282 14503 49320 48321 10165 12440 25249 40600 9724 29416 40581 14482 42894 8450 23090 9475 26354 44715 35541 10077 3535 16513 26627 20 14184 5700 43453 18837 20042 45779 16804 23402 26315 6709 10489 40289 2323 39615 3282 8598 11055 39952 41123 36376...

output:

No

result:

ok correct

Test #50:

score: 0
Accepted
time: 1848ms
memory: 495172kb

input:

50000
40530 132 42750 45940 23956 37079 14970 21157 48030 23589 26470 46636 36281 1037 1854 34031 3709 27348 43666 36718 25522 23061 40039 27267 37033 20004 17352 15026 6440 9053 1699 28896 36097 29348 7490 39845 39410 47475 29140 28615 44285 13500 19611 28814 20394 44584 21368 22502 20881 2486 2165...

output:

No

result:

ok correct