积性函数 积性函数线性筛,筛素数,u(n),欧拉函数: 可以发现,线性筛分为3部分: 1.n本身是素数,这个根据积性函数的定义可得,很容易求。 2.i%prime[j]!=0,这个也是根据积性函数的性质可得。f(a)f(b)=f(a 3.i%prime[j]==0,可能需要找规律。据ljh2000神 Read More
数学基础(卷积,FFT,FWT,FMT,鸽巢原理,群论,哈里亚余数,哈里亚计数定理,组合数学,LVG定理,期望DP,期望点贡献问题) 练习题: A - Necklace of Beads Beads of red, blue or green colors are connected togethe Read More
暑期热身赛 BAPC 2014 The 2014 Benelux Algorithm Programming Contest 题目网址:https://odzkskevi.qnssl.com/365547ace19a71fae35ca0cfb5a843b3?v=1534772800 B Button Read More
凸包模板 写在前面:预备函数 参考博客:https://www.cnblogs.com/nyist-TC-LYQ/p/7208054.html 一、 点的定义: 二、距离公式: 三、叉积:返回结果为正说明p2在向量p0p1的左边(三点构成逆时针方向);返回结果为负说明p2在向量p0p1的右边(三点构 Read More
极角排序常用的四种方法: 写在前面:存储点的结构体和函数 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
计算几何 练习题: 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
在头文件<algorithm>里面有如下代码: int a[]; do { } while(next_permutation(a,a+n)); 可产生1~n的全排列有如下代码: 1 #include <stdio.h> 2 #include <algorithm> 3 using namespace Read More
计算几何基础 练习题 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