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 ...
随机推荐
- 逆元 组合A(n,m) C(n,m)递推 隔板法
求逆元 https://blog.csdn.net/baidu_35643793/article/details/75268911 int inv[N]; void init(){ inv[] = ; ...
- 金融IT的算法要求
岗位职责 1.负责宏观经济预测的算法研究 2.负责债券.股票.基金等品种的模型研究 3.负责持仓收益分析,及绩效归因等模型研究 任职要求 1.一般数学: 线性代数与矩阵运算 随机过程 微积分 概率论 ...
- html自定义分页
public class MyPager { /// <summary> /// 每一页数据的条数 /// </summary> public int PageSize { g ...
- (一)phonegap自学---不会java也会写原生app
移动设备如日中天的今天 微软的表现让我们这些.net程序员无不心寒!!幸好每次乱世出英豪,古有java能夸平台,.net跨语言,今有phonegap跨设备 phonegap是什么 狂点这 http:/ ...
- CycloneII lcell_comb 和 lcell_FF 的结构
1,lcell_comb结构 2,lcell_FF结构 from : cycloneii_eda_fd.pdf
- thinkphp 区间查询
ThinkPHP支持对某个字段的区间查询,例如: 富瑞华大理石平台厂家哪家好 $map['id'] = array(array('gt',1),array('lt',10)) ; 得到的查询条件是: ...
- 洛谷P3376【模板】网络最大流 ISAP
这篇博客写得非常好呀. 传送门 于是我是DCOI这一届第一个网络流写ISAP的人了,之后不用再被YKK她们嘲笑我用Dinic了!就是这样! 感觉ISAP是会比Dinic快,只分一次层,然后不能增广了再 ...
- 自己编写jquery插件
http://blog.csdn.net/chenxi1025/article/details/52222327 https://www.cnblogs.com/ajianbeyourself/p/5 ...
- 当EntityFramework爱上AutoMapper
有时候相识即是一种缘分,相爱也不需要太多的理由,一个眼神足矣,当EntityFramework遇上AutoMapper,就是如此,恋爱虽易,相处不易. 在DDD(领域驱动设计)中,使用AutoMapp ...
- 北京服务业占GDP比重达81.7%
北京服务业占GDP比重达81.7% 2017-05-17 19:46:00 来源: 中国新闻网(北京)举报 0 易信 微信 QQ空间 微博 更多 (原标题:北京服务业占GDP比重达81.7%) ...