main.cpp

#include<bits/stdc++.h>
using namespace std;

void solve() {
    int a, b;
    cin >> a >> b;
    int c = a + b;
    if (c % 10 == 0) c++;
    cout << c << '\n';

}
int main() {
    int t;
    cin >> t;
    while (t--) solve();
}

baoli.cpp

#include<bits/stdc++.h>
using namespace std;

void solve() {

    int c = 0;
    int a, b;
    cin >> a >> b;
    while (a > 0) {
        c++, a--;
    }
    while (b > 0) {
        c++, b--;
    }
    cout << c << endl;
}
int main() {
    int t; cin >> t;
    while (t--) solve();
}

gen.cpp

#include<bits/stdc++.h>
using namespace std;

// mt19937 rd(time(0));
mt19937 rd(chrono::system_clock::now().time_since_epoch().count());
int gen(int l, int r) {
    return rd() % (r - l + 1) + l;
}
int main() {
    int t = 20;
    cout << t << '\n';
    while (t--) {
        int n = gen(2, 10);
        for (int i = 2; i <= n; i++) {
            cout << i << ' ' << gen(1, i - 1) << '\n';
        }
    }

}

duipai.cpp

#include<bits/stdc++.h>
using namespace std;

int main() {
    system("g++ -std=c++17 baoli.cpp -o baoli");
    system("g++ -std=c++17 gen.cpp -o gen");
    system("g++ -std=c++17 main.cpp -o main");
    for (int t = 1; ; t++) {
        cout << t << endl;
        system("gen > in.txt");
        system("main < in.txt > main.txt");
        system("baoli < in.txt > baoli.txt");
        if (system("fc main.txt baoli.txt")) {
            cout << "wa\n";
            return 0;
        }
    }
}
/*
g++ duipai.cpp -o duipai && duipai
*/

3 条评论

  • 1

信息

ID
532
时间
ms
内存
MiB
难度
8
标签
递交数
13
已通过
7
上传者