Fork me on GitHub
上一页 1 ··· 20 21 22 23 24
摘要: 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... 阅读全文
posted @ 2016-12-23 15:53 primes 阅读(223) 评论(0) 推荐(0)
摘要: 线段树模板//①建树 const int MAXM=50000; //定义 MAXM 为线段最大长度 int a[MAXM+5],st[(MAXM>1); // m 为中间点,左儿子结点为 [l,m] ,右儿子结点为 [m+1,r]; ... 阅读全文
posted @ 2016-12-23 14:40 primes 阅读(113) 评论(0) 推荐(0)
摘要: 洛谷P1049法一#include#include#include#include#include#define LL long longusing namespace std;LL f[20001];int a[100];int main(){ int n,m; sc... 阅读全文
posted @ 2016-12-21 15:59 primes 阅读(188) 评论(0) 推荐(0)
摘要: 题见洛谷#include#include#include#include#include#define LL long longusing namespace std;int a[200];LL f[10001];int main(){ int n,m; scanf("... 阅读全文
posted @ 2016-12-21 15:09 primes 阅读(209) 评论(0) 推荐(0)
摘要: 题见洛谷#include#include#include#include#include#includeusing namespace std;int f1[300][300],f2[300][300];//数组二倍 f1 . f2int s[300];int w[300];int... 阅读全文
posted @ 2016-12-21 14:14 primes 阅读(467) 评论(0) 推荐(0)
摘要: #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... 阅读全文
posted @ 2016-12-14 16:05 primes 阅读(140) 评论(0) 推荐(0)
摘要: 主要是:将多重背包拆成01背包。#include#include#include#include#include#includeusing namespace std;int w[3000],c[3000],p[3000],f[3000];int main(){ //freo... 阅读全文
posted @ 2016-12-14 15:58 primes 阅读(126) 评论(0) 推荐(0)
摘要: /* 题目描述 本题中,我们将用符号[c]表示对c向下取整,例如:[3.0」= [3.1」=[3.9」=3。 蛐蛐国最近蚯蚓成灾了!隔壁跳蚤国的跳蚤也拿蚯蚓们没办法,蛐蛐国王只好去请神刀手来帮他们消灭蚯蚓。 蛐蛐国里现在共有n只蚯蚓(n为正整数)。每只蚯蚓拥有长度,我们设第i只蚯... 阅读全文
posted @ 2016-12-11 07:58 primes 阅读(208) 评论(0) 推荐(0)
摘要: #include#include#include#include#include#include#includeusing namespace std;int n,m;int w[999],c[999];int f[9999];int main(){ freopen("kna... 阅读全文
posted @ 2016-12-04 10:57 primes 阅读(85) 评论(0) 推荐(0)
摘要: #include#include#include#include#include#include#includeusing namespace std;int n,m;int w[210],c[210]; int f[210];int main(){ freopen("pac... 阅读全文
posted @ 2016-12-04 10:16 primes 阅读(83) 评论(0) 推荐(0)
上一页 1 ··· 20 21 22 23 24