提供本题加强版
查看原帖
提供本题加强版
760291
zhangbo1000楼主2025/1/11 13:25

rt,本题数据太弱,把 O(nk)O(nk) 的 dp 放过去了,所以在此提供加强版(纯属我闲得慌):U523449。

10510^5 的数据范围卡 O(nk)O(nk) 还是太保守了,暴力卡一卡常数估计还是能过,所以加强到了 10610^6

数据出锅了请提醒我,这里也给下数据生成器:

//gen.cpp
#include<iostream>
#include<random>
#include<vector>
using namespace std;
int main(){
	cin.tie(0)->sync_with_stdio(0);
	int n,k,seed,v;
	cin>>n>>k>>seed>>v;
	cout<<n<<' '<<k<<'\n';
	mt19937 rng(n^k^seed);
	while(n--){
		cout<<rng()%v+1<<'\n';
	}
	return 0;
}
//data.cpp
#include<iostream>
using namespace std;
int main(){
	string s;
	system("cd C:\\Users\\Administrator\\Desktop\\新建文件夹 (2)");
	while(cin>>s){
		system(("gen.exe > fy"+s+".in").c_str());
		system(("std.exe > fy"+s+".out"+"< fy"+s+".in").c_str());
	}
	return 0;
}
//std.cpp
//为防止讨论区题解只给出通过记录:https://www.luogu.com.cn/record/197700778

2025/1/11 13:25
加载中...