关于卡时在赛场能否使用
查看原帖
关于卡时在赛场能否使用
255077
麦克斯韦の妖楼主2022/11/13 18:34

目前做题时发现有一个技巧很好用,不知道在 NOIp 赛场上会不会出问题。

#include<ctime>
...
int begin_time=clock();
...
if(clock()-begin_time>=900){
  // output ans
  exit(0);
}

在洛谷和本地都可以实现卡 900 ms 的时限。不知道 CCF 的测评姬上会不会出问题。

话说换成 (double)(clock()-begin_time())/CLOCKS_PRE_SEC>=0.9 是不是更保险?

2022/11/13 18:34
加载中...