刚才随便找了一道题目,那题解的和我的代码对拍,以下是我的对拍程序。
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+7;
signed main(){
mt19937 rnd(time(0));
int cnt=100;
while(cnt){
ofstream fout("P6273.in");
int n=rnd()%N+1;
for(int i=1;i<=n;i++){
int val=rnd()%52+1;
if(val<=26){
fout<<(char)('a'+(val-1));
}
else{
fout<<(char)('A'+(val-1));
}
}
fout<<"\n";
fout.close();
system("P6273.exe < P6273.in > P6273.out");
system("P6273check.exe < P6273.in > P6273.ans");
if(system("fc P6273.out P6273.ans")){
fout<<"WA\n";
return 0;
}
system("cls");
cnt--;
}
cout<<"AC"<<"\n";
return 0;
}
本应该输出 "AC",却输出了 0。