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 ...
随机推荐
- CAD从线型文件加载线型记录(com接口)
主要用到函数说明: _DMxDrawX::LoadLinetypeFromFile 从线型文件加载线型记录,详细说明如下: 参数 说明 BSTR pszLinetypeFile 线型文件名,支持htt ...
- 洛谷——P2341 [HAOI2006]受欢迎的牛//POJ2186:Popular Cows
P2341 [HAOI2006]受欢迎的牛/POJ2186:Popular Cows 题目背景 本题测试数据已修复. 题目描述 每头奶牛都梦想成为牛棚里的明星.被所有奶牛喜欢的奶牛就是一头明星奶牛.所 ...
- uva253 Cube painting(UVA - 253)
题目大意 输入有三种颜色判断两个骰子是否相同 思路(借鉴) ①先用string输入那12个字符,然后for出两个骰子各自的字符串 ②这里用的算法是先找出第一个的三个面与第二个的六个面去比较,如果找到相 ...
- Nginx配置文件的高亮显示设置
linux系统下vim或者vi编辑器默认是没有对nginx的语法高亮设置. 1.下载vi语法高亮配置到 ~/.vim/syntax,如果不存在则创建该目录,cd ~/.vim/syntax wget ...
- (蓝桥杯)第八届A组C/C++方格分割
#include<iostream> #include<memory.h> #include<stack> #include<string> #incl ...
- Flask - 安装,仪式, 返回, 和 请求
目录 Flask - 第一篇 安装,仪式, 返回, 和 请求 一. Flask 的安装 和 程序员仪式 安装 程序员仪式 二. Flask 的返回值 三. Flask 请求request Flask ...
- Git 基础教程 之 多人协作
多人协作时,从远程克隆时,默认情况下,只能看到master分支 git checkout -b dev origin/dev 创建远程origin的dev分支到本地 git branch ...
- 申请SSL证书怎样验证域名所有权
申请域名型证书时,系统将提供以下三种方式验证域名的所有权,请根据自己的实际情况选择其中一种进行域名验证: 1.管理员邮箱验证 系统会向你选择的管理员邮箱 发送验证邮件,能够收到验证邮件,并点击邮件中验 ...
- 【Codeforces 1B】Spreadsheets
[链接] 我是链接,点我呀:) [题意] A~Z分别对应了1~26 AA是27依次类推 让你完成双向的转换 [题解] 转换方法说实话特别恶心>_< int转string 得像数位DP一样一 ...
- noip模拟赛 浮游大陆的68号岛
题目描述 妖精仓库里生活着黄金妖精们,她们过着快乐,却随时准备着迎接死亡的生活. 换用更高尚的说法,是随时准备着为这个无药可救的世界献身. 然而孩子们的生活却总是无忧无虑的,幼体的黄金妖精们过着天真烂 ...