把一个字符串分成N个字符串 每个字符串长度为m Sample Input12 5 // n mklmbbileay Sample Outputklmbbileay # include <iostream> # include <cstdio> # include <cstring> # include <algorithm> # include <string> # include <cmath> # include <queu…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4816 2013长春区域赛的D题. 很简单的几何题,就是给了一条折线. 然后一个矩形窗去截取一部分,求最大面积. 现场跪在这题,最后时刻TLE到死,用的每一小段去三分,时间复杂度是O(n log n) , 感觉数据也不至于超时. 卧槽!!!!代码拷回来,今天在HDU一交,一模一样的代码AC了,加输入外挂6s多,不加也8s多,都可AC,呵呵·····(估计HDU时限放宽了!!!) 现场赛卡三分太SXBK…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4821 字符串题. 现场使用字符串HASH乱搞的. 枚举开头! #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <queue> #include <map> #include <set> #inclu…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814 进制转换. 现场根据题目给的两个公式,不断更新!!! 胡搞就可以了. 现场3A,我艹,一次循环开大TLE,一次开小WA,太逗了,呵呵 现场源码: #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <queue> #in…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815 简单的DP题. #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <queue> #include <map> #include <set> #include <vector> #i…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4815 [题意] n个题目,每题有各自的分数,A有50%的概率答对一道题目得到相应分数,B想要在至少P的概率上总分不低于A,问B至少要得到多少分. [分析] 最简单粗暴的做法是算出每个可能得到的总分的概率,原问题可以转化成在概率和<=P下A所有可能得到的总分集合中最大分数的最小值为多少,于是答案就是按分数排序后前k项的概率和刚好>=P. 但是计算所有可能的概率的复杂度是O(2n),不能满足我们的需求.细…
Stone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 179    Accepted Submission(s): 137 Problem Description Tang and Jiang are good friends. To decide whose treat it is for dinner, they are pla…
Cut the Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 300    Accepted Submission(s): 135 Problem Description MMM got a big big big cake, and invited all her M friends to eat the cake toge…
Poker Shuffle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 95    Accepted Submission(s): 24 Problem Description Jason is not only an ACMer, but also a poker nerd. He is able to do a perfect s…
Flyer Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 386    Accepted Submission(s): 127 Problem Description The new semester begins! Different kinds of student societies are all trying to adver…