#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<fstream>
#include<iomanip>
#include<climits>
#include<queue>
#include<unordered_map>
#include<map>
#include<set>
#include<ctime>
using namespace std;
#define YES "Yes"
#define NO "No"
#define int long long
#define endl "\n"
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define rep(i,j,k) for(i=(j);i<(k);i++)
#define all(x) begin(x),end(x)
#define vi vector<int>
typedef pair<int, int> pii;
#define cout fout
#define cin fin
ofstream fout("out.txt");
ifstream fin("in.txt");
const int MOD = 1000000007;
const int N = 2e5 + 10;
int ii, jj, kk;
int getRand(int l, int r) { return rand() % (r - l + 1) + l; }
/* 传入数字n 能生成2n组数据
一组暴力 一组正常*/
void clapper(int n) {
ofstream dataout("in.txt");
dataout << n << endl;
rep(ii, 0, n) {
//生成数组范围
int nn = getRand(1, 10);
vector<int>v(nn, 0);
//生成数据
rep(jj, 0, nn) { v[jj] = getRand(1, 10); }
//输出两组数据
dataout << nn << endl; rep(jj, 0, nn) { dataout << v[jj] << " "; }cout << endl;
dataout << nn << endl; rep(jj, 0, nn) { dataout << v[jj] << " "; }cout << endl;
}
dataout.close();
}
int n;
vector<int>v;
//暴力解法
int vsolve() {
cin >> n;
v.assign(n, 0);
rep(ii, 0, n) { cin >> v[ii]; }
return 0;
}
//正常解法
int nsolve() {
cin >> n;
v.assign(n, 0);
rep(ii, 0, n) { cin >> v[ii]; }
return 0;
}
void solve(int _) {
//cin >> _;
//_ = 1;
int index = 1;
while (_--) {
cout << nsolve() << endl;
cout << vsolve() << endl;
if (vsolve() != nsolve()) cout << index << endl;//输出不同的组数
index++;
}
}
signed main() {
IOS; srand((unsigned)time(NULL));
int group = 100;
int model = 1;
//model为0则创建数据 1则开始对比
if (!model)clapper(group);
else solve(group);
return 0;
}
Codeforces Round 201 (Div. 1) A. Alice and Bob
如果找不出问题再用。。。
标签:记录,int,rep,拍器,cin,ii,include,模板,define From: https://www.cnblogs.com/lulaalu/p/18289400