http://www.elijahqi.win/archives/3553
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
xy
with yx
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
xy
with yx
yx
for Vasya, maybe then other androids will respect him.
Input
On the only line of input there are two integers x
x
and y
y
(1≤x,y≤109
1≤x,y≤109
).
Output
If xy
Copy
Note
In the first example 58=5⋅5⋅5⋅5⋅5⋅5⋅5⋅5=390625
58=5⋅5⋅5⋅5⋅5⋅5⋅5⋅5=390625
, and 85=8⋅8⋅8⋅8⋅8=32768
85=8⋅8⋅8⋅8⋅8=32768
. So you should print ‘>’.
In the second example 103=1000<310=59049
103=1000<310=59049
.
In the third example 66=46656=66
66=46656=66
.
当x,y都>2的时候答案是唯一确定的 证明可以用导数证明 可以证明当大于e的时候即可
如x^y=y*ln(x)
剩下的情况分类讨论即可
#include<cstdio>
int x,y;
int main(){
//freopen("b.in","r",stdin);
scanf("%d%d",&x,&y);
if(x==y){
puts("=");return 0;
}
if (x>2&&y>2){
if(x<y) puts(">");
else puts("<");return 0;
}if (x==1){
puts("<");return 0;
}
if (y==1){
puts(">");return 0;
}
if(x==4&&y==2){
puts("=");return 0;
}
if (y==4&&x==2) {
puts("=");return 0;
}
if (x>4){
puts("<");return 0;
}
if(y>4) {
puts(">");return 0;
}
if (x==2&&y==3){
puts("<");return 0;
}
if (x==3&&y==2){
puts(">");return 0;
}
return 0;
}