感谢:http://blog.csdn.net/mirror58229/article/details/63685884 题意:x+y=a lcm(x,y)=b  求x,y 12WCases +  b 10^9 + a 10^4 所以肯定不是枚举……肯定是公式题 接下来就是转化 x+y=a x*y/gcd(x,y)=b 令gcd(x,y)=c x=i*c,y=j*c i*c+j*c=a c*i*j=b c*(i+j)=a c*i*j=b 因为i j互质 所以gcd(a,b)=c=gcd(x,y)…
Problem Description Given two positive integers a and b,find suitable X and Y to meet the conditions:                                                        X+Y=a                                              Least Common Multiple (X, Y) =b   InputInp…
题目链接 大意:给你两个数X,YX,YX,Y,让你找两个数a,ba,ba,b,满足a+b=X,lcm(a,b)=Ya+b=X,lcm(a,b)=Ya+b=X,lcm(a,b)=Y. 思路:枚举gcd(a,b)gcd(a,b)gcd(a,b),假设gcd(a,b)=k,那么a=xa∗k,b=xb∗k,gcd(a,b)=k,那么a=x_a*k,b=x_b*k,gcd(a,b)=k,那么a=xa​∗k,b=xb​∗k,化简上面给的两个式子即可得到 xa+xb=Xk,xa∗xb=Ykx_a+x_b=\f…
传送门 •题意 一直整数$a,b$,有 $\left\{\begin{matrix}x+y=a\\ LCM(x*y)=b \end{matrix}\right.$ 求$x,y$ •思路 解题重点:若$gcd(p,q)=1$,则$gcd(p+q,pq)=1$ 设$gcd(x,y)=g$,令$p=\frac{x}{g},q=\frac{y}{g}$,$p,q$互素 则$\left\{\begin{matrix}x+y=p*g+q*g=(p+q)g=a\\ LCM(x,y)=\frac{xy}{g}=…
A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2441    Accepted Submission(s): 1415 Problem Description Lele now is thinking about a simple function f(x). If x < 10 f(x) =…
A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4331    Accepted Submission(s): 2603 Problem Description Lele now is thinking about a simple function f(x).If x < 10 f(x) =…
A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2791    Accepted Submission(s): 1659 Problem Description Lele now is thinking about a simple function f(x). If x < 10 f(x) =…
P2071 -- A Simple Math Problem IX 时间限制:1000MS      内存限制:262144KB 状态:Accepted      标签:    数学问题-博弈论   无   无 Description 给定a,b,n,保证a≥2,b≥1,a^b≤n.两个人在玩游戏,每个人每次可以把a加1,或者把b加1,但是不能违反a^b<=n,无法再进行操作的人就输掉了这一场游戏. 假设两个人都足够聪明,按照最优策略进行游戏,问先手是否有必胜策略. Input Format 第…
A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 155 Accepted Submission(s): 110   Problem Description Lele now is thinking about a simple function f(x). If x < 10 f(x) = x.If…
题目 A Simple Math Problem 解析 矩阵快速幂模板题 构造矩阵 \[\begin{bmatrix}a_0&a_1&a_2&a_3&a_4&a_5&a_6&a_7&a_8&a_9\\ 1&0&0&0&0&0&0&0&0&0\\ 0&1&0&0&0&0&0&0&0&0\\ 0&…