摘要: lightoj 1215 Finding LCM链接:http://www.lightoj.com/volume_showproblem.php?problem=1215题意:已知 a, b, l和 lcm(a, b, c) = l ,求最小的 c 的值。思路:先找 l 的素因子并判断此因子是否为 a, b 的素因子,如果是,则判断他们各自的欧拉值的大小。因为 c 最大可能等于 l 的值,所以刚开始先把l 的值赋给 c 。 当 l 中的某个素因子的欧拉值(lr1)大于 a,b 中相同的素因子的欧拉值(ar1, br1)时,c中肯定含有次素因子并且欧拉值(cr1 >= lr1),然而 c 阅读全文
posted @ 2013-08-02 20:32 妮king狼 阅读(479) 评论(0) 推荐(0)
摘要: uva 11424 GCD - Extreme (I)题意:思路:(见http://www.cnblogs.com/Duahanlang/p/3184994.html)差别在于数据规模和时间,其他一下,同样的思路,同样的做法代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 typedef long long LL;10 const int N = 200005;11 int e[N];12 LL tag[N];13 14 void eul... 阅读全文
posted @ 2013-08-02 11:32 妮king狼 阅读(334) 评论(0) 推荐(0)