H. Eyad and Math
 
time limit per test

2.0 s

memory limit per test

256 MB

input

standard input

output

standard output

Eyad was given a simple math problem, but since he is very bad at math he asked you to help him.

Given 4 numbers, abc, and d. Your task is to find whether ab is less than cd or not.

It is guaranteed that the two numbers above are never equal for the given input.

Input

The first line contains an integer T (1 ≤ T ≤ 105), where T is the number of test cases.

Then T lines follow, each line contains four integers abc, and d (1 ≤ a, b, c, d ≤ 109).

Output

For each test case, print a single line containing "<" (without quotes), if ab is less than cd. Otherwise, print ">" (without quotes).

Example
input
2
9 2 5 3
3 4 4 3
output
<
>

这个题,emnnn,眼瞎,这么大的数,快速幂也跑爆啊。。。中学时代的换底公式,6的飞起。。。

a的b次方假设为x,求对数为logax=b,换成以10为底的,就是lnx为b*lna,同理c的d次方。水题水题。。。

代码:

 1 //H. Eyad and Math-对数,换底公式-快速幂会爆啊啊啊啊啊啊
2 #include<iostream>
3 #include<cstring>
4 #include<cstdio>
5 #include<cmath>
6 #include<algorithm>
7 using namespace std;
8 int main(){
9 int t;
10 while(~scanf("%d",&t)){
11 int a,b,c,d;
12 while(t--){
13 scanf("%d%d%d%d",&a,&b,&c,&d);
14 double ans1=b*log10(a);
15 double ans2=d*log10(c);
16 if(ans1<ans2)printf("<\n");
17 else printf(">\n");
18 }
19 }
20 return 0;
21 }

Codeforces Gym101502 H.Eyad and Math-换底公式的更多相关文章

  1. 2017 JUST Programming Contest 3.0 H. Eyad and Math

    H. Eyad and Math time limit per test 2.0 s memory limit per test 256 MB input standard input output ...

  2. 【机器学习理论】换底公式--以e,2,10为底的对数关系转化

    我们在推导机器学习公式时,常常会用到各种各样的对数,但是奇怪的是--我们往往会忽略对数的底数是谁,不管是2,e,10等. 原因在于,lnx,log2x,log10x,之间是存在常数倍关系. 回顾学过的 ...

  3. Codeforces 1037 H. Security

    \(>Codeforces \space 1037\ H. Security<\) 题目大意 : 有一个串 \(S\) ,\(q\) 组询问,每一次给出一个询问串 \(T\) 和一个区间 ...

  4. Codeforces 916E Jamie and Tree (换根讨论)

    题目链接  Jamie and Tree 题意  给定一棵树,现在有下列操作: $1$.把当前的根换成$v$:$2$.找到最小的同时包含$u$和$v$的子树,然后把这棵子树里面的所有点的值加$x$: ...

  5. Codeforces Gym101502 I.Move Between Numbers-最短路(Dijkstra优先队列版和数组版)

    I. Move Between Numbers   time limit per test 2.0 s memory limit per test 256 MB input standard inpu ...

  6. codeforces#1187E. Tree Painting(树换根)

    题目链接: http://codeforces.com/contest/1187/problem/E 题意: 给出一颗树,找到一个根节点,使所有节点的子节点数之和最大 数据范围: $2 \le n \ ...

  7. Codeforces 997D - Cycles in product(换根 dp)

    Codeforces 题面传送门 & 洛谷题面传送门 一种换根 dp 的做法. 首先碰到这类题目,我们很明显不能真的把图 \(G\) 建出来,因此我们需要观察一下图 \(G\) 有哪些性质.很 ...

  8. Codeforces Gym H. Hell on the Markets 贪心

    Problem H. Hell on the MarketsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vj ...

  9. CodeForces 914DBash and a Tough Math Puzzle(线段树的骚操作)

    D. Bash and a Tough Math Puzzle time limit per test 2.5 seconds memory limit per test 256 megabytes ...

随机推荐

  1. LeetCode之Weekly Contest 93

    第一题:二进制间距 问题: 给定一个正整数 N,找到并返回 N 的二进制表示中两个连续的 1 之间的最长距离. 如果没有两个连续的 1,返回 0 . 示例 1: 输入:22 输出:2 解释: 22 的 ...

  2. 【Spring】事务的实现方式

    1 初步理解 理解事务之前,先讲一个你日常生活中最常干的事:转账. 场景设定: 用户名 余额 A 1000 B 1000 操作: A通过支付宝给B转账200块,做这件事情会进行两个操作. 1:A账号- ...

  3. 【MySQL】mac环境下使用navicat premium连接mysql乱码问题

    ---恢复内容开始--- 最重要的两点:使用navicat premium创建mysql连接和在mysql连接里面创建数据库时,需要注意. 1.创建连接时,Encoding不需要手动选择,保持Auto ...

  4. http客户端与浏览器的区别

    两者区别:浏览器对http响应头会进行特定处理(如自动读取本地缓存.设置cookie等),而http客户端(如crul)可能没有像浏览器那样的处理,某些封装程度高的http客户端,可能会有. 同一个文 ...

  5. python3.6:DLL load failed:找不到指定的模块(from PyQt5 import QtCore)

    本人小白搭建pyqt环境时遇到问题 运行代码 from PyQt5 import QtCore' 发现错误 ImportError: DLL load failed: 找不到指定的模块 这个问题折磨了 ...

  6. 在SCIKIT中做PCA 逆变换 -- 新旧特征转换

    PCA(Principal Component Analysis)是一种常用的数据分析方法.PCA通过线性变换将原始数据变换为一组各维度线性无关的表示,可用于提取数据的主要特征分量,常用于高维数据的降 ...

  7. optimize table在优化mysql时很重要

    一个表的数据量有1000W条,那么查看这么表占据的硬盘空间时会发现,数据本身是300M,索引是200M 这个时候,删除掉500W条数据,这个时候数据本身150M,而索引还是200M左右 你删除数据时, ...

  8. luogu3203 [HNOI2010]弹飞绵羊

    lct裸题 #include <iostream> #include <cstdio> using namespace std; int n, ski[200005], m, ...

  9. 在win2003下apache2.2无法加载php5apache2_4.dll

    昨天在一台win2003的服务器上配置apache和PHP, 我在apache的配置文件httpd.conf里添加 LoadModule php5_module "D:/php-5.4.23 ...

  10. 为什么要用全文搜索引擎:全文搜索引擎 VS 数据库管理系统

    正文一:Full Text Search Engines vs. DBMS  发表于2009年 正文二:Elasticsearch - A High-Performance Full-Text Sea ...