kZjPBD.jpg

随笔分类 -  数学——莫比乌斯反演/杜教筛

摘要:题解+CODE:https://blog.csdn.net/CrazyForsaken/article/details/100186979 积性函数线性筛 阅读全文
posted @ 2019-09-03 20:44 Through_The_Night 阅读(352) 评论(0) 推荐(0) 编辑
摘要:Problem Description One day, Touma Kazusa encountered a easy math problem. Given n and k, she need to calculate the following sum modulo 1e9+7.∑ni=1∑n 阅读全文
posted @ 2019-08-13 10:51 Through_The_Night 阅读(428) 评论(0) 推荐(0) 编辑
摘要:SOLUTION: https://www.90yang.com/2019hdu-multi1-k-function/ phi 卷 id 不会线性筛 https://www.cnblogs.com/DeaphetS/p/11228116.html phi 卷 id 不会线性筛 这有一个nlogn的筛 阅读全文
posted @ 2019-08-01 15:38 Through_The_Night 阅读(338) 评论(0) 推荐(0) 编辑
摘要:Given a positive integers nn , Mobius function \mu(n)μ(n) is defined as follows: \displaystyle \mu(n) = \begin{cases} 1 &n = 1 \\ (-1)^k & n = p_1p_2\ 阅读全文
posted @ 2019-07-17 13:21 Through_The_Night 阅读(244) 评论(0) 推荐(0) 编辑
摘要:题目描述 由于出题人懒得写背景了,题目还是简单一点好。 输入一个整数n和一个整数p,你需要求出(∑i=1n∑j=1nijgcd(i,j)) mod p(\sum_{i=1}^n\sum_{j=1}^n ijgcd(i,j))~mod~p(∑i=1n​∑j=1n​ijgcd(i,j)) mod p,其 阅读全文
posted @ 2019-05-25 21:01 Through_The_Night 阅读(354) 评论(0) 推荐(0) 编辑
摘要:这是一道比较基础的数论题。 给出一个整数 nnn,计算 ∑i=1n∑j=1nμ(gcd⁡(i,j))\sum_{i=1}^n \sum_{j=1}^n \mu(\gcd(i,j))∑i=1n​∑j=1n​μ(gcd(i,j))。 其中 gcd⁡(i,j)\gcd(i,j)gcd(i,j) 表示 i, 阅读全文
posted @ 2019-05-23 17:51 Through_The_Night 阅读(213) 评论(0) 推荐(0) 编辑
摘要:题目描述 我们知道,从区间[L,H](L和H为整数)中选取N个整数,总共有(H-L+1)^N种方案。小z很好奇这样选出的数的最大公约数的规律,他决定对每种方案选出的N个整数都求一次最大公约数,以便进一步研究。然而他很快发现工作量太大了,于是向你寻求帮助。你的任务很简单,小z会告诉你一个整数K,你需要 阅读全文
posted @ 2019-04-08 07:50 Through_The_Night 阅读(214) 评论(0) 推荐(0) 编辑
摘要:题目描述 给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的数对(x,y)有多少对. 输入输出格式 输入格式: 一个整数N 输出格式: 答案 输入输出样例 输入样例#1: 复制 4 输出样例#1: 复制 4 输入样例#1: 复制 4 输出样例#1: 复制 4 说明 对于样例(2,2),(2, 阅读全文
posted @ 2019-03-14 20:42 Through_The_Night 阅读(152) 评论(0) 推荐(0) 编辑
摘要:目描述 对于给出的n个询问,每次求有多少个数对(x,y),满足a≤x≤b,c≤y≤d,且gcd(x,y) = k,gcd(x,y)函数为x和y的最大公约数。 输入输出格式 输入格式: 第一行一个整数n,接下来n行每行五个整数,分别表示a、b、c、d、k 输出格式: 共n行,每行一个整数表示满足要求的 阅读全文
posted @ 2019-03-09 21:58 Through_The_Night 阅读(115) 评论(0) 推荐(0) 编辑
摘要:题目描述 Byteasar the Cryptographer works on breaking the code of BSA (Byteotian Security Agency). He has alreadyfound out that whilst deciphering a messa 阅读全文
posted @ 2019-03-09 21:49 Through_The_Night 阅读(166) 评论(0) 推荐(0) 编辑
摘要:1 const int maxn=60000+5; 2 bool vis[maxn]; 3 int prime[maxn],mu[maxn]; 4 void init_mu(int n){ 5 int cnt=0; 6 mu[1]=1; 7 for(int i=2;i<n;i++){ 8 if(!vis[i]){ 9 ... 阅读全文
posted @ 2019-02-02 11:47 Through_The_Night 阅读(241) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示