CF987B High School: Become Human 数学
题意翻译
题目大意
输入一个 xxx ,一个 yyy ,求是 xyx^yxy 大还是 yxy^xyx 大。 (1≤x,y≤109)(1≤x,y≤10^9)(1≤x,y≤109)
输入输出格式
输入格式
一行,两个整数 x,yx,yx,y 。
输出格式
若 xyx^yxy > yxy^xyx ,输出">",若 xyx^yxy < yxy^xyx ,输出"<",想等则输出"="。
感谢@二元长天笑 提供的翻译
题目描述
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 x^y xy with yx y^x 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 xy x^y xy with yx y^x yx for Vasya, maybe then other androids will respect him.
输入输出格式
输入格式:
On the only line of input there are two integers x x x and y y y ( 1≤x,y≤109 1 \le x, y \le 10^{9} 1≤x,y≤109 ).
输出格式:
If xy<yx x^y < y^x xy<yx , then print '<' (without quotes). If xy>yx x^y > y^x xy>yx , then print '>' (without quotes). If xy=yx x^y = y^x xy=yx , then print '=' (without quotes).
输入输出样例
说明
In the first example 58=5⋅5⋅5⋅5⋅5⋅5⋅5⋅5=390625 5^8 = 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 = 390625 58=5⋅5⋅5⋅5⋅5⋅5⋅5⋅5=390625 , and 85=8⋅8⋅8⋅8⋅8=32768 8^5 = 8 \cdot 8 \cdot 8 \cdot 8 \cdot 8 = 32768 85=8⋅8⋅8⋅8⋅8=32768 . So you should print '>'.
In the second example 103=1000<310=59049 10^3 = 1000 < 3^{10} = 59049 103=1000<310=59049 .
In the third example 66=46656=66 6^6 = 46656 = 6^6 66=46656=66 .
注意用 long double;
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<bitset>
#include<ctime>
#include<deque>
#include<stack>
#include<functional>
#include<sstream>
//#include<cctype>
//#pragma GCC optimize(2)
using namespace std;
#define maxn 900005
#define inf 0x7fffffff
//#define INF 1e18
#define rdint(x) scanf("%d",&x)
#define rdllt(x) scanf("%lld",&x)
#define rdult(x) scanf("%lu",&x)
#define rdlf(x) scanf("%lf",&x)
#define rdstr(x) scanf("%s",x)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int U;
#define ms(x) memset((x),0,sizeof(x))
const long long int mod = 1e9 + 7;
#define Mod 1000000000
#define sq(x) (x)*(x)
#define eps 1e-4
typedef pair<int, int> pii;
#define pi acos(-1.0)
//const int N = 1005;
#define REP(i,n) for(int i=0;i<(n);i++)
typedef pair<int, int> pii;
inline ll rd() {
ll x = 0;
char c = getchar();
bool f = false;
while (!isdigit(c)) {
if (c == '-') f = true;
c = getchar();
}
while (isdigit(c)) {
x = (x << 1) + (x << 3) + (c ^ 48);
c = getchar();
}
return f ? -x : x;
} ll gcd(ll a, ll b) {
return b == 0 ? a : gcd(b, a%b);
}
int sqr(int x) { return x * x; } /*ll ans;
ll exgcd(ll a, ll b, ll &x, ll &y) {
if (!b) {
x = 1; y = 0; return a;
}
ans = exgcd(b, a%b, x, y);
ll t = x; x = y; y = t - a / b * y;
return ans;
}
*/ int x, y;
long double ans1, ans2; int main() {
//ios::sync_with_stdio(0);
cin >> x >> y;
ans1 = (long double)y*log(x)*1.0;
ans2 = (long double)x*log(y)*1.0;
if (ans1 > ans2)cout << ">" << endl;
else if (ans2 > ans1)cout << "<" << endl;
else if (fabs(ans1 - ans2) <= eps)cout << "=" << endl;
return 0;
}
CF987B High School: Become Human 数学的更多相关文章
- CF987B - High School: Become Human
Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But ...
- Codeforces Round #354 (Div. 2) E. The Last Fight Between Human and AI 数学
E. The Last Fight Between Human and AI 题目连接: http://codeforces.com/contest/676/problem/E Description ...
- High School: Become Human(数学思维)
Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But ...
- *HDU 2451 数学
Simple Addition Expression Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Ja ...
- Mathematics for Computer Graphics数学在计算机图形学中的应用 [转]
最近严重感觉到数学知识的不足! http://bbs.gameres.com/showthread.asp?threadid=10509 [译]Mathematics for Computer Gra ...
- MCM试题原文及翻译 AB题 2014美国数学建模竞赛
MCM试题原文及翻译 AB题 2014美国数学建模竞赛 原创翻译,如有瑕疵,敬请谅解. 转载请注明:过客小站 » MCM试题原文及翻译 AB题 2014美国数学建模竞赛 PROBLEM A: The ...
- Learning Feature Pyramids for Human Pose Estimation(理解)
0 - 背景 人体姿态识别是计算机视觉的基础的具有挑战性的任务,其中对于身体部位的尺度变化性是存在的一个显著挑战.虽然金字塔方法广泛应用于解决此类问题,但该方法还是没有很好的被探索,我们设计了一个Py ...
- 数学思想:为何我们把 x²读作x平方
要弄清楚这个问题,我们得先认识一个人.古希腊大数学家 欧多克索斯,其在整个古代仅次于阿基米德,是一位天文学家.医生.几何学家.立法家和地理学家. 为何我们把 x²读作x平方呢? 古希腊时代,越来越多的 ...
- 速算1/Sqrt(x)背后的数学原理
概述 平方根倒数速算法,是用于快速计算1/Sqrt(x)的值的一种算法,在这里x需取符合IEEE 754标准格式的32位正浮点数.让我们先来看这段代码: float Q_rsqrt( float nu ...
随机推荐
- nodejs stream基础知识
分类 nodejs 的 stream 有四种: Readable:可读流 Writable: 可写流 Duplex:双工流 Transform:转换流 Readable // _read方法是从底层系 ...
- vscode 小笔记
用户设置: { "git.ignoreMissingGitWarning": true, "workbench.statusBar.feedback.visible&qu ...
- FEC之我见一
顾名思义,FEC前向纠错,根据收到的包进行计算获取丢掉的包,而和大神沟通的结果就是 纠错神髓:收到的媒体包+冗余包 >= 原始媒体包数据 直到满足 收到的媒体包+ 冗余包 >= 原始媒 ...
- 数据schemaAvro简介
文章结束给大家来个程序员笑话:[M] 最近在研究Thrift和Avro以及它们的区分,通过各种渠道搜集资料,现整顿出有关Avro的一些资料,方便当前参考. 一.弁言 1. 简介 Avro是Hadoop ...
- Oracle12c多租户如何启动关闭CDB或PDB (PDB自动启动)
Oracle 数据库 12 c 中介绍了多租户选项允许单个容器数据库 (CDB) 来承载多个单独的可插拔数据库 (PDB).下面我们一起来启动和关闭容器数据库 (CDB) 和可插拔数据库 (PDB). ...
- 恢复到特定点(时间点、scn、日志序列号),rman不完全恢复
将数据库.表空间.数据文件等恢复至恢复备份集保存时间中的任何一个时间点/SCN/日志序列(一般是日志挖掘找到误操作点),但须谨慎,操作前一定需要做好备份,具备条件的情况下最好先恢复到异机,避免业务停机 ...
- androidpn环境搭建
1.下载androidpn版本.http://sourceforge.net/projects/androidpn/postdownload?source=dlp 2.下载安装tomcat 2.1 下 ...
- Java标签引起的陷阱
请看下面的代码,请问下面的代码是否能够通过编译: package com.yonyou.test; /** * 测试类 * @author 小浩 * @创建日期 2015-3-2 */ public ...
- kvm基础 虚拟机内存、CPU调整
转自http://blog.csdn.net/hnhuangyiyang/article/details/50902223 一.调小虚拟机内存 调小虚拟机内存可以动态实现,不用关机1.查看当前内存大小 ...
- Nodejs调试技术
基于Chrome浏览器的调试器 既然我们可以通过V8的调试插件来调试,那是否也可以借用Chrome浏览器的JavaScript调试器来调试呢?node-inspector模块提供了这样一种可能.我们需 ...