import random
a = random.randint(1,1000000000)
b = random.randint(1,1000000000)
c = random.randint(1,10000)
def randomseed(a,b,c,rr):
return (a*rr+b)%c
d = list(map(int,input().split()))
rand = [d[0]]
for i in range(d[1]):
rand.append(randomseed(a,b,c,int(rand[i])))
print(rand[i+1])
提交連結
https://judge.ccclub.io/status/b6956ceb115f2a62274c9972d9c0eaf4
程式碼
錯誤訊息
問題描述
a,b,c每次出來都會不一樣答案就會變,是要不管執行幾次,機率都相同的那種嗎?