上一页 1 2 3 4 5 6 7 8 9 ··· 28 下一页

2015年2月24日

uva11426(莫比乌斯反演)

摘要: 传送门:GCD Extreme (II)题意:给定n(n#include #include #include #include #include #include #include #include #include #include #include #include #define LL lon... 阅读全文

posted @ 2015-02-24 11:07 lienus 阅读(350) 评论(0) 推荐(0)

2015年2月21日

SPOJ 7001(莫比乌斯反演)

摘要: 传送门:Visible Lattice Points题意:0#include #include #include #include #include #include #include #include #include #include #include #include #define LL l... 阅读全文

posted @ 2015-02-21 02:00 lienus 阅读(198) 评论(0) 推荐(0)

SPOJ PGCD(莫比乌斯反演)

摘要: 传送门:Primes in GCD Table题意:给定两个数和,其中,,求为质数的有多少对?其中和的范围是。分析:这题不能枚举质数来进行莫比乌斯反演,得预处理出∑υ(n/p)(n%p==0).#pragma comment(linker,"/STACK:1024000000,1024000000"... 阅读全文

posted @ 2015-02-21 00:59 lienus 阅读(228) 评论(0) 推荐(0)

2015年2月20日

ACdream 1114(莫比乌斯反演)

摘要: 传送门:Number theory题意:给n个数,n 和 每个数的范围都是 1---222222,求n个数中互质的对数。分析:处理出每个数倍数的个数cnt[i],然后进行莫比乌斯反演,只不过这里的F(i)=cnt[i]*(cnt[i]-1)/2.#pragma comment(linker,"/ST... 阅读全文

posted @ 2015-02-20 22:21 lienus 阅读(191) 评论(0) 推荐(0)

ACdream 1148(莫比乌斯反演+分块)

摘要: 传送门:GCD SUM题意:给出N,M执行如下程序:long long ans = 0,ansx = 0,ansy = 0;for(int i = 1; i #include #include #include #include #include #include #include #include... 阅读全文

posted @ 2015-02-20 21:44 lienus 阅读(186) 评论(0) 推荐(0)

bzoj2301(莫比乌斯反演+分块)

摘要: 传送门:2301: [HAOI2011]Problem b题意:对于给出的n个询问,每次求有多少个数对(x,y),满足a≤x≤b,c≤y≤d,且gcd(x,y) = k,gcd(x,y)函数为x和y的最大公约数。分析:gcd(x,y)==k等价于gcd(x/k,y/k)==1,根据莫比乌斯反演很容易... 阅读全文

posted @ 2015-02-20 17:53 lienus 阅读(313) 评论(0) 推荐(0)

hdu1695(莫比乌斯反演)

摘要: 传送门:GCD题意:求[1,n],[1,m]gcd为k的对数。分析:莫比乌斯入反演门题,gcd(x,y)==k等价于gcd(x/k,y/k)==1,求出[1,n][1,m]互质的对数,在减去[1,2][2,1]之类重复的个数即答案。莫比乌斯反演资料:贾志鹏线性筛 莫比乌斯反演入... 阅读全文

posted @ 2015-02-20 16:33 lienus 阅读(152) 评论(0) 推荐(0)

2015年2月18日

hdu4908(中位数)

摘要: 传送门:BestCoder Sequence题意:给一个序列,里面是1~N的排列,给出m,问以m为中位数的奇数长度的序列个数。分析:先找出m的位置,再记录左边比m大的状态,记录右边比m大的状态,使得左右两边状态平衡(和为0)就是满足的序列。举例:7 41 5 4 2 6 3 7ans=8m的位置po... 阅读全文

posted @ 2015-02-18 23:23 lienus 阅读(198) 评论(0) 推荐(0)

bzoj1497(最小割)

摘要: 传送门:最大获利题意:建立n个中转站,每个花费P[i],有m个用户,使用Ai和Bi中转站可获利Ci,问最终建立哪几个中转站使获利最大?分析:根据最大权闭合图建图,用户群和中转站为带权的点集,用户群的权为收益,中转站的权为负的成本:从源s连弧到正权值的点,容量为次正权值。从负权值的点连弧到汇t,容量为... 阅读全文

posted @ 2015-02-18 11:33 lienus 阅读(205) 评论(0) 推荐(0)

2015年2月17日

hdu3605(最大流+状态压缩)

摘要: 传送门:Escape题意:给出每个人适合住的星球信息和该星球能住多少人 ,第一行给出n m 代表有 n 个人 m 个星球,然后接下来n行每行m个数字 1代表适合第 i 个星球 0 代表不适合第 i 个星球,最后一行m个数表示第 i 个星球最多可以住多少个人,问是不是所有人都可以住到星球上。分析:很裸... 阅读全文

posted @ 2015-02-17 23:04 lienus 阅读(155) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 ··· 28 下一页

导航