洛谷p3372 线段树模版
摘要:这里写链接内容#includeusing namespace std;int n,m;int a[230000];struct yuy{long long l,r,len,sum,add;}s[999999];void bu(int o,int l,int r){ s[o]....
阅读全文
SPFA模版
摘要:这里写链接内容 70分。。。 w,s,flag数组爆10000#includeusing namespace std;int dis[19999];int n;//int pre[19999];int v,u;int flag[19999];int du[19999];int w[...
阅读全文
线段树 洛谷 p1531 I hate it(I hate it too)
摘要:这里写链接内容 线段树模板 字符串是一个很诡异的问题。。。。#include#include#include#define q 200000using namespace std;int a[q+5],s[q>1); bu(o>1); if(inqr) return -...
阅读全文
01 背包找装满方案数 洛谷 p1164 小a点菜
摘要:#includeusing namespace std;int n,m;int f[9999];int a[9999];int main(){ scanf("%d%d",&n,&m); for(int i=1;i=a[i];j--) f[j]=f[j]+f[j-a...
阅读全文
01 找最大剩余体积 洛谷1049 装箱问题
摘要:#include#includeusing namespace std;int n,m;int f[20005];int a[99990];int main(){ scanf("%d%d",&m,&n); for(int i=1;i=a[i];j--) if(f[...
阅读全文
洛谷 p1880 石子合并 区间dp
摘要:这里写链接内容 错误程序#include#includeusing namespace std;int n;int a[9999];int s[9999],f1[999][999]; int f2[999][999];int main(){ scanf("%d",&n); ...
阅读全文
石子合并 最大值
摘要:#include#includeusing namespace std;int n;int a[9999];int s[9999],f[9999][999]; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) { ...
阅读全文
清北学堂入学测试d
摘要:清北学堂入学测试d 需要加回去啊啊啊啊啊啊!#include#includeusing namespace std;int n;int a[2000000];int min1=99999999;int t;int flag=1;int main(){ freopen("gfh...
阅读全文
二维费用的背包
摘要:#include#include#include#includeusing namespace std;int f[999][999];int m,n,k;int w[9999],c[9999],s[9999];int main(){ freopen("gas.in","r"...
阅读全文
2016 noip 蚯蚓(earthworm)模板
摘要:地址在这 这道题一开始我没有附初值,否则有负的情况。 longlong超时。。 数组开小 。。 最后虽然过了,但时间总是卡到1s,非常令人不解。 以后做题要仔细,不要忘记一些最基本的错误。 #include#include#include#include#include#inclu...
阅读全文
2016 noip day2蚯蚓总结
摘要:地址在这=>https://www.luogu.org/record/show?rid=1497670 这道题一开始我没有附初值,否则有负的情况。 longlong超时。。 数组开小 。。 最后虽然过了,但时间总是卡到1s,非常令人不解。 以后做题要仔细,不要忘记一些最基本的错误。
阅读全文