![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
文章平均质量分 80
Algobird
这个作者很懒,什么都没留下…
展开
-
codeforces #508B# Anton and currency you all know(贪心)
B. Anton and currency you all know time limit per test 0.5 seconds memory limit per test 256 megabytes input standard input output standard output Berland, 2016. The exc原创 2015-01-28 11:44:51 · 961 阅读 · 0 评论 -
codeforces #492B# Vanya and Lanterns(贪心)
B. Vanya and Lanterns time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya walks late at night along a stra原创 2015-01-02 20:05:29 · 1226 阅读 · 0 评论 -
POJ 2718 Smallest Difference(DFS或者贪心)
题目链接:http://poj.org/problem?id=2718 就是求给n个数字,n小于10,然后问组成两个数差值最小是多少,可以用dfs,但是做的时候想到贪心,但是偶数的情况我没有想到特别好的贪心方法。 奇数个:排序,如果第一个为0,和第二个交换,然后取前n/2+1个组成数,后n/2个逆序组成数,相减就可以了。 偶数个:两个的时候特判,然后取差值最小的两个且都不为0的数,大原创 2015-06-23 20:21:47 · 808 阅读 · 0 评论