QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#427693#8771. Dihedral Groupucup-team3555#AC ✓2ms4044kbC++14743b2024-06-01 15:00:322024-06-01 15:00:32

Judging History

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

  • [2024-06-01 15:00:32]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:4044kb
  • [2024-06-01 15:00:32]
  • 提交

answer

# include <bits/stdc++.h>

const int N=100010,INF=0x3f3f3f3f;

inline int read(void){
	int res,f=1;
	char c;
	while((c=getchar())<'0'||c>'9')
		if(c=='-') f=-1;
	res=c-48;
	while((c=getchar())>='0'&&c<='9')
		res=res*10+c-48;
	return res*f;
}

int n,m;

int a[N],b[N];

inline bool chk(void){
	for(int i=1;i<=n;++i){
		if(a[i]==b[1]){
			for(int p=i,q=1;q<=m;++q){
				if(a[p]!=b[q]) return false;
				if(p==n) p=1;
				else ++p;
			}
			break;
		}
	}
	return true;
}

int main(void){
	n=read(),m=read();
	
	for(int i=1;i<=n;++i) a[i]=read();
	for(int i=1;i<=m;++i) b[i]=read();
	
	if(chk()) puts("1");
	else{
		std::reverse(a+1,a+1+n);
		if(chk()) puts("1");
		else puts("0");
	}


	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

input:

3 3
1 2 3
1 3 2

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

3 1
1 2 3
1

output:

1

result:

ok single line: '1'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

4 2
1 2 3 4
1 3

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3484kb

input:

4 4
1 2 3 4
2 3 4 1

output:

1

result:

ok single line: '1'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

4 4
1 2 3 4
3 2 1 4

output:

1

result:

ok single line: '1'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

5 3
1 3 5 4 2
2 1 3

output:

1

result:

ok single line: '1'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

5 4
1 3 5 4 2
2 1 5 3

output:

0

result:

ok single line: '0'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

1 1
1
1

output:

1

result:

ok single line: '1'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3912kb

input:

50000 50000
22577 42400 21546 3302 14673 38530 22117 34658 9767 8284 18979 21312 30964 13861 9502 17302 9772 23092 18502 26861 33431 46434 42862 33662 16736 26383 42119 18487 6112 34272 40503 9340 36859 22828 35809 1442 37730 28378 12422 12305 26736 32865 691 29405 7395 24658 20995 40821 23979 15723...

output:

1

result:

ok single line: '1'

Test #10:

score: 0
Accepted
time: 0ms
memory: 4044kb

input:

50000 50000
35130 7093 5888 13405 6205 14721 28267 16125 2951 48393 3592 9734 38272 14933 44581 48795 19209 48236 43907 12756 16959 41111 5430 21055 49060 925 37384 32101 5585 34643 36209 2236 22459 22364 17276 18146 25061 49067 46552 12258 8427 26462 13673 17506 30884 48643 22278 2383 12787 8607 47...

output:

1

result:

ok single line: '1'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3908kb

input:

50000 50000
11452 47769 1305 22064 3040 20136 23013 10726 33785 5837 30028 4914 47911 16748 106 3373 6501 24664 16564 33298 15686 10750 27147 30460 8673 47664 26479 5700 16691 12422 23705 24809 15591 38417 12384 5546 12014 15751 47462 7043 43259 3836 9164 33496 40840 2812 11129 22541 41309 28222 219...

output:

1

result:

ok single line: '1'

Test #12:

score: 0
Accepted
time: 2ms
memory: 3872kb

input:

50000 50000
39318 18761 41072 14961 39514 45083 42960 5383 37971 8807 34879 49057 5538 196 5401 11979 33008 2101 31411 15125 6988 14984 37653 4858 1696 33907 31532 4521 18931 36899 15799 33452 41430 6909 20829 37430 16960 16578 24459 45203 38747 35859 22493 8368 4451 22357 22771 8344 38053 1210 3999...

output:

1

result:

ok single line: '1'

Test #13:

score: 0
Accepted
time: 2ms
memory: 3976kb

input:

50000 50000
22354 8925 44766 46620 29461 29861 34125 28812 17123 27288 1807 5544 46652 40596 11730 32137 968 40681 2627 29169 5317 18657 10736 41992 9803 14611 22509 39597 12160 3499 6939 18501 11722 1234 16191 48253 45266 32765 9561 19467 40703 6444 2230 25667 13825 2409 11519 37424 32531 19582 240...

output:

1

result:

ok single line: '1'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3992kb

input:

50000 50000
19141 15348 4931 30402 22085 854 42879 14859 24742 36869 45006 12955 13372 1557 16223 38574 31130 44141 37756 9938 15969 29363 4840 26784 24986 31279 32778 19907 40494 30060 21943 46922 25712 17589 41974 30109 31553 41838 18325 30978 9996 30186 27911 42513 49822 16654 22943 15892 41868 4...

output:

1

result:

ok single line: '1'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

50000 5511
32911 17093 8964 9015 11417 2632 4777 4287 9855 4226 25271 28347 24594 38939 28090 33526 23926 17367 625 47785 3245 33072 17330 21373 10673 26556 42245 1344 41985 18351 13400 29099 5338 23659 48106 30697 26206 44699 45360 17390 27504 40276 39113 33120 8488 3633 21944 20214 20733 19706 448...

output:

1

result:

ok single line: '1'

Test #16:

score: 0
Accepted
time: 1ms
memory: 3720kb

input:

50000 1134
40669 46022 3800 5297 15971 8925 18158 29661 48341 49404 30426 28243 40875 11894 39095 17599 25737 47557 12042 33687 4109 32568 1717 7734 18432 7885 19047 12336 41134 35261 30456 2105 8227 1028 14021 8302 47219 11098 38221 11766 13003 847 3151 238 41193 26595 13792 39300 11714 13371 3441 ...

output:

1

result:

ok single line: '1'

Test #17:

score: 0
Accepted
time: 1ms
memory: 3796kb

input:

50000 3106
24516 1094 32286 2535 48443 9593 39341 45413 26914 28780 34181 6314 31982 11286 2510 27308 9006 8444 23519 18569 35927 20556 3739 11806 35026 28508 47850 27179 6477 10106 37123 36189 21099 4091 14002 31142 43891 26930 38569 35128 24491 23148 20341 33743 28682 2665 7122 9565 13299 47105 10...

output:

1

result:

ok single line: '1'

Test #18:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

50000 8839
16473 9050 37282 41733 1968 6344 22474 16298 26629 7778 22177 7608 22448 10660 39147 16316 9407 10283 11211 31515 24713 2857 39017 22806 7374 23821 45284 49160 45524 47974 1273 386 39000 45549 17457 11243 13286 6985 34745 13233 11984 27679 31010 36458 15090 47335 45956 25779 44033 26282 6...

output:

1

result:

ok single line: '1'

Test #19:

score: 0
Accepted
time: 1ms
memory: 3908kb

input:

50000 15971
16637 47066 9922 9329 639 22778 22620 89 42064 1802 8904 39372 9087 6111 2439 18573 34132 4174 17776 13924 18570 24474 7715 24787 17903 2160 39853 31013 97 22456 40836 46263 12292 39993 19114 24695 13226 4286 42014 1018 1833 13083 14034 39561 31320 2780 9774 40981 29287 38003 17186 14213...

output:

1

result:

ok single line: '1'

Test #20:

score: 0
Accepted
time: 1ms
memory: 3852kb

input:

50000 17200
32881 24975 16816 46023 22971 25206 814 2582 7863 25896 19044 11326 36555 28254 5666 14575 44395 21725 21612 25382 28801 29374 25187 16778 28020 2105 41427 48516 19451 11268 9947 24328 729 30387 21438 45966 24171 36585 44399 22666 37544 22473 13897 24894 6378 12471 16395 19943 3098 17675...

output:

1

result:

ok single line: '1'

Test #21:

score: 0
Accepted
time: 1ms
memory: 3604kb

input:

32413 5640
17405 5322 15138 11166 24040 17782 15027 17196 30009 22056 29893 26912 21587 4611 2140 25757 7725 14574 14998 4957 14557 3092 20662 2024 30111 17317 5791 20695 13429 22256 16691 13800 13761 22717 7963 11109 15475 13749 13839 9199 13364 19260 13642 19374 12279 19934 12895 21892 19673 23592...

output:

1

result:

ok single line: '1'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

2010 122
1704 1806 1288 215 909 1931 30 825 261 891 1626 254 1939 420 763 473 1085 1275 996 559 1813 952 1674 812 616 1191 710 1583 781 1975 434 643 796 188 122 586 669 186 714 190 1380 976 123 182 230 1492 603 810 64 356 848 1203 757 1876 619 1108 263 824 451 893 207 945 380 828 120 1875 67 622 187...

output:

1

result:

ok single line: '1'

Test #23:

score: 0
Accepted
time: 1ms
memory: 3740kb

input:

12042 7165
1231 7418 6913 942 11931 2277 4510 4340 4253 8792 3157 1816 8033 11412 10516 4797 9057 2059 11461 2051 2952 6382 7498 2887 405 4130 9486 1578 1973 5187 5538 2276 3442 11966 5423 5793 3663 2380 4706 2498 2127 1029 8231 2037 724 10398 2500 4427 11565 3644 7911 6040 817 3779 3033 5962 1285 5...

output:

1

result:

ok single line: '1'

Test #24:

score: 0
Accepted
time: 1ms
memory: 3656kb

input:

18022 784
810 3153 14882 6588 3434 8507 7556 16508 7872 16154 6208 352 254 1908 4508 12307 9802 6491 6277 7622 15936 5561 13374 4784 16846 5595 12735 960 5881 5372 15990 4325 17382 13136 16685 349 13236 6854 8067 8314 291 1303 14367 7624 12504 14450 6783 16286 4086 14536 7767 7760 16765 12069 10689 ...

output:

1

result:

ok single line: '1'

Test #25:

score: 0
Accepted
time: 1ms
memory: 3728kb

input:

29079 3641
25121 6257 5570 9745 4795 3839 28550 3726 1314 18788 1495 19631 10974 5254 18290 24629 11308 20109 3981 290 4227 9621 1147 13318 10534 3903 7683 18440 10008 28032 26550 9307 11886 21890 597 16775 3052 24521 12513 17075 23032 16543 15439 5839 7354 4393 19369 18291 16670 10963 5772 16299 83...

output:

1

result:

ok single line: '1'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

47046 19473
5288 43009 38030 9288 25558 18929 15823 3487 26802 37842 19566 40364 4861 12716 11279 22221 25662 33014 2883 17053 19146 12046 23486 25794 21568 30914 46645 31269 29691 1883 34650 7620 8928 27705 30454 7619 8967 21342 20667 12945 16705 1572 38622 3219 20317 2784 31023 13119 3131 22548 42...

output:

1

result:

ok single line: '1'

Test #27:

score: 0
Accepted
time: 1ms
memory: 3696kb

input:

45432 8040
13643 33487 30089 13649 20456 43743 39865 37776 35373 40879 5929 33077 34157 11145 7662 13486 2052 13441 30684 12089 39691 32828 9300 13141 11047 14209 38134 5994 472 43738 4348 13455 25713 5379 19424 22604 6594 2289 31080 31708 11580 26384 12210 4454 41724 37655 12362 18999 12617 43433 1...

output:

1

result:

ok single line: '1'

Test #28:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

12368 898
1216 9457 3107 4624 10550 7489 11008 6398 4774 4349 6917 3973 9029 6310 5827 6195 1782 10361 5274 4506 6061 2056 6775 14 5992 1132 3978 4115 9332 2085 1108 10350 4940 759 2765 7345 3647 2314 9886 1141 371 4918 2058 8640 8459 1117 12320 2420 5645 11084 9494 2009 7611 7367 4426 9101 1251 133...

output:

1

result:

ok single line: '1'

Test #29:

score: 0
Accepted
time: 1ms
memory: 3632kb

input:

13153 66
2725 10388 11765 1191 10618 6944 848 2944 11697 10550 11228 4979 9570 1041 12202 1079 2049 6024 3189 7733 10045 11385 1594 4862 3303 1794 4103 5119 1599 1433 5313 1083 1090 3240 8884 488 6039 11631 11886 6681 9722 11266 36 5435 518 8819 557 4823 2596 9412 4456 2814 5052 1971 3105 8002 7969 ...

output:

1

result:

ok single line: '1'

Test #30:

score: 0
Accepted
time: 1ms
memory: 3912kb

input:

49572 11920
20011 15751 13938 35741 4154 31701 11126 10006 14929 2165 29171 36995 23209 1182 10928 8223 34912 22530 18565 21578 38971 9755 32936 8764 31183 6989 41528 8243 5560 5029 30360 4643 30466 36 15322 6488 14937 25331 37646 28612 39121 35196 24137 38728 21316 27778 43425 42021 24526 11469 222...

output:

1

result:

ok single line: '1'

Test #31:

score: 0
Accepted
time: 2ms
memory: 3968kb

input:

50000 50000
17948 7796 3481 22612 20310 28444 27248 2588 702 24594 5352 40765 48654 7665 1875 19013 32276 3453 21956 227 18042 28480 7781 10462 9815 12635 4429 39305 8486 27189 23453 49293 11081 8506 33462 25300 8691 41801 41786 26931 25458 11851 8744 8571 2605 33440 924 2364 4975 20723 16790 6071 4...

output:

0

result:

ok single line: '0'

Test #32:

score: 0
Accepted
time: 2ms
memory: 3872kb

input:

50000 50000
1360 13810 24973 919 8645 13314 33669 18030 11593 23886 1391 30497 36171 11996 28953 5465 11360 18620 27019 37189 25763 26342 28924 34348 20519 31205 4402 5 48896 26522 37800 29212 24486 1141 4967 45512 21859 19299 38426 18098 31617 14817 5133 12063 42696 2194 30411 19825 45488 1848 4447...

output:

0

result:

ok single line: '0'

Test #33:

score: 0
Accepted
time: 2ms
memory: 3988kb

input:

50000 50000
9405 21367 27793 32271 37186 4389 6491 32370 22044 9294 5937 16485 35968 24327 24280 25159 475 24517 49668 32334 22730 22503 16444 15654 31876 25933 44274 7481 14526 25899 8969 10414 45232 23977 15595 8541 6017 27597 36166 32246 4189 12903 7250 49948 21928 24818 33322 8612 23233 14477 72...

output:

0

result:

ok single line: '0'

Test #34:

score: 0
Accepted
time: 2ms
memory: 3972kb

input:

50000 50000
34500 21923 3211 19737 6509 10049 47279 2353 12569 1374 28490 41103 8244 13536 29094 46065 22657 33922 46608 40829 6081 37248 20014 18926 14662 5895 17042 45516 43058 30157 17415 6951 44342 13814 4041 43449 5105 43810 1196 17124 46877 26097 35439 21462 18672 18224 28708 9712 17765 32013 ...

output:

0

result:

ok single line: '0'

Test #35:

score: 0
Accepted
time: 1ms
memory: 3932kb

input:

50000 18233
7978 16393 10387 4090 680 8242 32978 25244 28449 8803 46484 41366 6357 20088 33442 48860 25383 34624 889 3739 27177 18645 17617 11099 44696 35250 11316 18171 39078 16331 38626 1372 12716 11835 11900 38313 2546 44472 8876 21503 16499 19805 6300 2870 23541 3213 5070 939 36603 18609 21989 6...

output:

0

result:

ok single line: '0'

Test #36:

score: 0
Accepted
time: 1ms
memory: 3828kb

input:

50000 12139
2559 16147 40961 33245 1877 19112 42303 5017 14449 4402 1945 29957 20203 36041 2495 18623 31836 1237 1520 25871 39117 7573 17104 48171 26872 25292 1609 46381 12804 45381 47844 29317 6690 16521 5086 11342 10829 10542 13826 30024 8853 18716 2003 43557 15543 7119 1983 21460 43889 10018 4244...

output:

1

result:

ok single line: '1'

Test #37:

score: 0
Accepted
time: 1ms
memory: 3832kb

input:

50000 8437
28451 35240 4840 25581 6366 38750 37334 1477 11731 29326 24030 36764 13543 17767 16066 20355 25361 15783 41429 12407 19236 10972 23371 3507 26367 41227 12659 2385 3057 3394 23414 41196 13146 37007 11379 11540 6718 5753 10485 9568 876 40535 44301 20154 12612 5775 37031 18605 27286 29904 38...

output:

1

result:

ok single line: '1'

Test #38:

score: 0
Accepted
time: 1ms
memory: 3864kb

input:

50000 1696
47826 6230 4669 36537 23739 9105 38281 43988 40561 43744 14944 42483 1570 10974 26400 11931 675 32801 16725 47845 14695 9579 43087 13461 41697 42746 22227 46745 8834 24691 6529 21015 2338 6702 15417 2358 12997 11526 14036 26531 44478 14613 28538 13429 17630 42018 28127 7123 1587 7000 2830...

output:

1

result:

ok single line: '1'

Test #39:

score: 0
Accepted
time: 1ms
memory: 3900kb

input:

50000 11177
41347 3134 4457 6395 9820 28914 36962 3113 41657 28726 21397 7315 841 5310 4697 40562 16084 44626 22093 41727 11975 18297 3453 42103 27872 35615 29289 42446 35062 21392 16476 35281 48687 41491 21767 39002 25563 5566 18984 31028 18724 25524 10064 19530 33446 4976 1163 44735 2749 42021 195...

output:

0

result:

ok single line: '0'

Test #40:

score: 0
Accepted
time: 1ms
memory: 3672kb

input:

15777 3275
12054 7054 7719 8564 8904 8189 2157 1079 10592 3593 13381 13692 5733 3906 5716 2880 2746 4540 2847 12117 8129 7699 375 540 7264 8098 1661 574 5323 64 2892 9263 13271 111 2496 2605 11633 370 855 678 13571 10224 3385 4494 3706 9809 1846 7023 11043 2461 11436 11164 5617 8404 9349 1027 10929 ...

output:

1

result:

ok single line: '1'

Test #41:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

38954 14021
33491 5497 23483 24381 18848 6270 2908 4154 9999 12259 30815 26698 19945 36870 20085 472 3990 27345 8222 31311 14530 4215 4436 2779 30342 2973 10887 16780 18109 10346 24048 287 17574 1751 27416 37551 4962 26262 11364 1349 13491 18508 16086 27385 25462 8106 10375 24360 5030 15139 10546 25...

output:

1

result:

ok single line: '1'

Test #42:

score: 0
Accepted
time: 1ms
memory: 3792kb

input:

46163 8290
27403 8399 316 1854 4949 21643 34056 10221 17721 37061 34966 44246 1760 14202 23822 2223 21257 5373 1902 45670 42018 33131 6137 37918 6256 33179 16944 25150 33262 25642 30108 11617 9116 28397 24247 81 24886 25052 30075 27390 23634 31595 4836 26159 14425 22086 14937 32921 9595 36475 42325 ...

output:

1

result:

ok single line: '1'

Test #43:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

45427 4436
33917 37307 4726 39840 3812 43783 27085 12840 2160 43540 32762 40745 10845 1400 14852 25764 9217 36129 5595 30712 2298 15460 40631 10884 1235 15519 14471 43254 34076 9928 1926 6477 16601 2704 7597 32491 34161 14339 22112 9445 32394 371 30020 34752 39893 15598 18563 21220 30707 16951 7222 ...

output:

1

result:

ok single line: '1'

Test #44:

score: 0
Accepted
time: 0ms
memory: 3692kb

input:

6471 344
4264 49 6233 1781 3401 5196 4595 5106 5853 145 1975 413 3714 5457 1864 2079 5054 5551 3231 1592 113 101 642 5576 1871 4751 834 2013 5763 498 4470 474 1895 5293 3955 6332 4537 4729 5171 6264 1246 5922 138 5025 3679 1830 4429 1479 1146 1215 5254 5421 3709 2956 3882 946 1117 5716 4321 282 4423...

output:

1

result:

ok single line: '1'

Test #45:

score: 0
Accepted
time: 1ms
memory: 3768kb

input:

30498 13262
1588 29908 2153 26646 17272 4566 29825 1675 6476 8801 3165 4527 14017 7417 2970 23594 2017 27714 16081 29470 25124 21773 13187 4156 3441 19121 3758 6706 27307 27779 30305 13595 22460 14205 11986 18552 20588 19810 7560 20816 13243 23995 17660 14516 16612 11113 23503 18123 4317 604 7201 22...

output:

0

result:

ok single line: '0'

Test #46:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

44588 6150
32081 25521 5063 8048 34675 15222 11965 24503 21405 7111 15530 9569 6353 37469 20530 17471 37772 307 8234 16276 18223 30477 36353 26171 702 25428 15099 29112 25492 31376 34780 34440 39488 38412 10030 31501 31359 17982 18884 26801 8731 26185 30968 36602 5820 30979 28471 21724 18730 14372 8...

output:

1

result:

ok single line: '1'

Test #47:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

41658 182
2097 7723 324 4819 2791 1257 13693 21725 41434 5285 38416 41390 8197 30674 7712 12699 3843 25243 33318 4358 16868 2274 38181 6324 7301 16221 18326 16858 16711 22349 4585 6439 30087 3764 27184 7485 9605 19236 23159 41471 36190 33868 15957 37542 3258 22245 18274 29076 21262 26709 19847 24654...

output:

1

result:

ok single line: '1'

Test #48:

score: 0
Accepted
time: 1ms
memory: 3836kb

input:

38336 4347
37345 17181 31220 13390 5120 35041 1740 6035 133 1614 10015 1213 34223 20181 3156 5610 34973 6225 14390 21563 32152 37129 14378 11701 496 23515 16256 11690 5621 32138 12463 27998 2960 13053 6862 679 16302 124 15803 22702 30064 2896 34796 12771 21164 7235 24992 6366 7491 6884 3909 516 6904...

output:

1

result:

ok single line: '1'

Test #49:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

27461 7788
13820 27039 24535 9424 11309 11773 7229 286 3119 24122 25679 6075 3889 14754 12664 13657 5334 2888 56 2392 10124 943 11033 468 18675 22360 8958 17338 6997 12158 26052 3847 27218 20678 21671 9078 25119 1327 6573 5376 26768 1453 6382 6719 18315 13566 14267 16164 25510 12937 5924 2377 11055 ...

output:

1

result:

ok single line: '1'

Test #50:

score: 0
Accepted
time: 0ms
memory: 3972kb

input:

50000 50000
26859 17788 25285 28272 7271 49471 41968 24622 29238 41772 49144 27964 45242 15216 46089 24127 31965 42486 13068 34625 10539 29302 39923 15890 11542 20697 5522 46598 8986 9512 47830 18320 31498 20597 2545 9021 17633 19928 2419 37882 48700 40146 32512 48262 2128 44090 4578 40444 3235 2289...

output:

0

result:

ok single line: '0'

Test #51:

score: 0
Accepted
time: 2ms
memory: 4044kb

input:

50000 50000
23479 30506 21719 6001 12277 25495 4789 6359 4660 12122 35987 30358 17347 22343 47346 15968 49526 7551 20533 33195 11426 43904 27846 23738 25579 28418 25754 38848 4380 37145 22201 12270 1317 24152 42004 12043 3951 48543 41601 33170 1463 760 23350 36163 33395 49853 46042 19165 31198 44935...

output:

0

result:

ok single line: '0'

Test #52:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

11 2
1 2 3 4 5 6 7 8 9 10 11
9 1

output:

0

result:

ok single line: '0'

Test #53:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

11 2
1 2 3 4 5 6 7 8 11 9 10
1 9

output:

0

result:

ok single line: '0'

Test #54:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

11 2
1 2 3 4 5 6 7 8 11 9 10
1 8

output:

0

result:

ok single line: '0'

Test #55:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

23 2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
1 3

output:

0

result:

ok single line: '0'