- P131's solution
-
题解P131
- @ 2025-10-25 18:49:36
按照提议写一个真随机即可。
AC code:
#include <bits/stdc++.h>
using namespace std;
// 初始化函数,用于设置随机数种子
extern "C" void init()
{
// 使用当前时间作为随机数种子
srand(time(nullptr));
}
// 随机数生成函数
extern "C" int randint()
{
// 生成一个随机整数
return rand();
}