Linux中写的对拍求调 玄关
  • 板块学术版
  • 楼主JoeZ009
  • 当前回复5
  • 已保存回复5
  • 发布时间2024/3/1 21:03
  • 上次更新2024/3/1 22:53:35
查看原帖
Linux中写的对拍求调 玄关
544773
JoeZ009楼主2024/3/1 21:03

RT

x.cpp

#include<bits/stdc++.h>
using namespace std;
signed main() {
    freopen("x.in","r",stdin);
    freopen("x.out","w",stdout);
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
    return 0;
}

xbf.cpp

#include<bits/stdc++.h>
using namespace std;
signed main() {
    freopen("x.in","r",stdin);
    freopen("x.ans","w",stdout);
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
    return 0;
}

check.cpp

#include<bits/stdc++.h>
using namespace std;
mt19937 mt(time(0));
uniform_int_distribution<int> dis(0,(int)1e9);

void Rd() {
    FILE *in=fopen("x.in","w");
    int a=dis(mt),b=dis(mt);
    fprintf(in,"%d %d\n",a,b);
    fclose(in);
    return;
}
signed main() {
    int T=100;
    while(T--) {
        Rd();
        system("x");
        system("xbf");
        if(system("diff x.out x.ans -b -B")) {
            cout<<"WA"<<endl;
            getchar();
        } else cout<<"OK"<<endl;
    }
    cout<<"AC"<<endl;
    return 0;
}

x和xbf都编译好了 但运行check时显示

x:not found xbf:not found

2024/3/1 21:03
加载中...