302371: CF457A. Golden System

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Golden System

题意翻译

### 完整题意 Piegirl 已经对二进制、十进制以及其他整数计数系统感到厌倦。最近她发现了关于数字 $q=\frac{\sqrt5+1}{2}$ 的一些有趣的性质,特别是当 $q^2=q+1$ 时,并且她认为这将为她的独特的新系统打下良好基础。她管这叫“黄金系统”。在黄金系统中,数字是包含 $0$ 与 $1$ 的非空字符串,表达式 $a_0a_1\dots a_n$ 的十进制值为 $\sum_{i=0}^{n}a_i\times q^{i-1}$。 很快她就发现这个系统不具有基础整数计数系统的性质,并且有些操作无法在这上面执行。她无法想出一种快速比较两个数的方法,于是来向你求助。 给出两个用黄金系统表示的数,比较哪个数更大。 ### 输入格式 输入由两行组成。每行为一个只包含 $0$ 和 $1$ 的字符串,每个字符串长度不超过 $10^5$。 ### 输出格式 输出只包含一个字符。如果第一个数更大,则输出 `>`,如果第二个数更大,则输出 `<`,如果两个数相等,则输出 `=`。

题目描述

Piegirl got bored with binary, decimal and other integer based counting systems. Recently she discovered some interesting properties about number ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF457A/e04244d382ea93b550aff5696be83d386eacec77.png), 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 ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF457A/449384fe17d05660f9b52e9552694bc33362eb89.png). 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 ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF457A/078333cd5261e1426dfa5ae21a657a73c4ca3007.png), 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 $ .

Input

题意翻译

### 完整题意 Piegirl 已经对二进制、十进制以及其他整数计数系统感到厌倦。最近她发现了关于数字 $q=\frac{\sqrt5+1}{2}$ 的一些有趣的性质,特别是当 $q^2=q+1$ 时,并且她认为这将为她的独特的新系统打下良好基础。她管这叫“黄金系统”。在黄金系统中,数字是包含 $0$ 与 $1$ 的非空字符串,表达式 $a_0a_1\dots a_n$ 的十进制值为 $\sum_{i=0}^{n}a_i\times q^{i-1}$。 很快她就发现这个系统不具有基础整数计数系统的性质,并且有些操作无法在这上面执行。她无法想出一种快速比较两个数的方法,于是来向你求助。 给出两个用黄金系统表示的数,比较哪个数更大。 ### 输入格式 输入由两行组成。每行为一个只包含 $0$ 和 $1$ 的字符串,每个字符串长度不超过 $10^5$。 ### 输出格式 输出只包含一个字符。如果第一个数更大,则输出 `>`,如果第二个数更大,则输出 `<`,如果两个数相等,则输出 `=`。

加入题单

算法标签: