A11474 | Cloning Toys
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Imp likes his plush toy a lot.
Recently, he found a machine that can clone plush toys. Imp knows that if he applies the machine to an original toy, he additionally gets one more original toy and one copy, and if he applies the machine to a copied toy, he gets two additional copies.
Initially, Imp has only one original toy. He wants to know if it is possible to use machine to get exactly $x$ copied toys and $y$ original toys? He can't throw toys away, and he can't apply the machine to a copy if he doesn't currently have any copies.
Recently, he found a machine that can clone plush toys. Imp knows that if he applies the machine to an original toy, he additionally gets one more original toy and one copy, and if he applies the machine to a copied toy, he gets two additional copies.
Initially, Imp has only one original toy. He wants to know if it is possible to use machine to get exactly $x$ copied toys and $y$ original toys? He can't throw toys away, and he can't apply the machine to a copy if he doesn't currently have any copies.
输入格式
The only line contains two integers $x$ and $y$ ( $0<=x,y<=10^{9}$ ) — the number of copies and the number of original toys Imp wants to get (including the initial one).
输出格式
Print "Yes", if the desired configuration is possible, and "No" otherwise.
You can print each letter in arbitrary case (upper or lower).
You can print each letter in arbitrary case (upper or lower).
输入输出样例
输入 #1
6 3
输出 #1
Yes
输入 #2
4 2
输出 #2
No
输入 #3
1000 1001
输出 #3
Yes
In the first example, Imp has to apply the machine twice to original toys and then twice to copies.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted