A9656 | Golden System
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Piegirl got bored with binary, decimal and other integer based counting systems. Recently she discovered some interesting properties about number , in particular that $q^{2}=q+1$ , and she thinks it would make a good base for her new unique system. She called it "golden system". In golden system the number is a non-empty string containing 0's and 1's as digits. The decimal value of expression $a_{0}a_{1}...a_{n}$ equals to .
Soon Piegirl found out that this system doesn't have same properties that integer base systems do and some operations can not be performed on it. She wasn't able to come up with a fast way of comparing two numbers. She is asking for your help.
Given two numbers written in golden system notation, determine which of them has larger decimal value.
Soon Piegirl found out that this system doesn't have same properties that integer base systems do and some operations can not be performed on it. She wasn't able to come up with a fast way of comparing two numbers. She is asking for your help.
Given two numbers written in golden system notation, determine which of them has larger decimal value.
输入格式
Input consists of two lines — one for each number. Each line contains non-empty string consisting of '0' and '1' characters. The length of each string does not exceed $100000$ .
输出格式
Print ">" if the first number is larger, "<" if it is smaller and "=" if they are equal.
输入输出样例
输入 #1
1000 111
输出 #1
<
输入 #2
00100 11
输出 #2
=
输入 #3
110 101
输出 #3
>
In the first example first number equals to , while second number is approximately $1.618033988^{2}+1.618033988+1≈5.236$ , which is clearly a bigger number.
In the second example numbers are equal. Each of them is $≈2.618$ .
In the second example numbers are equal. Each of them is $≈2.618$ .
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted