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 ...
随机推荐
- HDU 1147 /// 判断两线段相交
题目大意: 给定n条线段的端点 依次放上n条线段 判断最后在最上面(不被覆盖)的线段有哪些 到当前线段后 直接与之前保存的未被覆盖的线段判断是否相交就可以了 #include <cstdio&g ...
- EasyNetQ异常处理
代码下载 https://download.csdn.net/download/u010312811/11252093 官方Demo https://github.com/EasyNetQ/EasyN ...
- 设置编辑工具UltraEdit的背景色为护眼颜色
1.视图--->主题--->管理主题---> 2.--->编辑器--->纯文本--->第二个框(背景色) 3.--->规定自定义颜色--->建议(色调: ...
- css---3链接伪类与动态伪类
链接伪类link:表示作为超链接,并指向一个未访问的地址的所有锚 链接伪类不可以加在div上 <!DOCTYPE html> <html> <head> <m ...
- html--浮动高度塌陷问题
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- CF1158F Density of subarrays
CF1158F Density of subarrays 首先可以发现,有值的p最大是n/c 对于密度为p,每个数至少出现c次,且其实是每出现c个数,就分成一段,这样贪心就得到了p %ywy n/c ...
- iOS之CAEmitterLayer粒子引擎
1.CAEmitterCell粒子发射器的相关属性: /* CoreAnimation - CAEmitterLayer.h Copyright (c) 2007-2017, Apple Inc. A ...
- 报错C1189 #error: "No Target Architecture"
根本原因: 是因为单独包含了一些windows.h已经包含了的头文件如"fileapi.h","WinUser.h",但是却没有包含windows.h 或者先包 ...
- GCC 参数详解
转载出处:http://blog.csdn.net/yff1030/article/details/8592077 原文:http://www.cppblog.com/SEMAN/archive/20 ...
- 转:链表相交有环 经典面试题(三)附答案 算法+数据结构+代码 微软Microsoft、谷歌Google、百度、腾讯
源地址:http://blog.csdn.net/sj13051180/article/details/6754228 1.判断单链表是否有环,要求空间尽量少(2011年MTK) 如何找出环的连接点在 ...