1
跳躍のトカゲ!
長さNの自然数の配列Lを受け取り、次のような簡単なプログラムを定義するとします。 i=0 #start at the first element in the source array P=[] #make an empty array while L[i]!=0: #and while the value at the current position is not 0 P.append(L[i]) #add the value at the current position to the end of the output array i=(i+L[i])%N #move that many spaces forward …