
数论
five_east_west
这个作者很懒,什么都没留下…
展开
-
用程序表示的辗转相除法——求最大公约数
线段上格点的个数 给定平面上两个格点 P1=(x1,y1)P_1=(x_1,y_1)P1=(x1,y1)和P2=(x2,y2)P_2=(x_2,y_2)P2=(x2,y2),线段P1P2上,除P1和P2以外一共又几个格点? 限制条件 −109≤x1,x2,y1,y2≤109-10^9 \le x_1,x_2,y_1,y_2 \le 10^9−109≤x1,x2,y1,y2≤109 输入 P1 = (1,11),P2 = (5,3) 输出 (2,9)、(3,7)、(4、5)原创 2020-08-13 12:09:59 · 778 阅读 · 0 评论 -
CodeForces - 593B Anton and Lines——判断在给定的区间两直线是否存在交点
The teacher gave Anton a large geometry homework, but he didn’t do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k i·x + b i. It was necessary to determine whether原创 2020-07-26 16:47:21 · 261 阅读 · 0 评论 -
vijos 1279 Leave-绿光——辗转相除法
Leave-绿光 背景 期待这一份幸运,和一份冲劲,多么奇妙的际遇……。燕姿在演唱完绿光这首歌后,出给了姿迷一个考题。 北欧有一个传说! 人一生中能看见绿光! 他就一生都可以得到幸福! 描述 燕姿唱完这首歌,天上降落了一道绿光,在地上形成了一个矩形的映射,矩形的长为a,宽为b。燕姿向姿迷出了一个考题,谁能够把这个矩形绿光阵分成若干个正整数的正方形,谁的正方形边长之和最小,他就将得到燕姿的一个合影。姿迷们都很想得到合影,可是怎么分才最小呢?大家都束手无策,现在,这个问题交给你了。 歌迷X:呜呜呜,俺的语文不好原创 2020-10-14 11:14:44 · 137 阅读 · 0 评论