作者ckaha (★飛天 御劍流★)
看板NTUMath91
標題[問題] 高手們...
時間Wed Sep 17 20:38:11 2003
It is conjectured that the algorithm above will terminate (when a 1 is printed)
for any integral input value. Despite the simplicity of the algorithm, it is u
nknown whether this conjecture is true. It has been verified, however, for all
integers n such that 0 < n < 1,000,000 (and, in fact, for many more numbers tha
n this.)
Given an input n, it is possible to determine the number of numbers printed (in
cluding the 1). For a given n this is called the cycle-length of n. In the exam
ple above, the cycle length of 22 is 16.
For any two numbers i and j you are to determine the maximum cycle length over
all numbers between i and j.
The Input
The input will consist of a series of pairs of integers i and j, one pair of in
tegers per line. All integers will be less than 1,000,000 and greater than 0.
You should process all pairs of integers and for each pair determine the maximu
m cycle length over all integers between and including i and j.
The Output
For each pair of input integers i and j you should output i, j, and the maximum
cycle length for integers between and including i and j. These three numbers s
hould be separated by at least one space with all three numbers on one line and
with one line of output for each line of input. The integers i and j must appe
ar in the output in the same order in which they appeared in the input and shou
ld be followed by the maximum cycle length (on the same line).
這是什麼意思呢?
--
台大數學系
向下沉淪委員會
目前會員:
ckaha 榮譽會員:
--
※ 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw)
◆ From: 218.166.79.140