HDUOJ
文章平均质量分 63
chAngE_AC
这个作者很懒,什么都没留下…
展开
-
[周赛] HDU-5056 Boring count
Problem Description You are given a string S consisting of lowercase letters, and your task is counting the number of substring that the number of each lowercase letter in the substring is no more th原创 2015-08-24 08:54:23 · 353 阅读 · 0 评论 -
BC - King's Order - 数位DP
题意:给你一个字符串的长度n在这个n长的字符串里不能出现连续超过3次的的字符。问符合该条件的字符串有几个。 思路: 一个比较暴力的dp方法: 开一个三维dp数组dp[串长度][添加字符前的最后一个字符][最后一个字符重复数] 这样我们对于每个长度枚举新添加的一个字符和倒数第二个,如果新加字符与倒数第二个字符相同我们对于每一个重复情况都向下递推累加。如果不同我们让dp[当前长度][最后一个字原创 2016-03-17 20:56:01 · 388 阅读 · 0 评论 -
HDU - 1506 Largest Rectangle in a Histogram
题意:给你n个木板的长度,且宽度都为1,让你找出最大的矩形区域面积 思路:这道题的关键就是算出每个可能的矩形的面积,而面积的计算方法可以是从一个板开始找出可向左延伸和向右延伸的边界,若左边界为L右边界为R,那么矩阵大小公式就是H[i]*(R-L+1),此时我们需要找到每个板可延伸到的边界。此时用两个数组L[i],R[i]来表示第i个板的左右延伸边界。计算边界的方法为 for(i原创 2015-10-29 21:24:28 · 285 阅读 · 0 评论 -
HDU - 2955 Robberies 01背包
简单说下背景,有个人要抢银行,对于每个银行有银行里存的钱数,以及抢了以后被抓住的概率,对于每组数据有一个可以被接受的最大被抓概率(我们称px),和要强的银行个数。首先开始我自己没有读懂题只是凑了一下数据发现可以是一个以概率为背包容量的01背包,然后将概率转化为了整数再用普通01背包装银行的钱数,然而无论乘多少倍将概率化整是无法真正实现的。所以正确的思路是以总共抢的钱数作为状态,对于每一个钱数存在一原创 2015-10-22 20:16:49 · 350 阅读 · 0 评论 -
BC - Untitled
Problem Description There is an integer a and n integers b1,…,bn. After selecting some numbers from b1,…,bn in any order, say c1,…,cr, we want to make sure that a mod c1 mod c2 mod… mod cr=原创 2015-08-03 08:02:11 · 439 阅读 · 0 评论 -
[周赛] HDU - 4970 Killing Monsters
Problem Description Kingdom Rush is a popular TD game, in which you should build some towers to protect your kingdom from monsters. And now another wave of monsters is coming and you need again to kn原创 2015-08-03 08:12:52 · 401 阅读 · 0 评论 -
HDU-2473 Junk-Mail Filter
Problem Description Recognizing junk mails is a tough task. The method used here consists of two steps: 1) Extract the common characteristics from the incoming email. 2) Use a filter matching the s原创 2015-08-17 09:58:15 · 261 阅读 · 0 评论 -
[多校]MZL's xor
Problem Description MZL loves xor very much.Now he gets an array A.The length of A is n.He wants to know the xor of all (Ai+Aj)(1≤i,j≤n) The xor of an array B is defined as B1 xor B2...xor Bn原创 2015-08-04 16:37:25 · 526 阅读 · 0 评论 -
[多校] The shortest problem
Problem Description In this problem, we should solve an interesting game. At first, we have an integer n, then we begin to make some funny change. We sum up every digit of the n, then insert it to原创 2015-08-11 18:51:23 · 491 阅读 · 0 评论 -
HDU 1054 Strategic Game
题意:给定一个图每一个点能够观察到相邻的所有点,问最少需要多少个顶点就能够覆盖整个图。 思路:最小顶点覆盖问题,很基础,直接建图求最大匹配然后/2得答案,二分图的最小顶点覆盖直接就是最大匹配数。 #include #include #include #include #include #include using namespace std; struct node {原创 2016-02-25 17:02:46 · 329 阅读 · 0 评论