gcd
文章平均质量分 65
黑码
这个作者很懒,什么都没留下…
展开
-
uva 10791 (gcd,lcm,最小和表示法,单个质因子总和得凑起来)
Something happened in Uzhlyandia again… There are riots on the streets… Famous Uzhlyandian superheroes Shean the Sheep and Stas the Giraffe were called in order to save the situation. Upon the arriving原创 2017-05-02 16:25:02 · 380 阅读 · 0 评论 -
zoj 1577 (gcd,lcm)求 所有的对数。
Given x and y (2 <= x <= 100,000, 2 <= y <= 1,000,000), you are to count the number of p and q such that:1) p and q are positive integers;2) GCD(p, q) = x;3) LCM(p, q) = y.Input x and y, one line for原创 2017-05-02 16:30:26 · 565 阅读 · 0 评论 -
hdu 5726 gcd rmq 求相同gcd的区间数量
Give you a sequence of N(N≤100,000) integers : a1,…,an(0#include <bits/stdc++.h> using namespace std; typedef long long ll; int n; int gd[100100][18]; map<int,long long> mp;int gcd(int a,int b) { r原创 2017-06-13 19:30:53 · 772 阅读 · 0 评论 -
hdu 5869 求区间不同gcd数 离线+树状数组+rmq二分
This is a simple problem. The teacher gives Bob a list of problems about GCD (Greatest Common Divisor). After studying some of them, Bob thinks that GCD is so interesting. One day, he comes up with a n原创 2017-06-21 11:22:19 · 590 阅读 · 0 评论 -
qduoj cfenglv的一道简单签到题(区间gcd rmq,二分)
cfenglv的一道简单签到题 发布时间: 2017年6月11日 17:59 最后更新: 2017年6月12日 18:51 时间限制: 4000ms 内存限制: 128M描述 据说,julyc决定给学弟学妹出一场月赛,于是他脑中浮现了许多很棒棒的出题创意。而cfenglv恰巧在机房,于是他把一道题的创意说给了cfenglv听:求区间gcd(最大公约数)大于等于k的最大区间长度len这原创 2017-06-12 19:52:23 · 585 阅读 · 0 评论 -
美团编程大赛 数学题 拓展欧几里得和解是否存在
给定四个正整数a,b,c,k,回答是否存在一个正整数n,使得a*n在k进制表示下的各位的数值之和模b为c。 输入描述: 第一行一个整数T(T <= 5,000)。 接下来T行,每行四个正整数a,b,c,k(1 ≤ a ≤ 10^18; 2 ≤ k ≤ 10^18; 0 ≤ c < b ≤ 10^18)表示一个询问,所有输入都是十进制的。输出描述: 对于每组数据输出一行,Yes表示存在,No表原创 2017-07-05 01:26:59 · 811 阅读 · 0 评论 -
hdu 6053 TrickGCD(容斥,分段,莫比乌斯函数)
You are given an array AA , and Zhu wants to know there are how many different array BB satisfy the following conditions? 1≤Bi≤Ai1≤Bi≤Ai For each pair( l , r ) (1≤l≤r≤n1≤l≤r≤n) , gcd(bl,bl+1…br)≥2gcd原创 2017-07-28 17:15:46 · 410 阅读 · 0 评论 -
codeforces 837E 数论
Vasya is studying number theory. He has denoted a function f(a, b) such that: f(a, 0) = 0;f(a, b) = 1 + f(a, b - gcd(a, b)), where gcd(a, b) is the greatest common divisor of aand b. Vasya has two原创 2017-11-10 15:06:25 · 922 阅读 · 0 评论