数论
-skyline-
这个作者很懒,什么都没留下…
展开
-
HDU 1222 Wolf and Rabbit
Problem DescriptionThere is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlockwise order. The first ...原创 2018-11-28 12:55:12 · 128 阅读 · 0 评论 -
P1563 玩具谜题
#include<bits/stdc++.h>using namespace std;struct pp{ string name; int face;//朝向}a[100005];int main(){ int n,m; cin>>n>>m; int f,c; for(int i=0;i<n;++i){ scanf("%d",&...原创 2019-01-18 15:54:37 · 170 阅读 · 0 评论 -
洛谷 P1029 最大公约数和最小公倍数问题
题目链接#include<bits/stdc++.h>using namespace std;//maxv=15485863,n=1000000//maxv=1299709, n=100000//maxv=1000003, n=78499const int maxv=1000003;const int n=78500;bool check[maxv];int pr...原创 2019-02-17 12:00:46 · 239 阅读 · 0 评论 -
线性筛素数
看了这几个博客看懂的,然后自己写了一版,以后有时间再为此作讲解。https://www.cnblogs.com/grubbyskyer/p/3852421.htmlhttps://www.cnblogs.com/zhoushuyu/p/8275530.htmlhttps://www.acwing.com/blog/content/28/以下模板,要在理解的基础上默写。#inc...原创 2019-02-11 19:19:21 · 226 阅读 · 0 评论 -
快速幂
https://www.luogu.org/problemnew/solution/P1226 这篇写得很好#include<bits/stdc++.h>using namespace std;typedef long long ll;const int MOD = 1e9 + 7;ll poww(ll a, ll b){ ll ans = 1, base =...原创 2019-02-18 14:55:58 · 92 阅读 · 0 评论