R, (削除) 58 (削除ここまで) 55(削除) 55 (削除ここまで) 45 bytes
b=seq(a<-scana=scan());while(any(b-a)a[2]>2)a=matrix(a,,2,F<-F+1);F
Simulates the sorting process. Input is 1-indexed, returns FALSE for 0.
R, (削除) 58 (削除ここまで) 55 bytes
b=seq(a<-scan());while(any(b-a))a=matrix(a,,2,F<-F+1);F
Simulates the sorting process. Input is 1-indexed, returns FALSE for 0.
R, (削除) 58 (削除ここまで) (削除) 55 (削除ここまで) 45 bytes
a=scan();while(a[2]>2)a=matrix(a,,2,F<-F+1);F
Simulates the sorting process. Input is 1-indexed, returns FALSE for 0.
R, 58(削除) 58 (削除ここまで) 55 bytes
b=seq(a<-scan());while(any(b-a))a=matrix(a,,2,F<-F+1)[b];F;F
Simulates the sorting process. Input is 1-indexed, returns FALSE for 0.