A8200 | Datatypes
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Tattah's youngest brother, Tuftuf, is new to programming.
Since his older brother is such a good programmer, his biggest dream is to outshine him. Tuftuf is a student at the German University in Cairo (GUC) where he learns to write programs in Gava.
Today, Tuftuf was introduced to Gava's unsigned integer datatypes. Gava has $n$ unsigned integer datatypes of sizes (in bits) $a_{1},a_{2},...\ a_{n}$ . The $i$ -th datatype have size $a_{i}$ bits, so it can represent every integer between $0$ and $2^{a_{i}}-1$ inclusive.
Tuftuf is thinking of learning a better programming language. If there exists an integer $x$ , such that $x$ fits in some type $i$ (in $a_{i}$ bits) and $x·x$ does not fit in some other type $j$ (in $a_{j}$ bits) where $a_{i}<a_{j}$ , then Tuftuf will stop using Gava.
Your task is to determine Tuftuf's destiny.
Since his older brother is such a good programmer, his biggest dream is to outshine him. Tuftuf is a student at the German University in Cairo (GUC) where he learns to write programs in Gava.
Today, Tuftuf was introduced to Gava's unsigned integer datatypes. Gava has $n$ unsigned integer datatypes of sizes (in bits) $a_{1},a_{2},...\ a_{n}$ . The $i$ -th datatype have size $a_{i}$ bits, so it can represent every integer between $0$ and $2^{a_{i}}-1$ inclusive.
Tuftuf is thinking of learning a better programming language. If there exists an integer $x$ , such that $x$ fits in some type $i$ (in $a_{i}$ bits) and $x·x$ does not fit in some other type $j$ (in $a_{j}$ bits) where $a_{i}<a_{j}$ , then Tuftuf will stop using Gava.
Your task is to determine Tuftuf's destiny.
输入格式
The first line contains integer $n$ ( $2<=n<=10^{5}$ ) — the number of Gava's unsigned integer datatypes' sizes. The second line contains a single-space-separated list of $n$ integers ( $1<=a_{i}<=10^{9}$ ) — sizes of datatypes in bits. Some datatypes may have equal sizes.
输出格式
Print "YES" if Tuftuf will stop using Gava, and "NO" otherwise.
输入输出样例
输入 #1
3 64 16 32
输出 #1
NO
输入 #2
4 4 2 1 3
输出 #2
YES
In the second example, $x=7$ $(111_{2})$ fits in $3$ bits, but $x^{2}=49$ $(110001_{2})$ does not fit in $4$ bits.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted