- [GESP202406 七级] 区间乘积
对拍写法
- @ 2026-7-28 9:54:29
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 条评论
-
张乔淞 可达班2025 Lv.初识 @ 2026-8-5 17:06:22猫猫曹锦程哈气5小时跑步进点
-
@ 2026-7-28 10:23:09bibilabo
-
@ 2026-7-28 9:58:02bababoy
- 1
信息
- ID
- 532
- 时间
- ms
- 内存
- MiB
- 难度
- 8
- 标签
- 递交数
- 13
- 已通过
- 7
- 上传者