Gym - 102163M
Gym - 102163M
https://vjudge.net/problem/2356949/origin
取对数,然后特判特殊情况,就是0的那些情况
#include<iostream>
#include<cstdio>
#include<queue>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<set>
#include<map>
#include<stack>
#include<cstring>
#define inf 2147483647
#define ls rt<<1
#define rs rt<<1|1
#define lson ls,nl,mid,l,r
#define rson rs,mid+1,nr,l,r
#define N 100010
#define For(i,a,b) for(int i=a;i<=b;i++)
#define p(a) putchar(a)
#define g() getchar() using namespace std;
int T;
double a,b,c,d;
double eps=0.0000001;
void in(int &x){
int y=;
char c=g();x=;
while(c<''||c>''){
if(c=='-')y=-;
c=g();
}
while(c<=''&&c>=''){
x=(x<<)+(x<<)+c-'';c=g();
}
x*=y;
}
void o(int x){
if(x<){
p('-');
x=-x;
}
if(x>)o(x/);
p(x%+'');
}
int main(){
in(T);
while(T--){
cin>>a>>b>>c>>d;
if((b==&&d==)||(a==&&c==)){
cout<<"Lazy"<<endl;
continue;
}
if(a==&&c!=){
cout<<"Congrats"<<endl;
continue;
}
if(c==&&a!=){
cout<<"HaHa"<<endl;
continue;
}
if(fabs(b*log(a)-d*log(c))<eps)
cout<<"Lazy"<<endl;
else
if(b*log(a)-d*log(c)<)
cout<<"Congrats"<<endl;
else
cout<<"HaHa"<<endl;
}
return ;
}
Gym - 102163M的更多相关文章
- ACM: Gym 101047M Removing coins in Kem Kadrãn - 暴力
Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS Memory Limit:65536KB 64bit IO Fo ...
- ACM: Gym 101047K Training with Phuket's larvae - 思维题
Gym 101047K Training with Phuket's larvae Time Limit:2000MS Memory Limit:65536KB 64bit IO F ...
- ACM: Gym 101047E Escape from Ayutthaya - BFS
Gym 101047E Escape from Ayutthaya Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I6 ...
- ACM: Gym 101047B Renzo and the palindromic decoration - 手速题
Gym 101047B Renzo and the palindromic decoration Time Limit:2000MS Memory Limit:65536KB 64 ...
- Gym 101102J---Divisible Numbers(反推技巧题)
题目链接 http://codeforces.com/gym/101102/problem/J Description standard input/output You are given an a ...
- Gym 100917J---Judgement(01背包+bitset)
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury ...
- Gym 100917J---dir -C(RMQ--ST)
题目链接 http://codeforces.com/gym/100917/problem/D problem description Famous Berland coder and IT mana ...
- Gym 101102D---Rectangles(单调栈)
题目链接 http://codeforces.com/gym/101102/problem/D problem description Given an R×C grid with each cel ...
- Gym 101102C---Bored Judge(区间最大值)
题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...
随机推荐
- mount: you must specify the filesystem type
最近工作中遇到一个问题,在linux mount /dev/vdb 到 /home 分区时报错: 1 2 # mount /dev/vdb /home mount: you must specif ...
- python pip安装扩展报错
1.安装tldr报错 (1)报错详情: [root@linuxnode1 ~]# pip install tldrCollecting tldr Downloading https://files.p ...
- 【颓废篇】人生苦短,我用python(一)
谁渴望来一场华(ang)丽(zang)的python交易! 最近突然产生了系统学习python的想法. 其实自从上次luogu冬日绘板dalao们都在写脚本就有这种想法了. 最近被计算几何势力干翻的我 ...
- AutoIt自动化编程(1)【转】
1.运行程序 Run 命令或者函数用来运行外部可执行文件 AU3:Run ( "文件名" [, "工作目录" [, 标志]] ) EXAMPLE: AU3:Ru ...
- duilib教程之duilib入门简明教程4.响应按钮事件
上一个Hello World的教程里有一句代码是这样的:CControlUI *pWnd = new CButtonUI; 也就是说,其实那整块绿色背景区域都是按钮的区域.(这里简要介绍下,CC ...
- Canavs初学
<canvas id="canvas" style="border:1px solid #f00;"></canvas> 公用js: v ...
- vue 全局方法(单个和多个方法)
参考: https://www.cnblogs.com/zhcBlog/p/9892883.html https://blog.csdn.net/xuerwang/article/d ...
- 手机端META详细解释
一.天猫 <title>天猫触屏版</title> <meta content="text/html; charset=utf-8" http-equ ...
- Foundation框架系列-NSString
NSString OC字符串与C语言字符串转换 NSString *str = @"Hello world ! !"; // OC字符串 --> C语言字符串 char *c ...
- 查看MySql版本号命令
转自:https://blog.csdn.net/qq_38486203/article/details/80324014 这里介绍四中不同的方法,它们分别运行在不同的环境中,最后对每种方法的优劣以 ...