码迷,mamicode.com
首页 >  
搜索关键字:divisor    ( 166个结果
HDU 6430 Problem E. TeaTree(虚树)
Problem E. TeaTree Problem Description Recently, TeaTree acquire new knoledge gcd (Greatest Common Divisor), now she want to test you.As we know, TeaT ...
分类:其他好文   时间:2018-08-30 14:23:47    阅读次数:172
HDU - 6025 Coprime Sequence(gcd+前缀后缀)
Do you know what is called ``Coprime Sequence''? That is a sequence consists of nnpositive integers, and the GCD (Greatest Common Divisor) of them is ...
分类:其他好文   时间:2018-08-24 21:19:23    阅读次数:151
[Project Euler 429] Sum of squares of unitary divisors(数论)
题目链接:https://projecteuler.net/problem=429 题目: A unitary divisor dd of a number nn is a divisor of nn that has the property gcd(d,n/d)=1 The unitary di ...
分类:其他好文   时间:2018-08-23 22:14:46    阅读次数:293
Codeforces Round #505 (Div 1 + Div 2 Combined) Partial Solution
从这里开始 题目列表 瞎扯 Problem A Doggo Recoloring Problem B Weakened Common Divisor Problem C Plasticine zebra Problem D Recovering BST Problem E Colored Cubes ...
分类:其他好文   时间:2018-08-22 22:55:02    阅读次数:463
CF1025B Weakened Common Divisor
思路: 首先选取任意一对数(a, b),分别将a,b进行因子分解得到两个因子集合然后取并集(无需计算所有可能的因子,只需得到不同的质因子即可),然后暴力一一枚举该集合中的元素是否满足条件。 时间复杂度:O(sqrt(amax) + n * log(amax))。 实现: ...
分类:其他好文   时间:2018-08-21 17:44:04    阅读次数:202
Codeforces 1025B Weakened Common Divisor(思维)
题目链接:CF 1025B 题意:给定n个二元组(ai,bi),定义WCD为能整除n个二元组每组中至少一个的数,求WCD。 题解:我们先求出能整除n个二元组ai*bi的GCD(代表了ai和bi两者),如果得到的GCD!=1,我们再对这n个二元组去提取,GCD与ai和bi进行gcd,可以认为是一个缩化 ...
分类:其他好文   时间:2018-08-20 20:14:51    阅读次数:190
codeforces 1025B Weakened Common Divisor(质因数分解)
题意: 给你n对数,求一个数,可以让他整除每一对数的其中一个 思路: 枚举第一对数的质因数,然后暴力 代码: ...
分类:其他好文   时间:2018-08-20 14:27:22    阅读次数:165
Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) -B C(GCD,最长连续交替序列)
B. Weakened Common Divisor time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output B. Weakened ...
分类:其他好文   时间:2018-08-20 11:32:25    阅读次数:429
Codeforces #505(div1+div2) B Weakened Common Divisor
题意:给你若干个数对,每个数对中可以选择一个个元素,问是否存在一种选择,使得这些数的GCD大于1? 思路:可以把每个数对的元素乘起来,然后求gcd,这样可以直接把所有元素中可能的GCD求出来,从小到大枚举即可,需要特判一下第一个元素是素数的情况。 ...
分类:其他好文   时间:2018-08-20 10:36:39    阅读次数:168
【Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) B】Weakened Common Divisor
【链接】 "我是链接,点我呀:)" 【题意】 给你n个数对(ai,bi)。 让你求一个大于1的数字x 使得对于任意的i x|a[i] 或者 x|b[i] 【题解】 求出第一个数对的两个数他们有哪些质因子。 显然用这些质因子去试2..n就可以了。 看哪个可以满足 就输出对应的就可以了。 (一开始我求出 ...
分类:其他好文   时间:2018-08-20 10:34:31    阅读次数:158
166条   上一页 1 ... 5 6 7 8 9 ... 17 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!