自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

chen20000804的博客

把博客搬到博客园了,http://www.cnblogs.com/chen20000804/

  • 博客(26)
  • 收藏
  • 关注

原创 poj 2774

传送门:http://poj.org/problem?id=2774 裸的后缀数组,我只是为了贴个版而已 代码#include <cstdio>#include <cmath>#include <iostream>#include <cstring>#include <algorithm>#define ll long long#define mod 1000000007usi

2016-10-16 21:16:25 268

转载 常用算法和数据结构的复杂度速查表

常用算法和数据结构的复杂度速查表,转自:http://blog.csdn.net/qq_33583069/article/details/52808381搜索算法数据结构时间复杂度空间复杂度  平均最差最差深度优先搜索 (DFS)Graph of |V| vertices and |E| edges

2016-10-14 15:23:25 793

原创 scoi 2008 && bzoj 1076 奖励关

传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3223 思路:15?好,状压,OK. 这是转移方程 if((s[k]&j)==s[k]) f[i][j]+=max(f[i+1][j],f[i+1][j|1<<(k-1)]+a[k]); else f[i][j]+=f[i+1][j]; 代码#include <cstdio>

2016-10-03 21:26:09 269

原创 bzoj 1079 着色方案

题目: 有n个木块排成一行,从左到右依次编号为1~n。你有k种颜色的油漆,其 中第i 种颜色的油漆足够涂ci 个木块。所有油漆刚好足够涂满所有木块,即c1+c2+…+ck=n。相邻两个木块涂相同色显得很难看,所以你希望统计任意两个相邻木块颜色不同的着色方案。 输入输出格式 输入格式: 第一行为一个正整数k,第二行包含k个整数c1, c2, … , ck。 输出格式: 输出一个整数,即方

2016-10-03 19:58:26 379

原创 2016 UESTC Training for Dynamic Programming(1)

A 柱爷与咸鱼神功 裸的背包,蛤蛤蛤#include <cstdio>#include <cmath>#include <iostream>#include <cstring>#include <algorithm>using namespace std;int f[5005][5005],n,m,t[5005],v[5005],lala;int main(){ scanf

2016-09-19 21:44:41 260

原创 2016 UESTC Training for Data Structures(3)

J 郭大侠与Rabi-Ribi 超级水题 按时间排个序在扫一道OK#include<queue>#include<iostream>#include<algorithm>#include<cstdio>using namespace std; int ans,heat,n;priority_queue<int>q;struct s {int a;int b;}f[100

2016-09-19 21:23:31 219

原创 2016 UESTC Training for Data Structures(2)

F题 没做,大概是一道二维扫描线的题,代码很长并不想打了 G题 郭大侠与阴阳家 好像是排个序强行扫一道就判断出来了,我记得也不是太清楚.#include <cstdio>#include <cmath>#include <iostream>#include <cstring>#include <algorithm>#define eps 1e-9using namespace std;

2016-09-19 21:05:59 198

原创 2016 UESTC Training for Data Structures (1)

用了1mol多时间+借鉴(chao)了1mol多题解后终于差不多a完了(话说直接把题目copy过来让我们做真的好?) A 线段树模板 不用多说了吧#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#include<queue>#include<stack>#define lson rt<<1,l,

2016-09-19 20:49:58 218

原创 Uva 315

传送门:https://uva.onlinejudge.org/external/3/315.pdf tarjan模板题 其实我才不会告诉你这是我来骗访问量的呢. 代码#include <cstdio> #include <cstring> #include <iostream> using namespace std; int map[105][105],low[10

2016-09-13 21:01:40 245

原创 poj 1626

传送门:http://poj.org/problem?id=1636 题意:有两个监狱,每个监狱有n个人,有m种关系,表示A监狱第i个人不能跟B监狱第j个人在一个监狱,问你最多能换几组人(从A,B监狱互换一个人,ans<=n/2) 方法:首先这是一个很明显的二分图,我们可以很轻松的建边,但交换一次要把所有与这两个人有关的情况都遍历一遍.dp[i][j]表示从A监狱换i个人再从B监狱换j个人是否可

2016-09-03 11:34:36 340

原创 poj 1692

传送门:http://poj.org/problem?id=1692 题意:给你两行数,问你最大匹配数是多少. 限制条件:1.数字相同 2.匹配之间只能交叉一次,且数字不同. 思路:dp f[i][j]表示用a用前i个数,b用前j个数的值 (待填坑) 代码:#include <cstdio>#include <cmath>#include <iostream>#include <

2016-09-02 21:54:34 580

原创 梦想?初心?

我曾不止一次的问过自己为什么要走向这条oi之路.也许是初中的普及组一等给的我迷之信心.也许是自己的喜好,但无论如何,我的确想要走下去.这次noip如果拿不到一等奖,那么这条路就会走向终结,但我不甘心,真的很不甘心,班主任看见我都认为我是班上的毒瘤,我是强行留在这个班的,我没有这个实力.我真的好不开心,我真的想拿一个牌,然后告诉他,我不是他觉得的废物,我是有实力的.noip之前,我会

2016-08-31 21:06:48 360

原创 poj 1722

题意:有一个数组,每次可以把a[i]和a[i+1]合并起来,结果为a[i]-a[i+1],问你操作顺序,是最后一个数为他给定的那个数. 解法:背包(未完,待补充) 代码#include <cstdio>#include <cmath>#include <iostream>#include <cstring>#include <algorithm>#define ll long long

2016-08-31 21:04:46 507

原创 线段树小结

今天练了一天的线段树的(水)题,在此做一些总结. A hdu1754 I Hate It 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1754 单点更新+区间查询#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#include<queue>#in

2016-07-28 17:25:22 191

原创 hdu 4027(线段树区间开方求和)

本来很早就做了这道题的,但是今天突然发现了. 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4027 解法:首先这道题的数据就告诉我们只能用线段树,但区间操作似乎很蛋疼,我当时想的是用lazy标记记录这段区间要开方几次,等query时在统一进行单点更新,然后…….我就T了,如果update一次query一次,我的lazy标记便并卵了,所以我们需要想更

2016-07-27 15:35:02 1757 3

原创 bzoj 1208

第三道splay的裸题了,然而我还是调了一上午…… 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1208#include <cstdio>#include <cmath>#include <iostream>#include <cstring>#include <algorithm>using namespace std;in

2016-07-27 15:11:18 291

原创 bzoj3223 文艺平衡树

传送门 :http://www.lydsy.com/JudgeOnline/problem.php?id=3223 splay区间翻转的基础题,然而我还是调了一晚上(蒟蒻的悲哀)#include <cstdio>#include <cmath>#include <iostream>#include <cstring>#include <algorithm>using namespace

2016-07-26 21:29:18 388

原创 codeforces 671B

B. Robin Hood time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output We all know the impressive story of Robin Hood. Robin Hood uses his archery s

2016-07-26 10:14:53 347

原创 HDU 2896 &HDU 3065

两道题调好久才调出来,最后发现3065是多组数据,(早知道就看discuss了) 题目:http://acm.hdu.edu.cn/showproblem.php?pid=2896 http://acm.hdu.edu.cn/showproblem.php?pid=30653065#include <cstdio>#include <cmath>#include <iostream>#in

2016-07-24 15:53:31 208

原创 codeforces 670D2

D2. Magic Powder - 2 time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output The term of this problem is the same as the previous one, the only exc

2016-07-20 21:05:59 331

原创 poj 2456

Aggressive cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10878 Accepted: 5363 DescriptionFarmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The s

2016-07-20 20:52:32 321

原创 codeforces 677D

强行暴力水过……二维线段树真的长,我实在是不想写了.暴力1k左右,而二维线段树5k…… 题目大意 一个N*M的网格图,每个格子有一把钥匙,上面一个权值 要求从 1到 P按顺序收集钥匙,保证 P只有一把 问收集全部钥匙的最短距离是多少 做法1:大概就是维护用纵列维护一个dis,用横列维护一个dp,用vis维护他得到的钥匙的序号,有才更新,感觉很巧妙. 状态转移方程 位置(r,c),更

2016-07-18 20:50:31 369

原创 hdu2222 ac自动机裸题

前几天讲了ac自动机,今天才a了第一道模板题.(o(╯□╰)o),我还是太弱了(毕竟蒟蒻). 问题难度很小,我注释的很详细了,应该能懂吧#include <cstdio>#include <cmath>#include <iostream>#include <cstring>#include <algorithm>using namespace std;int t,tou,tail,n

2016-07-18 16:54:14 316

原创 hdu1251 trie树

本来前几天就讲了的,结果那天走神了,今天才把模板打出来(o(╯□╰)o),顺便学了下指针(虽然还是不怎么懂).#include <stdio.h>#include <string,h>#include <stdlib.h>typedef struct trie { int ci; //次数 struct trie *net[26];//指针 }*trienode,Trie

2016-07-18 11:35:37 231

原创 bzoj 3224 普通平衡树

算是平衡树最好的入门模板题了,几乎涵盖了平衡树所有的基础操作. 当然也可以用vector强行乱搞(毕竟暴力出奇迹).splay#include<cstdio>#define N 200005using namespace std;int son[N][3],num[N][3],f[N],a[N];int opt,n,i,root,x,node,ans,flag;inline void R

2016-07-17 17:41:05 295

原创 scoi2010

【题目描述】 lxhgww最近收到了一个01序列,序列里面包含了n个数,这些数要么是0,要么是1,现在对于这个序列有五种变换操作和询问操作: 0 a b 把[a, b]区间内的所有数全变成0 1 a b 把[a, b]区间内的所有数全变成1 2 a b 把[a,b]区间内的所有数全部取反,也就是说把所有的0变成1,把所有的1变成0 3 a b 询问[a, b]区间内总共有多少个1 4 a

2016-04-12 21:33:49 514

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除