
贪心
文章平均质量分 85
夜拾柒
In the future, there will be no retreat in horror.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
杭电acm 1009 FatMouse' Trade 比较典型的贪心问题
本题可以作为贪心问题的水题,我刚开始时,还掉以轻心,后第一遍wa后,我才发现这道题并不那么简单。 首先,分析该题:输入后应先进行排序,按照j/f来进行排序。后再尽可能选取j/f比较大,直到m==0. 但是,问题到这并没有结束,请你接下来试试这几组数据: 0 1 1 0 1.000 1 0 0.000 5 4 10000 5 2000 2 100 0 300 0 10400.000原创 2015-08-02 22:32:07 · 589 阅读 · 0 评论 -
codeforce 582-A GCD Table
A. GCD Table time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The GCD table G of size n × n for an array of positive integers a of length原创 2015-10-04 23:24:11 · 525 阅读 · 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 · 506 阅读 · 0 评论