SPJ 里用不了 srand 吗?
  • 板块灌水区
  • 楼主__Octhyccc__
  • 当前回复2
  • 已保存回复2
  • 发布时间2024/1/19 23:37
  • 上次更新2024/1/20 10:45:44
查看原帖
SPJ 里用不了 srand 吗?
995753
__Octhyccc__楼主2024/1/19 23:37

我写了一个 SPJ,但是最后我想给它在判题的时候加上一个随机数,结果编译失败了,告诉我不应该用

[Error] call to 'srand' declared with attribute error: Don't use srand(), you should use 'registerGen(argc, argv, 1);' to initialize generator seed by hash code of the command line params. The third parameter is randomGeneratorVersion (currently the latest is 1).

所以谁能解释一下为什么,以及怎样去做,谢谢!

2024/1/19 23:37
加载中...