请求添加 hack 数据
查看原帖
请求添加 hack 数据
792049
vegetable_chili楼主2024/11/12 20:06

hack 第 55 篇题解,能卡成 O(n2)\mathcal O(n ^ 2)

#include <bits/stdc++.h>
using namespace std;
int n = 69994, m = 7777, tot;
int get() {
	int rt = ++tot;
	for (int i = tot + 1; i <= tot + 3; i++) cout << i - 1 << ' ' << i << '\n';
	tot += 3;
	return rt;
}
int solve() {
	int rt = ++tot;
	int l = get();
	cout << rt << ' ' << l << '\n';
	int r = get();
	cout << rt << ' ' << r << '\n';
 	return rt;
}
int main() {
	freopen("hack_data.in", "w", stdout);
	cout << n << '\n';
	tot = 1;
	for (int i = 1; i <= m; i++) {
		int rt = solve();
		cout << 1 << ' ' << rt << '\n';
	}
}
2024/11/12 20:06
加载中...