rt,本题数据太弱,把 O(nk) 的 dp 放过去了,所以在此提供加强版(纯属我闲得慌):U523449。
105 的数据范围卡 O(nk) 还是太保守了,暴力卡一卡常数估计还是能过,所以加强到了 106。
数据出锅了请提醒我,这里也给下数据生成器:
#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;
}
#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;
}