Sum 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 给你一个数N,使得在1~N之间能够找到x使得x满足gcd( x , N ) >= M, 求解gcd(x,N)的和 输入 多组测试数据 每行输出两个数N,M(N,M不超int) 输出 输出sum 样例输入 5 3 样例输出 5 上传者 ACM_张书军 #include <bits/stdc++.h> using namespace std; typedef long long ll; cons…
http://acm.nyist.net/JudgeOnline/problem.php?pid=42题目链接 #include <cstdio> #include <cstring> #define CLR(arr) memset(arr,0,sizeof(arr)) #define P 1001 int G[P],fa[P]; int find(int x){return x==fa[x]?x:x=find(fa[x]);} int main() { int n,a,b…
GCD Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1294 Accepted Submission(s): 583 Problem Description The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes writt…
题目: Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant Bi-Shoe to go to the market and buy them. Plenty of Bamboos…