题目描述 求∑i=1n∑j=1n(i,j) mod (1e9+7)n<=1010\sum_{i=1}^n\sum_{j=1}^n(i,j)~mod~(1e9+7)\\n<=10^{10}i=1∑nj=1∑n(i,j) mod (1e9+7)n<=1010 题目分析 乍一看十分像裸莫比乌斯反演,然而nnn的范围让人望而却步 于是先变化一下式子 Ans=∑i=1n∑j=1n(i,j)Ans=\sum_{i=1}^n\sum_{j=1}^n(i,j)Ans=i=1∑nj=1∑n(i,j…
题目链接:51nod 1240 莫比乌斯函数 莫比乌斯函数学习参考博客:http://www.cnblogs.com/Milkor/p/4464515.html #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; int miu(int n){ int i, cnt; ;//质因子个数…
Code Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 300 Accepted Submission(s): 124 Problem Description WLD likes playing with codes.One day he is writing a function.Howerver,his computer b…
GCD Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4291 Accepted Submission(s): 1502 Problem Description Given 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y)…
GCD SUM Time Limit: 8000/4000MS (Java/Others)Memory Limit: 128000/64000KB (Java/Others) SubmitStatisticNext Problem Problem Description 给出N,M执行如下程序:long long ans = 0,ansx = 0,ansy = 0;for(int i = 1; i <= N; i ++) for(int j = 1; j <= M; j ++) …
SPOJ Problem Set (classical) 7001. Visible Lattice Points Problem code: VLATTICE Consider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are visible from corner at (0,0,0) ? A point X is visible…
CO-PRIME 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 This problem is so easy! Can you solve it? You are given a sequence which contains n integers a1,a2……an, your task is to find how many pair(ai, aj)(i < j) that ai and aj is co-prime. 输入 There are mu…