A - High School: Become Human
Problem description
Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But androids have to go to school to be able to solve creative tasks. Just like humans before.
It turns out that high school struggles are not gone. If someone is not like others, he is bullied. Vasya-8800 is an economy-class android which is produced by a little-known company. His design is not perfect, his characteristics also could be better. So he is bullied by other androids.
One of the popular pranks on Vasya is to force him to compare xy with yx. Other androids can do it in milliseconds while Vasya's memory is too small to store such big numbers.
Please help Vasya! Write a fast program to compare xywith yx for Vasya, maybe then other androids will respect him.
Input
On the only line of input there are two integers x and y (1≤x,y≤109,1≤x,y≤109).
Output
If xy<yx, then print '<' (without quotes). If xy>yx, then print '>' (without quotes). If xy=yx, then print '=' (without quotes).
Examples
Input
5 8
Output
>
Input
10 3
Output
<
Input
6 6
Output
=
Note
In the first example 58=5⋅5⋅5⋅5⋅5⋅5⋅5⋅5=390625, and 85=8⋅8⋅8⋅8⋅8=32768. So you should print '>'.
In the second example 103=1000<310=59049.
In the third example 66=46656=66.
解题思路:由于题目给的数据较大,因此要将指数运算转换成对数运算。注意:通常采用作差法来比较两个小数的大小,如果两数之差的绝对值小于或等于一个非常小的精度值eps(如1e-8或着1e-9),一般默认它们是相等的。
AC代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
double x,y,m,n;
cin>>x>>y;
m=y*log10(x);
n=x*log10(y);
if(abs(m-n)<=1e-)cout<<'='<<endl;//必须特判一下两个小数是否相等
else if(m>n)cout<<'>'<<endl;
else cout<<'<'<<endl;
return ;
}
A - High School: Become Human的更多相关文章
- Human and AI's future (reverie)
However, I do notice that to make the dark situation happen, it doesn't require the topleft matrix t ...
- Human Gene Functions
Human Gene Functions Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18053 Accepted: 1004 ...
- PacBio & BioNano (Assembly and diploid architecture of an individual human genome via single-molecule technologies)
Assembly and diploid architecture of an individual human genome via single-molecule technologies 文章链 ...
- POJ 1080 Human Gene Functions -- 动态规划(最长公共子序列)
题目地址:http://poj.org/problem?id=1080 Description It is well known that a human gene can be considered ...
- APP-PER-50022: Oracle Human Resources could not retrieve a value for the User Type profile option.
Symptoms ----------------------- AP > Setup > Organizations Show Error tips: APP-PER-50022: Or ...
- Unity3d 屏幕空间人体皮肤知觉渲染&次表面散射Screen-Space Perceptual Rendering & Subsurface Scattering of Human Skin
之前的人皮渲染相关 前篇1:unity3d Human skin real time rendering 真实模拟人皮实时渲染 前篇2:unity3d Human skin real time ren ...
- 【译】iOS人性化界面指南(iOS Human Interface Guidelines)(一)
1. 引言1.1 译者自述 我是一个表达能力一般的开发员,不管是书面表达,还是语言表达.在很早以前其实就有通过写博客锻炼这方面能力的想法,但水平有限实在没有什么拿得出手的东西分享.自2015年7月以来 ...
- [文学阅读] METEOR: An Automatic Metric for MT Evaluation with Improved Correlation with Human Judgments
METEOR: An Automatic Metric for MT Evaluation with Improved Correlation with Human Judgments Satanje ...
- 杭电20题 Human Gene Functions
Problem Description It is well known that a human gene can be considered as a sequence, consisting o ...
- 怎么看iOS human interface guidelines中的user control原则
最近离开了老东家,整理整理思路,因为一直做的是微信公众号相关的产品对app的东西有一段时间没有做过了,所以又看了一遍iOS human interface guidelines,看到user cont ...
随机推荐
- loader__demo_css
环境 node + yarn + webpack4.0 + webpack-cli + style-loader css-loader 文件结构 │ package.json │ webpack.co ...
- C#基础速学
原文地址 https://www.cnblogs.com/younShieh/p/10945264.html 前几天在刷即刻的时候发现了一个GitHub上的项目,该项目名为“learn x i ...
- Codeforces Round #417 (Div. 2)——ABCE
题目链接 题面有点长需耐心读题. A.一个人行道上的人被撞有4种情况 1.所在车道有车驶出 2.右边车道有左转车 3.左边车道有右转车 4.对面车道有直行车 #include <bits/std ...
- spring配置Converter、Formatter日期转换器
最近有点恶补spring的嫌疑,然后学了一点知识点纪录在此. 往往在项目中我们会遇到前端页面输入一个日期类型的字符串传递到后端后我们需要去做转换.甚至在传递的过程中就会报错. Spring有一个一劳永 ...
- Django获取当前页面的URL——小记
获取带参数URL:request.get_all_path() 获取不带参数URL:request.path 获取主机地址:request.get_host()
- 【学QT】 3 - DEBUG集子
1. [root@localhost helloqt]# make g++ -Wl,-rpath,/usr/local/qt/lib -o cfconv .obj/main.o .obj/cfconv ...
- 完全卸载VS2013的方法
解压安装包的ISO文件,然后进入到根目录运行命令行: vs_ultimate.exe /uninstall /force 注意:比如ISO是Update 5的,那么卸载的只能是Update 5安装的内 ...
- AngularJS:让submit重新生效
当我们在html中声明了ng-app后,form的submit就会失效,必须通过angularJS来处理.如果这时还是想用普通的方式提交的话,需要修改form标签,如下所示: <form met ...
- HDU 5239 上海大都会 D题(线段树+数论)
打表,发现规律是存在一定次数(较小)后,会出现a=(a*a)%p.可以明显地发现本题与线段树有关.设置标记flag,记录本段内的数是否均已a=a*a%p.若是,则不需更新,否则更新有叶子结点,再pus ...
- Supervisor-进程监控自动重启
Supervisor是一个进程监控程序. 需求一:我现在有一个进程需要每时每刻不断的跑,但是这个进程又有可能由于各种原因有可能中断.当进程中断的时候我希望能自动重新启动它,此时,我就需要使用到了Sup ...