hack
查看原帖
hack
369399
yizhiming楼主2023/3/15 08:52

六篇题解杀了三篇

分别这几篇:

1

3

4

第二个是 T,其他俩是 Re 本来想卡 n2n^2 建边卡 T 网络流的,结果唯一一个空间足够大的网络流题解在 n2n^2 建边的前提下跑得飞快(虽说是 n2n^2,但是带了一个非常小的常数)

放上数据生成器:

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
using namespace std;
int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int main(){
	freopen("awa.txt","w",stdout);
	int n = read();
	cout<<n<<"\n";
	for(int i=1;i<=n;i++){
		if(i&1){
			cout<<i<<" "<<n-i<<"\n";
		}else{
			cout<<i<<" "<<2*n-i<<"\n";
		}
	}

	return 0;
}

所以说这道题有没有复杂度上界也保证正确的网络流做法啊。。。

2023/3/15 08:52
加载中...