贪心(7.31)
qq_39479426
井底之蛙
展开
-
CSU1588
现在有n堆果子,第i堆有ai个果子。现在要把这些果子合并成一堆,每次合并的代价是两堆果子的总果子数。求合并所有果子的最小代价。 Input 第一行包含一个整数T(T<=50),表示数据组数。 每组数据第一行包含一个整数n(2<=n<=1000),表示果子的堆数。 第二行包含n个正整数ai(ai<=100),表示每堆果子的果子数。 Output 每组数据仅...原创 2018-07-31 23:28:29 · 95 阅读 · 0 评论 -
HDU1789
Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after th...原创 2018-07-31 23:31:56 · 181 阅读 · 0 评论 -
UVA11572
题目:https://vjudge.net/problem/UVA-11572 题目大意:找到一段最长的不重复的序列 思路:设置两个下标l和r,l指向序列最左边的位置,r指向序列最右边的位置,同时用map保存雪花的下标值,如果发现重复出现的雪花,更新最长序列的值,然后更新l,l=max(l,该雪花所在位置+1) #include<cstdio> #include<s...原创 2018-07-31 23:35:10 · 143 阅读 · 0 评论 -
POJ1328
Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on the ...原创 2018-07-31 23:38:21 · 1658 阅读 · 2 评论 -
POJ1521
An entropy encoder is a data encoding method that achieves lossless data compression by encoding a message with "wasted" or "extra" information removed. In other words, entropy encoding removes inform...原创 2018-07-31 23:42:01 · 985 阅读 · 0 评论 -
POJ3122
My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of ...原创 2018-07-31 23:44:46 · 160 阅读 · 0 评论 -
HDU1735
一天,淘气的Tom不小心将水泼到了他哥哥Jerry刚完成的作文上。原本崭新的作文纸顿时变得皱巴巴的,更糟糕的是由于水的关系,许多字都看不清了。可怜的Tom知道他闯下大祸了,等Jerry回来一定少不了一顿修理。现在Tom只想知道Jerry的作文被“破坏”了多少。 Jerry用方格纸来写作文,每行有L个格子。(图1显示的是L = 10时的一篇作文,’X’表示该格有字,该文有三个段落)。 图1 ...原创 2018-07-31 23:48:43 · 375 阅读 · 0 评论