对拍
3.2 安装CYaRon包
在你的终端中输入pip install cyaron
,这里需要注意一一下你的环境
cyaron生成数据对拍
#!/usr/bin/env python from cyaron import * # 引入CYaRon的库 import random fout = open("a.in","w") a=randint(-100,100) b=randint(-100,100) c=randint(1,20) fout.write("%d %d\n%d"%(a,b,c)) fout.close()
:loop make.py baoli.exe>b.out std.exe>c.out fc b.out c.out if not errorlevel 1 goto loop pause
c++生成数据对拍
#include<bits/stdc++.h> #include<ctime> using namespace std; int rnd() { return rand() << 15 | rand(); } int tot; int main() { freopen("a.in", "w", stdout); srand((unsigned)time(0)); int N = (rand() % 300) +1;//[1, 30] cout << N << ' '; N = (rand() % 300) +1;//[1, 30] cout << N << ' '; N = (rand() % 300) +1;//[1, 30] cout << N <<endl; return 0; }
:loop rand.exe baoli.exe>b.out std.exe>c.out fc b.out c.out if not errorlevel 1 goto loop pause