QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#785371 | #9641. Two permutations | zhouhuanyi | 100 ✓ | 240ms | 12708kb | C++17 | 1.2kb | 2024-11-26 17:40:45 | 2024-11-26 17:40:48 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<vector>
#define N 400000
using namespace std;
int read()
{
char c=0;
int sum=0;
while (c<'0'||c>'9') c=getchar();
while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
return sum;
}
int T,n,v[N+1],length,depth[N+1],nt[N+1],pv[N+1],nt2[N+1],pv2[N+1];
void adder(int x,int d)
{
int y=nt[x];
nt[x]=d,pv[d]=x,nt[d]=y,pv[y]=d;
return;
}
void adder2(int x,int d)
{
int y=nt2[x];
nt2[x]=d,pv2[d]=x,nt2[d]=y,pv2[y]=d;
return;
}
int main()
{
bool op;
int x;
T=read();
while (T--)
{
n=read(),length=0,op=1;
for (int i=1;i<=n;++i) v[i]=read(),op&=(v[i]<=i);
if (!op) puts("No");
else
{
for (int i=2;i<=n;++i)
{
if (v[i]<i) depth[i]=depth[v[i]]+1;
else depth[i]=0;
}
nt[0]=nt2[0]=n+1,pv[n+1]=pv2[n+1]=0;
for (int i=1;i<=n;++i)
{
if (!depth[i]) adder(pv[n+1],i),adder2(0,i);
else if (depth[i]&1) adder(pv[n+1],i),adder2(v[i],i);
else adder(pv[v[i]],i),adder2(0,i);
}
puts("Yes");
x=n+1;
for (int i=1;i<=n;++i) x=pv[x],printf("%d ",x);
x=0;
for (int i=1;i<=n;++i) x=nt2[x],printf("%d ",x);
puts("");
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 1ms
memory: 7912kb
input:
10 1 1 2 1 1 3 1 2 2 4 1 1 3 2 5 1 2 1 2 1 2 1 1 1 1 3 1 2 2 1 1 5 1 1 1 3 2
output:
Yes 1 1 Yes 2 1 1 2 Yes 3 2 1 2 3 1 Yes 3 2 4 1 4 3 1 2 Yes 5 4 3 2 1 2 4 1 5 3 Yes 2 1 1 2 Yes 1 1 Yes 3 2 1 2 3 1 Yes 1 1 Yes 3 4 2 5 1 5 4 1 3 2
result:
ok Correct!
Test #2:
score: 10
Accepted
time: 2ms
memory: 11988kb
input:
10 4 1 2 3 3 1 1 5 1 2 1 4 2 1 1 3 1 1 1 5 1 1 1 1 1 3 1 2 1 5 1 1 2 3 4 5 1 1 1 3 2 5 1 1 3 1 5
output:
Yes 4 3 2 1 3 4 2 1 Yes 1 1 Yes 5 4 3 2 1 4 2 5 1 3 Yes 1 1 Yes 3 2 1 1 3 2 Yes 5 4 3 2 1 1 5 4 3 2 Yes 3 2 1 2 1 3 Yes 4 5 2 3 1 5 3 4 1 2 Yes 3 4 2 5 1 5 4 1 3 2 Yes 5 4 3 2 1 5 3 1 4 2
result:
ok Correct!
Test #3:
score: 10
Accepted
time: 0ms
memory: 11940kb
input:
10 5 1 2 3 4 5 5 1 1 2 3 4 5 1 2 2 3 4 5 1 1 3 2 5 5 1 1 1 1 1 5 1 2 3 4 4 5 1 2 2 2 2 5 1 1 1 2 3 5 1 2 1 2 1 5 1 2 1 2 2
output:
Yes 5 4 3 2 1 5 4 3 2 1 Yes 4 5 2 3 1 5 3 4 1 2 Yes 5 3 4 2 1 4 5 2 3 1 Yes 5 3 2 4 1 5 4 3 1 2 Yes 5 4 3 2 1 1 5 4 3 2 Yes 5 4 3 2 1 4 5 3 2 1 Yes 5 4 3 2 1 2 5 4 3 1 Yes 3 5 2 4 1 5 4 1 3 2 Yes 5 4 3 2 1 2 4 1 5 3 Yes 5 4 3 2 1 2 5 4 1 3
result:
ok Correct!
Subtask #2:
score: 10
Accepted
Test #4:
score: 10
Accepted
time: 1ms
memory: 11976kb
input:
10 10 1 2 3 4 3 1 2 4 3 8 10 1 2 1 1 4 6 4 5 2 9 10 1 2 2 4 5 3 7 7 2 3 10 1 1 2 4 5 4 3 5 7 7 10 1 2 2 4 4 1 6 6 6 10 10 1 2 2 4 1 3 7 7 1 10 10 1 2 3 4 2 1 3 3 1 7 10 1 1 1 4 5 1 3 5 4 7 10 1 2 2 1 1 2 6 5 8 5 10 1 2 2 2 5 3 6 2 4 5
output:
Yes 9 8 10 7 6 5 4 3 2 1 10 4 8 3 9 5 2 7 1 6 Yes 9 10 8 6 4 7 5 3 2 1 10 7 6 5 8 2 9 1 4 3 Yes 9 8 7 5 4 3 10 6 2 1 10 7 8 6 5 4 2 9 3 1 Yes 8 7 10 9 6 5 4 2 3 1 10 9 5 8 4 6 3 7 1 2 Yes 10 6 9 8 7 5 4 3 2 1 10 9 8 7 4 5 2 3 1 6 Yes 10 9 8 7 5 4 3 6 2 1 10 7 8 6 4 2 3 1 9 5 Yes 9 8 7 10 6 5 4...
result:
ok Correct!
Test #5:
score: 10
Accepted
time: 0ms
memory: 11988kb
input:
10 10 1 1 3 1 1 1 2 3 5 7 10 1 2 2 1 4 5 6 7 9 8 10 1 2 2 1 5 4 2 3 6 8 10 1 1 1 4 5 3 1 2 2 3 10 1 1 2 4 5 2 6 2 6 3 10 1 2 3 3 5 4 6 1 9 6 10 1 1 1 4 1 4 1 2 8 10 10 1 2 2 2 1 3 1 1 5 8 10 1 1 3 1 5 3 2 5 6 5 10 1 2 3 4 1 5 7 8 4 2
output:
Yes 10 8 6 5 9 4 3 2 7 1 9 7 10 3 8 1 6 5 4 2 Yes 9 8 10 6 7 4 5 3 2 1 10 9 7 8 5 6 2 3 1 4 Yes 10 9 7 5 4 6 3 8 2 1 8 10 6 9 5 2 7 3 1 4 Yes 7 5 4 3 10 6 2 9 8 1 10 9 8 6 5 4 1 7 3 2 Yes 10 9 7 5 4 2 8 6 3 1 8 6 9 7 5 4 3 10 1 2 Yes 10 9 8 7 5 4 6 3 2 1 9 6 10 7 5 3 4 2 1 8 Yes 10 9 7 6 5 4 3...
result:
ok Correct!
Test #6:
score: 10
Accepted
time: 0ms
memory: 9912kb
input:
10 10 1 1 1 3 5 4 1 2 8 9 10 1 2 2 1 2 2 5 4 5 1 10 1 1 1 1 1 2 5 2 1 10 10 1 2 2 3 2 1 3 4 7 4 9 1 1 4 3 3 5 5 4 5 9 1 1 2 2 5 4 6 3 3 9 1 2 1 4 3 5 2 5 3 10 1 2 2 4 2 5 5 3 1 9 9 1 2 3 2 4 5 6 8 9 10 1 1 1 1 4 6 4 5 7 10
output:
Yes 9 10 7 6 5 3 4 2 8 1 10 8 9 5 4 6 1 7 3 2 Yes 10 6 5 9 7 4 8 3 2 1 9 8 7 2 6 5 3 1 10 4 Yes 10 9 5 7 4 3 2 8 6 1 10 8 7 6 1 9 5 4 3 2 Yes 10 9 8 6 5 3 7 4 2 1 7 9 4 10 8 2 5 3 1 6 No Yes 9 8 6 7 5 2 4 3 1 7 5 4 6 3 9 8 1 2 Yes 8 7 6 4 3 9 5 2 1 9 5 8 6 4 2 7 1 3 Yes 9 10 5 7 6 4 3 8 2 1 10...
result:
ok Correct!
Subtask #3:
score: 15
Accepted
Test #7:
score: 15
Accepted
time: 79ms
memory: 9932kb
input:
10 177329 1 1 2 2 1 4 1 2 3 3 2 3 4 1 2 3 3 2 2 2 2 3 4 3 1 2 4 2 4 1 4 2 2 4 1 3 3 4 1 1 1 3 2 4 3 3 2 4 2 2 4 1 1 4 3 1 4 4 4 3 1 4 1 3 2 1 2 3 2 4 2 4 4 2 1 3 2 2 2 3 3 1 4 1 3 1 2 4 1 4 2 3 4 3 1 4 4 1 2 2 3 3 4 1 4 4 3 4 3 2 1 2 4 3 1 1 4 4 4 2 3 4 3 3 3 1 4 4 1 1 2 4 4 1 3 4 4 4 2 1 2 2 1 2 3 ...
output:
Yes 177329 177327 177325 177323 177322 177320 177319 177318 177316 177315 177314 177310 177309 177307 177306 177305 177304 177303 177302 177301 177300 177299 177298 177297 177296 177295 177293 177291 177289 177288 177287 177286 177285 177284 177283 177282 177281 177280 177279 177277 177276 177275 17...
result:
ok Correct!
Test #8:
score: 15
Accepted
time: 96ms
memory: 11492kb
input:
10 42861 1 2 1 2 3 1 2 2 1 1 3 4 3 1 2 3 2 2 3 2 3 4 2 2 2 4 2 3 1 2 1 4 4 2 4 3 1 1 4 3 1 1 4 1 1 4 3 3 1 3 3 3 2 4 4 1 3 2 1 1 1 1 1 1 4 3 1 1 2 4 1 1 2 4 2 3 4 4 4 2 4 3 3 3 2 1 3 4 4 3 1 3 4 4 4 1 4 4 1 3 2 4 4 3 3 4 3 3 4 3 1 4 2 1 2 3 2 4 3 4 1 2 3 4 2 4 1 3 4 1 1 1 4 3 4 2 1 4 3 1 3 3 2 1 1 4...
output:
Yes 42859 42856 42855 42852 42851 42850 42849 42848 42847 42846 42845 42844 42843 42842 42840 42837 42833 42832 42830 42829 42828 42826 42825 42823 42822 42821 42818 42817 42815 42813 42811 42810 42809 42807 42804 42803 42802 42801 42800 42794 42793 42792 42789 42788 42787 42786 42784 42783 42780 42...
result:
ok Correct!
Test #9:
score: 15
Accepted
time: 70ms
memory: 10120kb
input:
10 45364 1 1 1 1 1 1 1 2 2 2 2 1 2 4 3 3 1 4 1 3 2 2 3 1 2 2 3 2 3 3 3 2 3 3 2 3 2 1 1 3 4 2 2 4 4 3 1 2 4 1 3 4 4 1 3 4 1 4 3 2 1 2 3 3 4 4 1 3 3 3 2 3 4 4 2 1 2 1 2 1 1 2 2 2 3 1 3 3 1 4 1 3 1 2 3 4 2 2 3 3 1 3 3 4 4 4 4 1 1 4 4 1 4 2 2 1 1 4 3 3 4 3 4 4 4 4 4 1 4 4 1 4 3 1 3 1 3 3 4 1 1 2 1 2 1 3...
output:
Yes 45364 45362 45356 45354 45352 45351 45346 45337 45336 45333 45326 45324 45322 45319 45317 45315 45314 45312 45309 45302 45301 45299 45287 45281 45279 45265 45261 45259 45258 45256 45247 45239 45236 45234 45226 45219 45213 45212 45206 45204 45197 45194 45193 45191 45188 45179 45178 45177 45173 45...
result:
ok Correct!
Test #10:
score: 15
Accepted
time: 76ms
memory: 11704kb
input:
10 60502 1 1 3 2 4 3 2 4 4 1 2 2 3 3 4 3 3 4 3 1 3 4 1 2 1 1 2 1 4 2 2 2 4 4 4 3 3 1 4 1 3 4 4 4 4 2 1 3 1 2 4 4 2 1 4 4 1 2 3 3 1 2 2 4 1 3 3 1 4 1 2 2 4 1 1 4 2 1 3 3 4 4 4 4 2 2 2 2 4 4 4 3 4 3 2 4 4 4 1 4 2 3 2 3 2 3 2 1 3 2 4 2 1 1 1 3 2 3 2 2 1 2 1 4 2 2 4 4 2 3 2 4 2 1 4 2 3 2 1 1 1 1 3 2 2 3...
output:
Yes 60501 60500 60499 60498 60497 60496 60494 60493 60492 60491 60490 60489 60488 60487 60485 60484 60482 60480 60477 60476 60475 60474 60473 60471 60470 60469 60468 60466 60465 60464 60463 60461 60460 60459 60458 60457 60456 60455 60453 60452 60451 60449 60448 60447 60445 60444 60443 60441 60439 60...
result:
ok Correct!
Test #11:
score: 15
Accepted
time: 94ms
memory: 11880kb
input:
10 192651 1 2 4 1 3 2 3 1 1 4 2 2 2 2 1 3 2 3 1 1 1 1 2 4 3 4 2 2 1 2 3 4 4 3 1 3 1 4 1 3 4 1 4 2 4 1 2 1 2 2 4 2 4 4 1 4 3 2 2 1 1 3 1 3 2 2 3 1 4 3 4 4 3 1 3 2 2 2 3 3 3 1 1 2 3 3 2 3 2 3 3 4 2 4 1 1 2 1 4 4 1 1 1 1 1 2 2 2 2 4 3 3 4 4 2 3 2 1 2 3 2 2 1 4 3 4 1 4 2 4 4 4 2 1 1 3 2 1 2 1 3 1 2 3 1 ...
output:
No Yes 165222 165220 165218 165217 165216 165212 165210 165204 165203 165201 165197 165196 165195 165194 165192 165190 165189 165186 165184 165183 165182 165180 165178 165176 165175 165169 165166 165165 165164 165161 165160 165157 165156 165151 165149 165148 165147 165146 165144 165142 165138 165137...
result:
ok Correct!
Test #12:
score: 15
Accepted
time: 65ms
memory: 9876kb
input:
10 96064 1 1 1 1 4 4 1 4 1 1 2 1 3 4 3 2 2 2 1 1 1 2 1 1 3 4 1 2 2 3 2 2 3 4 4 3 3 3 4 3 2 3 3 4 3 4 3 4 2 3 2 2 3 4 1 1 1 2 3 2 3 3 4 1 4 4 3 1 2 3 3 3 3 2 4 4 2 2 3 4 4 1 4 1 1 2 1 4 2 3 3 2 4 2 1 4 3 4 1 4 4 2 1 3 1 2 4 2 2 4 3 3 4 4 4 3 3 4 1 3 2 1 2 1 2 1 2 1 2 4 3 4 1 4 4 4 2 1 2 1 4 3 3 4 2 1...
output:
Yes 96064 96063 96040 96039 96036 96032 96024 96019 96017 96003 96002 95994 95993 95990 95988 95987 95982 95978 95973 95971 95970 95966 95964 95963 95961 95960 95958 95944 95928 95925 95923 95922 95919 95916 95911 95907 95906 95903 95902 95901 95897 95888 95884 95880 95879 95878 95877 95875 95871 95...
result:
ok Correct!
Subtask #4:
score: 15
Accepted
Test #13:
score: 15
Accepted
time: 221ms
memory: 11516kb
input:
10 199850 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
Yes 199850 199849 199848 199847 199846 199845 199844 199843 199842 199841 199840 199839 199838 199837 199836 199835 199834 199833 199832 199831 199830 199829 199828 199827 199826 199825 199824 199823 199822 199821 199820 199819 199818 199817 199816 199815 199814 199813 199812 199811 199810 199809 19...
result:
ok Correct!
Test #14:
score: 15
Accepted
time: 216ms
memory: 11616kb
input:
10 199997 1 1 1 4 4 6 4 8 4 10 11 10 6 14 15 16 17 15 19 15 14 4 15 10 25 26 27 1 29 30 31 26 33 15 30 36 37 38 39 38 33 4 10 44 25 33 33 11 49 50 31 1 53 54 55 14 50 58 8 49 36 6 63 39 65 6 33 10 69 29 19 72 29 74 1 76 63 49 4 80 50 82 83 15 4 86 87 50 89 36 27 89 93 11 95 63 1 37 99 100 101 102 10...
output:
Yes 199997 199996 199995 199994 199993 199992 199991 199990 199989 199988 199987 199986 199985 199984 199983 199982 199981 199980 199979 199978 199977 199976 199975 199974 199973 199972 199971 199970 199969 199968 199967 199966 199965 199964 199963 199962 199961 199960 199959 199958 199957 199956 19...
result:
ok Correct!
Test #15:
score: 15
Accepted
time: 219ms
memory: 12708kb
input:
10 199730 1 2 2 2 1 2 2 1 2 10 2 12 13 10 15 16 17 13 19 20 1 13 16 24 19 2 27 28 29 17 28 12 1 16 28 1 17 13 24 17 41 42 24 17 41 28 47 2 2 2 51 52 51 15 42 56 57 42 59 20 51 62 47 64 47 66 42 12 69 70 69 15 51 74 10 47 77 78 13 69 81 82 83 84 64 2 87 28 10 90 91 10 13 74 70 96 97 12 99 17 15 17 87...
output:
Yes 199730 199729 199728 199727 199726 199725 199724 199723 199722 199721 199720 199719 199718 199717 199716 199715 199714 199713 199712 199711 199710 199709 199708 199707 199706 199705 199704 199703 199702 199701 199700 199699 199698 199697 199696 199695 199694 199693 199692 199691 199690 199689 19...
result:
ok Correct!
Test #16:
score: 15
Accepted
time: 219ms
memory: 11516kb
input:
10 199782 1 2 2 2 1 1 1 1 1 2 2 2 2 2 2 2 1 1 1 1 2 2 1 2 1 1 2 1 1 2 2 1 33 33 33 33 1 2 1 1 2 2 1 2 2 33 2 1 1 1 33 33 2 33 2 1 2 2 1 1 2 1 1 33 2 2 1 33 2 1 33 1 1 2 2 33 2 33 2 1 33 33 33 2 2 1 1 1 1 1 33 2 2 2 2 33 1 1 2 33 1 33 1 1 1 2 2 2 33 33 33 2 2 1 33 2 33 2 2 2 33 33 1 1 33 1 33 2 1 2 3...
output:
Yes 199782 199781 199780 199779 199778 199777 199776 199775 199774 199773 199772 199771 199770 199769 199768 199767 199766 199765 199764 199763 199762 199761 199760 199759 199758 199757 199756 199755 199754 199753 199752 199751 199750 199749 199748 199747 199746 199745 199744 199743 199742 199741 19...
result:
ok Correct!
Test #17:
score: 15
Accepted
time: 197ms
memory: 12352kb
input:
10 199768 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
Yes 199768 199767 199766 199765 199764 199763 199762 199761 199760 199759 199758 199757 199756 199755 199754 199753 199752 199751 199750 199749 199748 199747 199746 199745 199744 199743 199742 199741 199740 199739 199738 199737 199736 199735 199734 199733 199732 199731 199730 199729 199728 199727 19...
result:
ok Correct!
Test #18:
score: 15
Accepted
time: 37ms
memory: 4392kb
input:
10 199897 1 133473 137888 154846 104937 137888 3569 104774 144338 186307 16043 175982 174471 97731 56127 91564 38890 40649 89585 22112 91564 169703 102594 111754 96581 132350 39595 142435 3652 102405 58841 71649 89585 104964 111754 27732 141427 45005 177850 292 102734 71015 113628 177036 16043 30227...
output:
No No No No No No No No No No
result:
ok Correct!
Subtask #5:
score: 50
Accepted
Test #19:
score: 50
Accepted
time: 228ms
memory: 11564kb
input:
10 199755 1 2 1 3 5 1 6 7 2 1 5 6 10 9 12 2 4 14 2 18 5 17 23 4 6 7 4 6 20 27 16 24 29 8 33 26 33 27 17 39 5 33 34 41 4 16 24 19 42 8 29 48 48 27 37 24 43 13 4 28 38 27 38 23 29 55 14 62 26 9 62 20 35 31 57 74 69 5 26 60 33 59 5 19 21 45 15 87 3 54 17 2 57 36 18 67 25 62 47 53 89 27 5 59 75 77 29 9 ...
output:
Yes 199753 199752 199751 199750 199749 199747 199746 199745 199744 199742 199740 199736 199733 199731 199730 199727 199725 199724 199723 199721 199720 199719 199717 199716 199715 199711 199707 199702 199701 199699 199698 199697 199696 199693 199690 199689 199686 199684 199675 199673 199672 199671 19...
result:
ok Correct!
Test #20:
score: 50
Accepted
time: 219ms
memory: 10412kb
input:
10 199738 1 1 2 1 5 4 6 6 2 8 7 1 5 13 11 9 7 13 3 8 7 14 8 24 17 12 1 11 20 28 4 20 17 12 6 15 32 36 19 11 25 37 26 43 4 37 22 5 18 10 46 51 41 20 23 52 7 28 49 49 27 62 25 7 17 55 59 27 19 1 32 51 9 54 4 24 13 26 7 78 11 40 30 63 31 8 71 61 24 26 57 35 36 76 49 4 89 51 48 100 72 100 58 3 59 66 36 ...
output:
Yes 199735 199733 199732 199731 199730 199728 199727 199721 199720 199719 199717 199715 199713 199710 199709 199708 199705 199704 199703 199697 199696 199691 199689 199688 199686 199685 199684 199681 199678 199673 199672 199671 199670 199668 199665 199664 199663 199659 199658 199656 199655 199654 19...
result:
ok Correct!
Test #21:
score: 50
Accepted
time: 240ms
memory: 11864kb
input:
10 199701 1 1 3 2 5 6 6 1 1 5 7 10 13 12 1 12 5 16 10 19 16 6 21 20 21 17 18 26 8 17 13 18 9 34 32 1 24 10 35 15 26 31 37 42 1 19 22 40 32 3 16 48 19 11 47 17 31 24 27 54 20 7 55 9 24 4 24 25 21 12 65 62 38 11 50 13 43 69 53 54 78 61 80 19 6 9 55 77 60 26 42 19 16 60 32 94 25 39 29 57 4 93 56 56 86 ...
output:
Yes 199699 199697 199695 199692 199691 199690 199689 199688 199686 199685 199683 199682 199680 199679 199678 199676 199674 199673 199671 199670 199669 199668 199667 199666 199665 199663 199661 199658 199655 199654 199649 199648 199645 199644 199643 199640 199639 199637 199636 199635 199634 199632 19...
result:
ok Correct!
Test #22:
score: 50
Accepted
time: 206ms
memory: 11764kb
input:
10 199753 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
Yes 199753 199752 199751 199750 199749 199748 199747 199746 199745 199744 199743 199742 199741 199740 199739 199738 199737 199736 199735 199734 199733 199732 199731 199730 199729 199728 199727 199726 199725 199724 199723 199722 199721 199720 199719 199718 199717 199716 199715 199714 199713 199712 19...
result:
ok Correct!
Test #23:
score: 50
Accepted
time: 220ms
memory: 10248kb
input:
10 199750 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
Yes 199750 199748 199749 199746 199747 199744 199745 199742 199743 199740 199741 199738 199739 199736 199737 199734 199735 199732 199733 199730 199731 199728 199729 199726 199727 199724 199725 199722 199723 199720 199721 199718 199719 199716 199717 199714 199715 199712 199713 199710 199711 199708 19...
result:
ok Correct!
Test #24:
score: 50
Accepted
time: 232ms
memory: 11576kb
input:
10 200000 1 2 2 2 5 3 6 2 9 1 9 5 6 1 15 12 9 15 9 19 7 14 16 23 7 16 6 14 17 20 24 8 32 6 14 11 15 30 4 38 17 37 24 11 27 2 27 17 19 32 36 25 31 26 35 1 10 31 46 17 4 39 28 3 49 22 24 47 33 4 28 26 20 74 67 73 57 33 23 62 73 14 16 67 37 83 8 4 51 2 2 81 88 27 28 11 49 45 25 31 37 77 83 99 8 44 63 3...
output:
Yes 199999 199997 199996 199994 199993 199992 199991 199988 199987 199986 199984 199982 199981 199980 199977 199974 199973 199966 199961 199960 199959 199958 199957 199956 199954 199953 199950 199948 199944 199943 199940 199939 199938 199933 199932 199931 199930 199926 199925 199924 199923 199921 19...
result:
ok Correct!
Test #25:
score: 50
Accepted
time: 230ms
memory: 10284kb
input:
10 199804 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 4 3 6 2 5 1 5 6 2 7 1 12 12 14 16 16 3 10 7 16 5 25 17 20 5 13 15 6 7 7 21 9 18 26 8 26 6 22 34 25 24 21 9 16 3 13 48 42 41 50 43 26 17 12 53 57 43 56 60 63 42 29 63 20 40 7 6 65 66 64 36 25 72 49 14 27 37 32 59 61 9 85 31 70 21 2 54 12 50 31 7...
output:
Yes 199804 199803 199802 199800 199799 199798 199796 199794 199793 199792 199789 199786 199784 199782 199781 199778 199776 199771 199769 199767 199766 199765 199764 199763 199762 199758 199757 199756 199755 199753 199749 199746 199745 199743 199738 199735 199733 199731 199730 199728 199727 199726 19...
result:
ok Correct!
Test #26:
score: 50
Accepted
time: 236ms
memory: 11788kb
input:
10 199826 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 2 3 6 5 4 1 10 9 7 7 3 6 4 5 7 10 6 7 5 6 3 20 22 11 11 27 27 21 17 5 32 17 26 10 4 29 29 11 24 14 27 32 11 43 36 21 22 13 28 43 33 17 51 7 15 30 37 38 8 28 61 4 38 65 65 4 23 22 35 4 8 1 43 75 39 12 38 73 50 42 71 80 82 69 88 9 44 84 12 49 83 ...
output:
Yes 199823 199821 199820 199818 199816 199815 199813 199812 199808 199806 199802 199800 199799 199798 199797 199794 199792 199791 199790 199788 199787 199786 199783 199782 199780 199779 199776 199773 199768 199766 199765 199761 199760 199758 199757 199756 199754 199753 199750 199744 199741 199738 19...
result:
ok Correct!
Test #27:
score: 50
Accepted
time: 238ms
memory: 11996kb
input:
10 199955 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 4 1 6 7 1 8 8 1 7 12 10 8 9 13 5 3 19 18 8 15 24 5 5 14 23 13 14 6 29 28 12 13 3 7...
output:
Yes 199955 199953 199951 199949 199948 199947 199946 199945 199942 199941 199940 199939 199937 199936 199935 199934 199933 199931 199930 199929 199927 199926 199925 199924 199922 199920 199919 199912 199910 199909 199908 199907 199906 199902 199901 199899 199898 199891 199890 199888 199886 199885 19...
result:
ok Correct!
Test #28:
score: 50
Accepted
time: 223ms
memory: 11528kb
input:
10 199833 1 1 1 1 9 5 4 7 2 6 7 2 12 2 4 7 6 4 6 19 18 2 8 6 18 22 21 7 25 18 22 24 24 29 1 3 10 18 28 26 33 3 25 42 17 37 31 14 26 39 18 25 35 6 21 4 5 37 34 56 25 7 26 25 17 22 31 42 54 6 17 35 13 34 15 1 35 37 43 19 50 70 59 70 34 45 63 37 29 4 82 52 35 8 4 10 45 33 40 40 58 23 73 74 86 3 54 55 4...
output:
No Yes 199862 199859 199855 199854 199853 199852 199847 199846 199844 199842 199841 199837 199836 199833 199832 199829 199828 199827 199821 199818 199817 199816 199813 199810 199808 199804 199800 199798 199796 199792 199791 199790 199789 199786 199785 199781 199779 199778 199777 199775 199774 199773...
result:
ok Correct!