大水题,题目大意a!和b^c比大小,1 <= a, b, c <=20000,思路就是用log。
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<cmath>
#include<ctime>
#define mx 200005
#define LL long long
#define mod 1000000009
#define esp 1e-12
#define y1 y1234
#define inf 0x3f3f3f3f
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
const double PI = acos(-1.0);
using namespace std;
int a[1005];
double num[22222];
int main(){
num[0] = 0;
for (int i = 1; i < 20000; i++){
num[i] = num[i - 1] + log(double(i));
}
int a, b, c;
while (scanf("%d%d%d", &a, &b, &c) == 3) {
double y = c * log(double(b));
if (num[a] == y)
puts("0");
else if (num[a] > y)
puts("1");
else
puts("-1");
}
}