软院校赛F题

大水题,题目大意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");
	}
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值