跳到正文

算法·理论

对拍代码

qdsdsy约 1 分钟
原文
文章信息与版本

文章信息

发布
2026年8月24日
收录
2026年9月9日
更新
2026年11月11日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>

using namespace std;

int main()
{
    system("g++ fru.cpp -o fru -O2 -std=c++11");
    system("g++ std.cpp -o std -O2 -std=c++11");
    system("g++ data.cpp -o data");
    for(int i=1;i<=10000;i++){
        printf("%d:",i);
        system("data >tt.in");
        system("fru <tt.in >fru.out");
        system("std <tt.in >std.out");
        if(system("fc fru.out std.out >nul")!=0){
            printf("WA\n");
            return 0;
        }else {
            printf("AC\n");
            // return 0;
        }
    }
}
原文