筛法
18级的一条菜鸡
这个作者很懒,什么都没留下…
展开
-
线性筛法 —— 欧拉筛法
首先,先介绍暴力筛法:暴力筛选就是看看一个数能不能被小于它并且大于二的数整除。代码:#include <iostream>#include <cstdio>using namespace std;int main(){ int n; scanf("%d", &n); for(int i = 2; i <= n; i++) { int...原创 2019-01-23 18:10:55 · 376 阅读 · 0 评论 -
vj Wormholes POJ - 3259
题目:While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time th...原创 2019-03-21 21:44:17 · 89 阅读 · 0 评论