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在网页中返回当前图纸的最小外包矩形框
主要用到函数说明: _DMxDrawX::GetMcDbDatabaseBound 返回当前图纸的最小外包矩形框,详细说明如下: 参数 说明 DOUBLE* pLbx 返回最小外包矩形框左下角X值 D ...
- perf-perf stat用户层代码分析
perf_event 源码分析 前言 简单来说,perf是一种性能监测工具,它首先对通用处理器提供的performance counter进行编程,设定计数器阈值和事件,然后性能计数器就会在设定事件发 ...
- 环形缓冲区: ringbuf.c
#cat aa.c /*ringbuf .c*/ #include<stdio.h> #include<ctype.h> #define NMAX 8 int iput = 0 ...
- 1.Linux入门介绍
1.1 Linux概述 1.1.1 Linux简要介绍 Linux的由来: Linux的内核最初是由芬兰人李纳斯·托瓦茨在上大学的时候编写的一个内核,它是基于Unix操作系统编写的 大多服务器使用的是 ...
- LVM(Logical Volume Manager)逻辑卷管理
本文实验部分,完全由本人亲自动手实践得来 文章中有部分的内容是我个人通过实验测试出来的,虽以目前本人的能力还没发现不通之处,但错误难免,所以若各位朋友发现什么错误,或有疑惑.更好的建议等,盼请各位能在 ...
- 腾讯云,搭建nginx静态网站服务器
搭建Http静态服务器环境 任务时间:15min ~ 30min 搭建静态网站,首先需要部署环境.下面的步骤,将告诉大家如何在服务器上通过 Nginx 部署 HTTP 静态服务. 安装 Nginx 在 ...
- 12SSM整合
u 三大框架基本概念 spring.SpringMVC.Mybatis u 整合思路 u 环境准备 u 工程结构 u SPRING + SPING MVC + MYBATIS 三大框架整合 ...
- 【ACM】hdu_1091_A+BIII_201307261112
A+B for Input-Output Practice (III)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/327 ...
- B - Oulipo
The French author Georges Perec (1936�C1982) once wrote a book, La disparition, without the letter ' ...
- 循环A表,根据查询结果,更新A表字段
create or replace procedure prc_user_xtzx_match(p_flag out varchar2) IS xingming_match_loginname ); ...