A + B Problem

查看题解 查看答案
题目描述
Time Limit: 1000 ms
Memory Limit: 256 mb

First of all, the topic is just to lie to you, the title is not the case.

Xiao Ming likes Xiaohong very much, so he often goes to Xiaohong to play. One day Xiaoming went to find Xiaohong playing a game.
The rules of the game are simple: Xiaohong has n boxes, each of which is b1, b2, b3.......bn
If there are two boxes x, y and x >= 2 * y, then we can put the y box in the x box,
A box that is placed inside a box can no longer be loaded with a box. Obviously, if a box is loaded, we can't see the box.
Xiaohong wants to know how many boxes can be seen at least.

输入输出格式
输入描述:
Enter n in the first line (1<= n <= 500000). Next n lines per line, a number bi (1 <= bi <= 100000) represents the size of the i-th box
输出描述:
Output an integer indicating the minimum number of boxes that can be seen
输入输出样例
输入样例#:
5
1
5
4
9
3
输出样例#:
复制
3
编辑器外观×
主题
字号 16px
背景
登录后免费刷此题

提交代码后在此处可查看状态