Uva's 3n+1 problem

前端 未结 8 1954
滥情空心
滥情空心 2020-12-11 22:40

I\'m solving Uva\'s 3n+1 problem and I don\'t get why the judge is rejecting my answer. The time limit hasn\'t been exceeded and the all test cases I\'ve tried have run corr

8条回答
  •  时光取名叫无心
    2020-12-11 23:19

    Did you make sure that the output was in the same order specified in the input. I see where you are swapping the input if the first input was higher than the second, but you also need to make sure that you don't alter the order it appears in the input when you print the results out.

    ex.

    Input

    10 1

    Output

    10 1 20

提交回复
热议问题