BC # 32 1002 题意:给出一个数组 a 和一个数 K ,问是否存在数对( i , j ),使 a i - a i + 1 +……+ (-1)j - i a j : 对于这道题,一开始就想到了是前缀和,但是如果只是记录下前缀和数组,那么查找就会成为一个大问题.补题的时候一开始考虑用 hash 数组或者是 set 存,但是很明显 TLE 了,在翔神的推荐下,我研究了一下 hash表的创建过程,惊奇地发现,其实就是建了一个 HashMap 结构体,而里面放了这个表所用的数组以及相应操作…
More is better Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 22283 Accepted Submission(s): 8106 Problem Description Mr Wang wants some boys to help him with a project. Because the project…
hash?判重,是否一样?相等?等式!没有想到,这次题做玩后,学到了HASH这一功能!当数据量在数组允许大小范围内时候即可!判断等式俩边是否相等,从而获得解的个数!从复杂度,n*m*k****,降到 2*....,本题从n^4,降到:2*n^2; #include<iostream> #include<cstring> using namespace std; int hash[2002000]; int main() { int a,b,c,d; while(cin>>…
Intelligent IME Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4287 Description We all use cell phone today. And we must be familiar with the intelligent English input method on the cell phone. To be specific,…
Big binary tree Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 597 Accepted Submission(s): 207 Problem Description You are given a complete binary tree with n nodes. The root node is numbere…
Dating with girls(1) Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2127 Accepted Submission(s): 730 Problem Description Everyone in the HDU knows that the number of boys is larger than the…
HDU Today Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 23854 Accepted Submission(s): 5743 Problem Description 经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强.这时候…
Gap Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 690 Accepted Submission(s): 380 Problem Description Let's play a card game called Gap. You have 28 cards labeled with two-digit numbers…