zoukankan      html  css  js  c++  java
  • CSP(noip)中的简单对拍写法

    以a+b为例

    这是随机数据

    #include<iostream>
    #include<cstdio>
    #include<ctime>
    using namespace std;
    int main(){
        freopen("rand.txt","w",stdout);
        int a,b;
        srand(time(0));
        a=rand()%10+1;b=rand()%10+1;
        cout<<a+b;
    }
    View Code

    这是正解(假设它是正解!)

    #include<iostream>
    #include<cstdio>
    #include<ctime>
    using namespace std;
    int main(){
        freopen("rand.txt","r",stdin);
        freopen("1.txt","w",stdout);
        int a,b;
        cin>>a>>b;
        cout<<a+b;
    }
    View Code

    这是暴力(假设它是暴力)

    #include<iostream>
    #include<cstdio>
    #include<ctime>
    using namespace std;
    int main(){
        freopen("rand.txt","r",stdin);
        freopen("2.txt","w",stdout);
        int a,b;
        cin>>a>>b;
        cout<<a+b;
    }
    View Code

    最后就是对拍了

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        while(1){
            system("rand.exe");
            system("1.exe");
            system("2.exe");
            if(system("fc 1.txt 2.txt"));
            while(1);
        }
    }
    View Code
  • 相关阅读:
    elk 日志处理的一点思路
    elk 日志处理的一点思路
    elk 分布式部署
    elk 分布式部署
    分布式集群
    分布式集群
    分布式里数据保证容错性有两种方法.
    elk 数据存储
    elk 数据存储
    zookeeper 数据存储特点
  • 原文地址:https://www.cnblogs.com/Larry-Zero/p/11700499.html
Copyright © 2011-2022 走看看