博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Round #219 (Div. 1) A. Counting Kangaroos is Fun 【二分】
阅读量:5930 次
发布时间:2019-06-19

本文共 1898 字,大约阅读时间需要 6 分钟。

time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

There are n kangaroos with pockets. Each kangaroo has a size (integer number). A kangaroo can go into another kangaroo's pocket if and only if the size of kangaroo who hold the kangaroo is at least twice as large as the size of kangaroo who is held.

Each kangaroo can hold at most one kangaroo, and the kangaroo who is held by another kangaroo cannot hold any kangaroos.

The kangaroo who is held by another kangaroo cannot be visible from outside. Please, find a plan of holding kangaroos with the minimal number of kangaroos who is visible.

Input

The first line contains a single integer — n (1 ≤ n ≤ 5·105). Each of the next n lines contains an integer si — the size of the i-th kangaroo(1 ≤ si ≤ 105).

Output

Output a single integer — the optimal number of visible kangaroos.

Examples
input
825769842
output
5
input
891626583
output
5

转载于:https://www.cnblogs.com/cniwoq/p/6770911.html

你可能感兴趣的文章
Servlet作业2-将表单提交的商品信息输出到页面中
查看>>
札记:计算机网络篇:物理层
查看>>
jQuery操作cookie
查看>>
漫游Kafka设计篇之数据持久化
查看>>
致佳音: 推箱子游戏自己主动求解算法设计(四)
查看>>
2014-10深圳全球架构师峰会
查看>>
Oracle常用命令大全
查看>>
Linuxshell脚本之if条件判断
查看>>
【Linux&Unix--open/close/write/read系统调用】
查看>>
Windows Server 2008 R2 /2012 修改密码策略
查看>>
forword/ sendRediect
查看>>
SmaterWeatherApi---签名加密和数据訪问--简单粗暴一步搞定
查看>>
double保持精度,防止小数点后数字的丢失的小方法
查看>>
jmeter ---参数化
查看>>
xss绕过htmlspecialchars实体编码的姿势
查看>>
Linux学习笔记:系统启动引导过程
查看>>
由于删除DBF文件报错 —— ORA-01033: ORACLE initialization or shutdown in progress
查看>>
SQLAlchemy使用笔记--SQLAlchemy ORM(三)
查看>>
七拼八凑的读书感
查看>>
Option可选值可选值(二)
查看>>