自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(758)
  • 收藏
  • 关注

原创 hdu4267分组线段树

http://acm.hdu.edu.cn/showproblem.php?pid=4267Problem DescriptionLet A1, A2, ... , AN be N elements. You need to deal with two kinds of operations. One type of operation is to add a give

2015-03-21 09:30:10 933

原创 poj1189 简单dp

http://poj.org/problem?id=1189Description有一个三角形木板,竖直立放,上面钉着n(n+1)/2颗钉子,还有(n+1)个格子(当n=5时如图1)。每颗钉子和周围的钉子的距离都等于d,每个格子的宽度也都等于d,且除了最左端和最右端的格子外每个格子都正对着最下面一排钉子的间隙。 让一个直径略小于d的小球中心正对着最上面的钉子在板上自由滚落,小球

2015-03-20 11:03:18 843

原创 poj1664 dp记忆化搜索

http://poj.org/problem?id=1664Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3

2015-03-20 09:12:42 733

原创 CF 527C STL set和multiset 典型应用

http://codeforces.com/problemset/problem/527/CC. Glass Carvingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outp

2015-03-19 20:52:01 924

原创 CF 527B 思维题

http://codeforces.com/problemset/problem/527/BB. Error Correct Systemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstanda

2015-03-19 16:48:53 1812

原创 poj1742 多重背包的可行性问题

http://poj.org/problem?id=1742DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coi

2015-03-18 21:17:39 3533 1

原创 poj1191 分治思想,记忆化搜索

http://poj.org/problem?id=1191Description将一个8*8的棋盘进行如下分割:将原棋盘割下一块矩形棋盘并使剩下部分也是矩形,再将剩下的部分继续如此分割,这样割了(n-1)次后,连同最后剩下的矩形棋盘共有n块矩形棋盘。(每次切割都只能沿着棋盘格子的边进行) 原棋盘上每一格有一个分值,一块矩形棋盘的总分为其所含各格分值之和。现在需要把棋盘

2015-03-18 16:27:01 1917

原创 poj1179 区间dp(记忆化搜索写法)有巨坑!

http://poj.org/problem?id=1179DescriptionPolygon is a game for one player that starts on a polygon with N vertices, like the one in Figure 1, where N=4. Each vertex is labelled with an integer

2015-03-18 11:38:55 1572

原创 hdu5188 加限制的01背包问题

http://acm.hdu.edu.cn/showproblem.php?pid=5188Problem DescriptionAs one of the most powerful brushes in the world, zhx usually takes part in all kinds of contests.One day, zhx takes pa

2015-03-16 20:39:14 2246

原创 poj1178 floyd+枚举

http://poj.org/problem?id=1178DescriptionCenturies ago, King Arthur and the Knights of the Round Table used to meet every year on New Year's Day to celebrate their fellowship. In remembrance o

2015-03-16 16:29:51 1089

原创 hdu 5187 快速幂快速乘法

http://acm.hdu.edu.cn/showproblem.php?pid=5187Problem DescriptionAs one of the most powerful brushes, zhx is required to give his juniors n problems.zhx thinks the ith problem's difficul

2015-03-15 11:44:27 1282

原创 hdu1143 状态压缩dp 记忆化搜索写法

http://poj.org/problem?id=1143DescriptionChristine and Matt are playing an exciting game they just invented: the Number Game. The rules of this game are as follows. The players take turns ch

2015-03-14 10:07:19 877

原创 poj1083 思维题

http://poj.org/problem?id=1083DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms

2015-03-12 21:36:50 3545

原创 NEFUOJ 500 二分+最大流

http://acm.nefu.edu.cn/JudgeOnline/problemshow.php?problem_id=500description 在这个信息化的时代,网购成为了最流行的购物方式,比起在大街上,顶着烈日寻找需要的商品,大多数人更愿意坐在家里,点击下鼠标,来找到喜欢的商品,并完成购物。尽管网购还有很多安全问题,但是接受网购的

2015-03-12 20:20:11 1725 9

原创 hdu5183 hush

http://acm.hdu.edu.cn/showproblem.php?pid=5183Problem DescriptionWhen given an array (a0,a1,a2,⋯an−1) and an integer K, you are expected to judge whether there is a pair (i,j)(0≤i≤jn) wh

2015-03-11 22:49:51 1199

原创 zoj3460

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3460MissileTime Limit: 2 Seconds      Memory Limit: 65536 KBYou control N missile launching towers. Every tower has enough mi

2015-03-11 22:47:42 722

原创 hdu3829 二分图的最大独立集

http://acm.hdu.edu.cn/showproblem.php?pid=3829Cat VS DogTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 125536/65536 K (Java/Others)Total Submission(s): 2851    Accepted Submission(s

2015-03-10 20:40:34 943

原创 poj2771 二分图的最大独立集

http://poj.org/problem?id=2771DescriptionFrank N. Stein is a very conservative high-school teacher. He wants to take some of his students on an excursion, but he is afraid that some of them mi

2015-03-10 16:41:28 1269

原创 poj2195 二分图的最佳匹配

http://poj.org/problem?id=2195DescriptionOn a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to a

2015-03-10 09:47:33 696

原创 hdu1151 最小路径覆盖

http://acm.hdu.edu.cn/showproblem.php?pid=1151Problem DescriptionConsider a town where all the streets are one-way and each street leads from one intersection to another. It is also know

2015-03-09 20:42:36 1471

原创 hdu4751 二分图的判断

http://acm.hdu.edu.cn/showproblem.php?pid=4751Problem Description  This year is the 60th anniversary of NJUST, and to make the celebration more colorful, Tom200 is going to invite distin

2015-03-09 19:19:40 1203 3

原创 hdu1045 暴力搜索,用二分图也可以做

http://acm.hdu.edu.cn/showproblem.php?pid=1045Problem DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each r

2015-03-04 22:07:17 714

原创 hdu2444 二分图的匹配,先判断是否为二分图

http://acm.hdu.edu.cn/showproblem.php?pid=2444Problem DescriptionThere are a group of students. Some of them may know each other, while others don't. For example, A and B know each other, B

2015-03-04 10:26:46 1017

原创 hdu4612 连通性,求树的直径,加一边求最少桥

http://acm.hdu.edu.cn/showproblem.php?pid=4612Problem Description  N planets are connected by M bidirectional channels that allow instant transportation. It's always possible to travel b

2015-03-03 17:06:58 1677

原创 hdu4587 求割点变形

http://acm.hdu.edu.cn/showproblem.php?pid=4587Problem DescriptionSuppose that G is an undirected graph, and the value of stab is defined as follows:Among the expression,G-i, -j is the

2015-03-02 21:58:46 1045

原创 CF 295div2 B dp(记忆化搜索)

http://codeforces.com/contest/520/problem/BB. Two Buttonstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard

2015-03-02 18:53:05 1423

原创 hdu2460&&poj3694 缩点+lca变形

http://acm.hdu.edu.cn/showproblem.php?pid=2460http://poj.org/problem?id=3694Problem DescriptionA network administrator manages a large network. The network consists of N computers and M

2015-03-02 11:58:35 837

原创 LCA最近公共祖先 在线算法和离线算法 模板

原理讲解:http://dongxicheng.org/structure/lca-rmq/在线算法模板:/**LCA在线算法O(nlogn)主函数调用:init();tot=0,dir[1]=0;dfs(1,1);ST(2*n-1);int lca=LCA(u,v);*/#include #include #include #include #inclu

2015-03-01 17:23:53 1348

原创 hdu 2586 LCA模板题(离线和在线两种解法)

http://acm.hdu.edu.cn/showproblem.php?pid=2586Problem DescriptionThere are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this

2015-03-01 10:51:36 4455

原创 Uva 796 求桥

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=737/***Uva 796 求桥题目要求:输出题目中所有的桥,按其所连接的点从小到大的顺序输出解题思路:tarjan算法,所有树枝边都是桥(dfn[u]<low[v]),利用vector存储一下就可

2015-02-27 18:15:44 1370

原创 求无向图的割点和桥

/*** 求 无向图的割点和桥* 可以找出割点和桥,求删掉每个点后增加的连通块。* 需要注意重边的处理,可以先用矩阵存,再转邻接表,或者进行判重* 调用solve输出割点数,全局变量bridge记录边的个数*/#include #include #include #include using namespace std;const int maxn=10010;co

2015-02-27 10:27:45 2540

原创 Uva 315 求无向图的割点的个数

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=251A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting

2015-02-27 10:21:26 1159

原创 hdu 4635 强连通分量+缩点

http://acm.hdu.edu.cn/showproblem.php?pid=4635Problem DescriptionGive a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the gr

2015-02-26 17:51:59 1086

原创 spoj10606 数位dp (求出现的数字,所有偶数出现奇数次,所有奇数出现偶数次)

http://www.spoj.com/problems/BALNUM/SPOJ Problem Set (classical)10606. Balanced NumbersProblem code: BALNUMBalanced numbers have been used by mathematicians for centu

2015-02-24 11:41:10 1680

原创 hdu3709 数位dp(自身平衡的数字)

http://acm.hdu.edu.cn/showproblem.php?pid=3709Problem DescriptionA balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagi

2015-02-22 22:59:19 1091

原创 hdu3652 数位dp(含13且被能被13整除的数)

http://acm.hdu.edu.cn/showproblem.php?pid=3652B-numberTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2815    Accepted Submission(s):

2015-02-22 20:38:34 2105

原创 CF 55D 数位dp(一个数是组成它的所有位数对应数的倍数)

http://codeforces.com/problemset/problem/55/DD. Beautiful numberstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutput

2015-02-22 12:49:20 1487

原创 hdu 4352 数位dp(最长上升子序列的长度为k的个数)

http://acm.hdu.edu.cn/showproblem.php?pid=4352Problem Description#define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very im

2015-02-21 17:20:11 3485

原创 poj3252 数位dp(所有比n小的二进制位0的个数不少于1的个数)记忆化搜索

http://poj.org/problem?id=3252DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham,

2015-02-21 08:46:21 1583 4

原创 UESTC 250 数位dp(数字相位数之间的差值不小于2)

http://acm.uestc.edu.cn/#/problem/show/250windy定义了一种windy数。不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。windy想知道,在A和B之间,包括A和B,总共有多少个windy数?Input包含两个整数,A B。满足 1≤A≤B≤2000000000 .Output

2015-02-17 11:49:16 1266

空空如也

空空如也

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

TA关注的人

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