对拍程序
from os import system
tc=0
while True:
system("python data.py > data.in")
system("std.exe < data.in > std.out")
system("my.exe < data.in > my.out")
# system("diff std.out my.out > diff.out"):
if system("fc std.out my.out > diff.out"):
print("WA")
break
else:
tc += 1
print("AC #%d"%tc)
print("-------------------- data.in --------------------")
# system("cat data.in")
system("type data.in")
print("-------------------- std.out --------------------")
system("type std.out")
print("-------------------- my.out ---------------------")
system("type my.out")
Powershell
#include <bits/stdc++.h>
using namespace std;
int main()
{
int tc=0;
while(1) {
system("./E_data > data.in");
system("cat data.in | ./E_std.exe > std.txt");
system("cat data.in | ./E.exe > my.txt");
if(system("diff std.txt my.txt > diff.txt")) {
cout<<"WA"<<endl;
break;
}
else
cout<<"AC #" << (++tc) <<endl;
// system("cat data.in");
// cout<<"-------------------- std.out --------------------\n";
// system("cat std.txt");
// cout<<"-------------------- my.out ---------------------\n";
// system("cat my.txt");
}
cout<<"-------------------- data.in --------------------\n";
system("cat data.in");
cout<<"-------------------- std.out --------------------\n";
system("cat std.txt");
cout<<"-------------------- my.out ---------------------\n";
system("cat my.txt");
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
int tc=0;
while(1) {
system("data.exe > data.in");
// system("python data.py > data.in");
system("std.exe < data.in > std.out");
system("my.exe < data.in > my.out");
// system("diff std.out my.out > diff.out"):
if(system("fc std.out my.out > diff.out")) {
cout<<"WA"<<endl;
break;
}
else
cout<<"AC #" << (++tc) <<endl;
}
cout<<"-------------------- data.in --------------------\n";
// system("cat data.in");
system("type data.in");
cout<<"-------------------- std.out --------------------\n";
system("type std.out");
cout<<"-------------------- my.out ---------------------\n";
system("type my.out");
return 0;
}
Next: [算法][数论] 最大公约数(GCD)与欧几里得算法