跳到正文

剪贴板

剪贴板 78sxau1k

原文
剪贴板信息

剪贴板信息

收录
更新

伪随机

线性同余法

C++
#include<iostream>
#include<cstdio>
#define ll unsigned long long
using namespace std;
const ll B=13331,P=19198107,M=1145141008659427;
ll n,lst=0;
ll rnd(){
	lst=(lst*B+P)%M;
	return lst;
}
int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin>>n>>lst;
	lst=rnd();
	for(int i=1;i<=n;++i)
		cout<<rnd()<<"\n";
	return 0;
}