首页 > Fraction Construction Problem
头像 eat12ac
发表于 2020-07-18 19:35:10
F 数论 题意 给出 ,要求: 且 试求: 思路 原式变形可得到 ,将 化为最简分数 ,由最简分数的唯一性可得: , 当 时,我们令 ,可以得到:,这是一组可行解。 当 时,我们不能直接令。我们希望能找到 的互质因子 ,使得 ,从而代入上述方程,通过扩展欧几里得解出 和 。如果找不 展开全文
头像 TitanZhang
发表于 2020-07-19 20:31:58
题目大意 有t(1≤t≤105)次查询,每个查询给出两个正整数a,b(a,b≤2×106)。 输出一组满足以下条件的四个正整数c,d,e,f: 如果没有解决方案,输出“ -1 -1 -1 -1”。 解题思路 进行赛后冷静分析,可以归纳出三种情况,这三种情况只需在代码 展开全文
头像 11D_Beyonder
发表于 2020-08-16 03:22:41
题目描述   There are queries.  In each query, you are given two positive integers and .  Please print a line consists of four positive integers c,d,e,f 展开全文
头像 zjnu_tjq
发表于 2020-07-25 23:01:37
链接:https://ac.nowcoder.com/acm/contest/5668/F来源:牛客网 题目描述: There are t queries. In each query, you are given two positive integers a and b (a,b≤2×1e6) 展开全文