Jolly Jumpers

Jolly Jumpers

請問這個程式是在做甚麼的?

還有請大大用幾個例題

來教教我

謝謝了

1 Answer

Rating
  • 1 decade ago
    Favorite Answer

    有n個整數的序列,由左到右或由右到左相鄰兩個數字兩兩相差的絕對值剛好為1到n-1,則我們稱為Jolly Jumpers。例如:6,1,5,8,10,9,其由左到右相鄰兩個數字兩兩相差,|6-1|=5,|1-5|=4,|5-8|=3,|8-10|=2,|10-9|=1

    • Commenter avatarLogin to reply the answers
Still have questions? Get your answers by asking now.