首页 > Fraction Comparision
头像 夢見麒
发表于 2019-07-19 18:25:48
本题就是比较两个分数的大小,毫无压力的签到水题,x : a 与 y : b,比较内项积与外项积即可。 因为数比较大,可能会爆栈,所以个人感觉python和java大数比较好用,亲测该题python代码要优于java大数。 题目描述 链接:https:// 展开全文
头像 yescatx
发表于 2022-05-04 12:38:12
J.Fraction Comparision 一道简单()的数学计算题,最开始机智的我就想到了直接除是不可以的!于是我想到了交叉相乘法,于是wa了一发,于是又仔细想了一下,发现是高精度的问题,1e18*1 e10超了1e27,于是想到了整数和小数分开来判断的方法,即先用x/a,y/b判断 展开全文
头像 firevolt
发表于 2019-07-19 23:41:39
Bobo has two fractions xaxa and ybyb. He wants to compare them. Find the result. 输入描述: The input consists of several test cases and is terminated b 展开全文
头像 Yvonne_sq
发表于 2019-07-21 14:51:04
#include<iostream> using namespace std; int main(){        long long x,a,b,y;      展开全文
头像 山阴
发表于 2019-07-19 18:06:04
传送门: https://ac.nowcoder.com/acm/contest/881/J 题目描述 Bobo has two fractions x/a and y/b. He wants to compare them. Find the result. 输入描述 The input cons 展开全文
头像 TABball
发表于 2019-07-19 20:00:15
题意 给两个分数,判断大小。 Code while True:     try:         x, a, y, b = map(int, input().split()) 展开全文
头像 AFreeMan
发表于 2019-07-19 20:11:29
用python很容易水过啦,__int128也可以。 while 1: try: x,a,y,b=map(int,input().split()) except: break #print(x,a,y,b) d=x*b-y*a 展开全文