赛博抽卡又来了!
你需要输出一个种子,使得该随机代码一发就能抽得20250601返回0(AC),否则返回1(WA)。
如果你没有输出,那就是真抽卡了,随机代码会使用当前时间做种子抽卡1919810次,如果抽到至少一次20250601会返回0(AC),否则返回1(WA)。
mt19937_64(梅森旋转算法)保证,当传入的种子确定,其生成的随机数序列也是确定的;换句话说,该算法保证传入同一个
种子不会生成多种随机数序列。
#include <bits/stdc++.h>
int main()
{
long long seed;
std::ifstream fin("user_output");
if(fin >> seed)
{
std::mt19937_64 mt(seed);
return (mt() % 100000000) != 20250601;
}
else
{
std::mt19937_64 mt(std::chrono::steady_clock::now().time_since_epoch().count());
for(int i = 0; i < 1919810; i++)
if((mt() % 100000000) == 20250601)
return 0;
return 1;
}
}
其实上面的代码就是Special Judge