![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
文章平均质量分 85
夜拾柒
In the future, there will be no retreat in horror.
展开
-
杭电acm 1009 FatMouse' Trade 比较典型的贪心问题
本题可以作为贪心问题的水题,我刚开始时,还掉以轻心,后第一遍wa后,我才发现这道题并不那么简单。首先,分析该题:输入后应先进行排序,按照j/f来进行排序。后再尽可能选取j/f比较大,直到m==0.但是,问题到这并没有结束,请你接下来试试这几组数据:0 11 01.0001 00.0005 410000 52000 2100 0300 010400.000原创 2015-08-02 22:32:07 · 554 阅读 · 0 评论 -
codeforce 582-A GCD Table
A. GCD Tabletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe GCD table G of size n × n for an array of positive integers a of length原创 2015-10-04 23:24:11 · 467 阅读 · 0 评论 -
南京理工大学校外赛sequence
Description将一个给定的数列,拆分成K个不降序列,每个数出现且只出现一次,且在各序列中各个数相对于原数列的相对顺序不变。如7 6 9 8 10可以拆成 7 9 10和6 8。求最小的K值。Input第一行输入一个整数T(1 每组两行,第一行为n,代表数列长度(1接下来一行有n个数,空格分隔(每个数Output对每组数据输出一个最小的K值。Sample原创 2016-04-18 19:36:04 · 464 阅读 · 0 评论