12 2016 档案
摘要:P3371luoguDijkstra算法#include#include#include#include #include#includeint maxn=2147483647;int minn;using namespace std;struct H{ int to;//邻...
阅读全文
摘要:Floyd 最短路 (时间复杂度O(N^3),适用于出现负边权的情况,可以求任意两点间的最短路径)#include#include#include#include#include#include#include#include#define LL long long int a[1...
阅读全文
摘要:P3372#include #include#include#include#include#define MAXN 200000#define LL long longusing namespace std;struct H{ LL addi,sum,l,r,len;}st...
阅读全文
摘要:题见洛谷 一节课。。。#include#include#include#include#include#define MAXN 200000 using namespace std;int a0[MAXN+5],st[MAXN*4+5]; //四倍void build(int o,...
阅读全文
摘要:n个数,m次操作 若a==1,求区间b-c最大值 若a==2,将a[ b ]改为c#include#include#include#include#include#define MAXN 200000 using namespace std;int a[MAXN+5],st[MAX...
阅读全文
摘要:线段树模板//①建树 const int MAXM=50000; //定义 MAXM 为线段最大长度 int a[MAXM+5],st[(MAXM>1); // m 为中间点,左儿子结点为 [l,m] ,右儿子结点为 [m+1,r]; ...
阅读全文
摘要:洛谷P1049法一#include#include#include#include#include#define LL long longusing namespace std;LL f[20001];int a[100];int main(){ int n,m; sc...
阅读全文
摘要:题见洛谷#include#include#include#include#include#define LL long longusing namespace std;int a[200];LL f[10001];int main(){ int n,m; scanf("...
阅读全文
摘要:题见洛谷#include#include#include#include#include#includeusing namespace std;int f1[300][300],f2[300][300];//数组二倍 f1 . f2int s[300];int w[300];int...
阅读全文
摘要:#include#include#include#include#include#include#includeusing namespace std;int n,m;int v[9999],w[9999],s[9999];int f[9999];int main(){ sc...
阅读全文
摘要:主要是:将多重背包拆成01背包。#include#include#include#include#include#includeusing namespace std;int w[3000],c[3000],p[3000],f[3000];int main(){ //freo...
阅读全文
摘要:/* 题目描述 本题中,我们将用符号[c]表示对c向下取整,例如:[3.0」= [3.1」=[3.9」=3。 蛐蛐国最近蚯蚓成灾了!隔壁跳蚤国的跳蚤也拿蚯蚓们没办法,蛐蛐国王只好去请神刀手来帮他们消灭蚯蚓。 蛐蛐国里现在共有n只蚯蚓(n为正整数)。每只蚯蚓拥有长度,我们设第i只蚯...
阅读全文
摘要:#include#include#include#include#include#include#includeusing namespace std;int n,m;int w[999],c[999];int f[9999];int main(){ freopen("kna...
阅读全文
摘要:#include#include#include#include#include#include#includeusing namespace std;int n,m;int w[210],c[210]; int f[210];int main(){ freopen("pac...
阅读全文