题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4722
思路:数位dp,dp[i][j]表示到第i位,数字和%10为j,然后进行dp,注意完全匹配的情况是要+1,而其他情况是从0 到 9 都要考虑
代码:
#include
#include
#include
#include
using namespace std;
int t;
l...
分类:
其他好文 时间:
2014-05-07 04:55:37
阅读次数:
314
There are a lot of controversy about the definition of probability, so we just start with the uncontroversial parts. In general we can say that the probability is a value between 0 and 1 that
is int...
分类:
其他好文 时间:
2014-05-07 03:12:35
阅读次数:
224
点击打开链接
Dragon Balls
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2577 Accepted Submission(s): 993
Problem Description
Fi...
分类:
其他好文 时间:
2014-05-07 02:45:21
阅读次数:
345
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4631
Sad Love Story
Time Limit: 40000/20000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)
Total Submission(s): 1590 Accepted S...
分类:
其他好文 时间:
2014-05-07 02:40:43
阅读次数:
376
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4628
一道典型的状态压缩DP。。。也是想了好久又经过大神的提示才想出来的,马上要比赛了,然后又遇到点了情感方面的问题。。。真是作死的节奏。。。悲催的程序员命。。。不多说了,看题。。。
Pieces
Time Limit: 6000/3000 MS (Java/Others) ...
分类:
其他好文 时间:
2014-05-06 23:34:39
阅读次数:
466
此文意在整理二分图的各种变形。
HDU 1068 Girls and Boys
最基础的二分图匹配问题,简单的求最大匹配数。
HDU 1150 Machine Schedule
无向图 最小点集覆盖 = 最大匹配。
把作业看成边,把机器看成点。
无向图的最小点集覆盖是指存点集K,使得图中的所有边都与K中的某些点相连 ,且去除K任意一点就不再满足前述条件。
HD...
分类:
其他好文 时间:
2014-05-06 23:13:26
阅读次数:
348
题目:HDU 4720 :Naive and Silly Muggles
题目大意:这题的意思是给出三个点, 然后在给出另一个点,问这个点会不会在覆盖前面三个点的最小的圆里面(包括边界), 在里面最输出danger, 如果任何情况下这个点都不在圆里面,那么就输出safe。
解题思路:三个点最小的覆盖的圆是三角形的外接圆,这样的圆面积一定是最小的。 但是相同面积的圆,所在的位置,...
分类:
其他好文 时间:
2014-05-06 23:06:15
阅读次数:
382
Maximum Weight Difference
Chef has gone shopping with his 5-year old son. They have bought N items so far. The items are numbered from 1 to N, and the item i weighs Wi grams.
Chef's son insist...
分类:
其他好文 时间:
2014-05-06 22:59:49
阅读次数:
451
http://acm.hdu.edu.cn/showproblem.php?pid=1201
分析:
看到题目时,纠结了一会儿——出生那一年算不算一岁? 不算的。 1900.3-1901.3 才是一岁,是个时间间隔
(主要是因为这里是按生日来算年龄,而有些题是按年份来说而非生日,这两者还是有些区别)
1. 闰年判断
...
分类:
其他好文 时间:
2014-05-06 22:24:46
阅读次数:
278
题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=4135
Co-prime
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1176 Accepted Submis...
分类:
其他好文 时间:
2014-05-06 22:11:57
阅读次数:
407