HDU 3363 Ice-sugar Gourd (贪心)】的更多相关文章

hdu 4825 Xor Sum(trie+贪心) 刚刚补了前天的CF的D题再做这题感觉轻松了许多.简直一个模子啊...跑树上异或x最大值.贪心地让某位的值与x对应位的值不同即可. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #define CLR(a,b) memset((a),(b),sizeof(…
题意:给你一个串,串中有H跟T两种字符,然后切任意刀,使得能把H跟T各自分为原来的一半. 析:由于只有两个字母,那么只要可以分成两份,那么一定有一段是连续的. 代码如下: #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include <iostream> #include <cstring> #include <set> #…
Ice-sugar Gourd Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1490    Accepted Submission(s): 470 Problem Description Ice-sugar gourd, "bing tang hu lu", is a popular snack in Beijing of…
Elegant Construction 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5813 Description Being an ACMer requires knowledge in many fields, because problems in this contest may use physics, biology, and even musicology as background. And now in this prob…
Windows 10 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5802 Description Long long ago, there was an old monk living on the top of a mountain. Recently, our old monk found the operating system of his computer was updating to windows 10 automatical…
Reorder the Books Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5500 Description dxy家收藏了一套书,这套书叫<SDOI故事集>,<SDOI故事集>有n(n≤19)n(n\leq 19)n(n≤19)本,每本书有一个编号,从111号到nnn号. dxy把这些书按编号从小到大,从上往下摞成一摞.dxy对这套书极其重视,不允许…
Four Operations Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22    Accepted Submission(s): 12 Problem Description Little Ruins is a studious boy, recently he learned the four operations!Now h…
题目链接:pid=3697" target="_blank">http://acm.hdu.edu.cn/showproblem.php?pid=3697 Problem Description     A new Semester is coming and students are troubling for selecting courses. Students select their course on the web course system. There…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5281 贪心题目,但是看看我的博客里边相关贪心的题解实在是少的可怜,这里就写出来供大家一起探讨. 题意还是比较好理解的,这里有一个小小的坑点:枪的数量,和怪物的数量,不一定是相等的,所以我们这里要特殊处理一下. reverse函数:http://blog.sina.com.cn/s/blog_6d79d83a0100wh95.html #include <stdio.h> #include <…
第一题;http://acm.hdu.edu.cn/showproblem.php?pid=1257 贪心与dp傻傻分不清楚,把每一个系统的最小值存起来比较 #include<cstdio> using namespace std; ],b[]; int main() { int n,i,j; while (~scanf("%d",&n)) { ; b[]=-; ;i<n;i++) { scanf("%d",&a[i]); ;j&l…