YunYan

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 37 下一页

2019年8月14日

摘要: 对于 ax+by=gcd(a,b) 这样的方程,可以用扩展欧几里得算法exgcd求出一组通解。 根据欧几里得求gcd: gcd(a,b)=gcd(b,a%b) 可得 bx+(a%b)y=gcd(b,a%b) 根据 a%b=a−(a/b)∗b 可得 bx+ay−(a/b)b∗y=gcd(b,a%b) 阅读全文
posted @ 2019-08-14 14:07 Target--fly 阅读(287) 评论(0) 推荐(0) 编辑

2019年8月13日

摘要: 题目描述 小L期末考试结束,高高兴兴放假回家了,可是那么多试卷,老师还要加班批改,有n份试卷由k个老师批改,n份试卷进行了密封编号,由于试卷上的做题情况和书写的规范程序不一样,批改不同的试卷用时也可能不一样,每个老师批改试卷的编号顺序是连续的,每位老师批改完分配给自己的试卷就可以离开,问最后离开的老 阅读全文
posted @ 2019-08-13 21:08 Target--fly 阅读(134) 评论(0) 推荐(0) 编辑

摘要: 题目描述 在给定的一个整数序列中,小L希望找到一个连续的区间,这个区间的和能够被k整除,请你帮小L算一下满足条件的最长的区间长度是多少。 题目描述 在给定的一个整数序列中,小L希望找到一个连续的区间,这个区间的和能够被k整除,请你帮小L算一下满足条件的最长的区间长度是多少。 输入 第一行输入两个整数 阅读全文
posted @ 2019-08-13 20:21 Target--fly 阅读(273) 评论(0) 推荐(0) 编辑

摘要: Given two positive integers G and L, could you tell me how many solutions of (x, y, z) there are, satisfying that gcd(x, y, z) = G and lcm(x, y, z) = 阅读全文
posted @ 2019-08-13 08:18 Target--fly 阅读(119) 评论(0) 推荐(0) 编辑

2019年8月12日

摘要: It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the fi 阅读全文
posted @ 2019-08-12 23:18 Target--fly 阅读(108) 评论(0) 推荐(0) 编辑

摘要: Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggeste 阅读全文
posted @ 2019-08-12 23:13 Target--fly 阅读(203) 评论(0) 推荐(0) 编辑

摘要: Find the result of the following code: long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) for( int j = i; j <= n; j++  阅读全文
posted @ 2019-08-12 23:05 Target--fly 阅读(121) 评论(0) 推荐(0) 编辑

摘要: While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University,noticed that the telephone number of his brother-in- 阅读全文
posted @ 2019-08-12 22:47 Target--fly 阅读(173) 评论(0) 推荐(0) 编辑

2019年8月11日

摘要: 已知每块石头中的规格是1×1×1,水塘的长度为N,宽度为1,在第i位置,大树放了ai个石头 设大树建造的水塘蓄水量为V 请你求出在长度和宽度不变的情况下,建造一个蓄水量不小于V的水塘最多可以节约多少石头 已知每块石头中的规格是1×1×1,水塘的长度为N,宽度为1,在第i位置,大树放了ai个石头 设大 阅读全文
posted @ 2019-08-11 16:33 Target--fly 阅读(120) 评论(0) 推荐(0) 编辑

摘要: 幸运数是经由类似埃拉托斯特尼筛法的演算法后留下的整数集合,是在1955年波兰数学家乌拉姆提出。 由一组由1开始的数列为例: 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25, …先将所有偶数删去,只留下 阅读全文
posted @ 2019-08-11 16:28 Target--fly 阅读(630) 评论(0) 推荐(0) 编辑

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 37 下一页