积性函数 积性函数线性筛,筛素数,u(n),欧拉函数: 可以发现,线性筛分为3部分: 1.n本身是素数,这个根据积性函数的定义可得,很容易求。 2.i%prime[j]!=0,这个也是根据积性函数的性质可得。f(a)f(b)=f(a 3.i%prime[j]==0,可能需要找规律。据ljh2000神 Read More
posted @ 2018-08-24 10:04 白雪儿 Views(96) Comments(0) Diggs(0) Edit
数学基础(卷积,FFT,FWT,FMT,鸽巢原理,群论,哈里亚余数,哈里亚计数定理,组合数学,LVG定理,期望DP,期望点贡献问题) 练习题: A - Necklace of Beads Beads of red, blue or green colors are connected togethe Read More
posted @ 2018-08-23 13:03 白雪儿 Views(102) Comments(0) Diggs(0) Edit
暑期热身赛 BAPC 2014 The 2014 Benelux Algorithm Programming Contest 题目网址:https://odzkskevi.qnssl.com/365547ace19a71fae35ca0cfb5a843b3?v=1534772800 B Button Read More
posted @ 2018-08-23 12:56 白雪儿 Views(142) Comments(0) Diggs(0) Edit
凸包模板 写在前面:预备函数 参考博客:https://www.cnblogs.com/nyist-TC-LYQ/p/7208054.html 一、 点的定义: 二、距离公式: 三、叉积:返回结果为正说明p2在向量p0p1的左边(三点构成逆时针方向);返回结果为负说明p2在向量p0p1的右边(三点构 Read More
posted @ 2018-08-19 18:20 白雪儿 Views(315) Comments(0) Diggs(0) Edit
极角排序常用的四种方法: 写在前面:存储点的结构体和函数 1 struct point//存储点 2 { 3 double x,y; 4 }; 5 6 double cross(double x1,double y1,double x2,double y2) //计算叉积 7 { 8 return Read More
posted @ 2018-08-19 18:08 白雪儿 Views(2852) Comments(0) Diggs(4) Edit
计算几何 练习题: F - Beauty Contest POJ - 2187 Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Read More
posted @ 2018-08-19 17:46 白雪儿 Views(221) Comments(0) Diggs(0) Edit
在头文件<algorithm>里面有如下代码: int a[]; do { } while(next_permutation(a,a+n)); 可产生1~n的全排列有如下代码: 1 #include <stdio.h> 2 #include <algorithm> 3 using namespace Read More
posted @ 2018-08-18 13:41 白雪儿 Views(31407) Comments(0) Diggs(20) Edit
计算几何基础 练习题 C - Wasted Time Mr. Scrooge, a very busy man, decided to count the time he wastes on all sorts of useless stuff to evaluate the lost profit Read More
posted @ 2018-08-17 17:10 白雪儿 Views(335) Comments(0) Diggs(0) Edit
莫比乌斯反演 整除分块 模板 莫比乌斯函数: 莫比乌斯函数其实只是一个由容斥系数所构成的函数。 线性筛 模板 莫比乌斯反演: 例题:bzoj1101 [POI2007]Zap Read More
posted @ 2018-08-16 11:40 白雪儿 Views(122) Comments(0) Diggs(0) Edit
gcd(最大公因数),lcm(最小公倍数) Read More
posted @ 2018-08-16 11:22 白雪儿 Views(1688) Comments(0) Diggs(1) Edit