常用模板
代码框架
#include <bits/stdc++.h>
using namespace std;
int main()
{
return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const int inf=0x3f3f3f3f;
const int mod=1e9+7;
const int N=100005;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
return 0;
}
文件读写
freopen("problem.in","r",stdin);
freopen("problem.out","w",stdout);
cout 格式
cout<<fixed<<setprecision(6)<<x<<'\n';
cout<<setw(6)<<x<<'\n';
刷新缓冲区
cout<<flush;
fflush(stdout);
cout.flush();
mt19937
random_device rd;
mt19937 gen(rd());
uniform_int_distribution<int> dist(1,100);
int k=dist(gen);