正文
增加 67 行删除 4 行
4 行未改动567891011121330 行未改动4445464748495051525354555657585951 行未改动1111121131141151161171181,324 行未改动全部展开4 行未改动~~非全部原创(可能也没有原创)~~~~别问为什么zsyun_Cg这么懒~~目前28模板,持续更新中,可借走模板,但不许说是自己的## 模板集::::success[代码框架]30 行未改动else f=bool(fin);return 1;}//控制debug,1为输出,0为不输出template<typename T>void debug(T *a){if(ctrl_debug(3)){cout<<"debug: "<<*a<<'\n';//↓本地不报错,评测机报错//system("pause");}return;}//输出给定地址所存储的值(使用:debug(&a);)int main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);//freopen(".in","r",stdin);//freopen(".out","w",stdout);51 行未改动:::::::::::success[背包DP]:::success[01背包]1,324 行未改动全部展开4 行未改动567891011121330 行未改动4445464748495051525354555657585951 行未改动1111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811,324 行未改动全部展开4 行未改动~~非全部原创(可能也没有原创)~~~~别问为什么zsyun_Cg这么懒~~目前29模板,持续更新中,可借走模板,但不许说是自己的## 模板集::::success[代码框架]30 行未改动else f=bool(fin);return 1;}//控制debug,1为输出,0为不输出template<typename T>void debug(T a){if(ctrl_debug(3)){cout<<"debug: "<<a<<'\n';//↓本地不报错,评测机报错//system("pause");}return;}int main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);//freopen(".in","r",stdin);//freopen(".out","w",stdout);51 行未改动:::::::::::success[对拍]:::success[随机数生成器]```cpp#include<bits/stdc++.h>#define ll long longusing namespace std;const int N=1e6+10,M=1e3+10;int main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);//freopen(".in","r",stdin);//freopen(".out","w",stdout);srand(time(0));cout<<rand()%100<<" "<<rand()%100<<"\n";//输出两个100以内的随机数return 0;}```* 先在前面调用`srand(time(0));`* 然后用`rand()%n`生成随机数,n-1为最大值::::::success[对拍器]```cpp#include<bits/stdc++.h>#define ll long longusing namespace std;const int N=1e6+10,M=1e3+10;int main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);//freopen(".in","r",stdin);//freopen(".out","w",stdout);ll t=0;while(1){cout<<"test: "<<t++<<"\n";system("随机数生成器.exe > data.in");system("暴力代码.exe < data.in > std.out");system("待测代码.exe < data.in > ab.out");if(system("fc std.out ab.out > diff.log")){cout<<"WA\n";break;}cout<<"AC\n";}return 0;}```* 代码中所有 `.exe`均为`.cpp`文件编译产生的可执行文件* 四个`.cpp`须在同一目录下* 运行对拍器会生成4个文件,两`.out`文件为两个程序的输出,`.in`为本组随机样例,`diff`文件为两个`.out`的集合:::[例示](https://www.luogu.com.cn/problem/U746695)::::::::success[背包DP]:::success[01背包]1,324 行未改动全部展开