我們設單次正確的概率爲
c = a + b
b = a - 1
b = a == 0
input n
input m
a = 0
b = 1
c = a + b
c = c % m
a = b
b = c
n = n - 1
p = n == 0
if p goto 5
output a
如果我們那麼寫,
期望得分:
首先,我們先解決
我們可以多取幾個值,然後,判相等,還有,請不要打註釋。
c = a + b
d = a + b //重複算兩次
e = c - d //當e爲0時,c=d
if e goto 1 //1是這個程序段的1,可以降低出錯概率
出錯概率很小,當且僅當
同樣的思路:
input a
input b
c = 0
d = 1
e = c + d
f = c + d
g = e - f
if g goto 5
c = d
d = e
e = c % b
f = c % b
g = e - f
if g goto 11
c = e
e = d % b
f = d % b
g = e - f
if g goto 16
d = e
e = a - 1
f = a - 1
g = e - f
if g goto 21
a = e
if a goto 5
output c
然後果斷出現一行綠綠的100.