
----------数论----------
文章平均质量分 51
xmzyt1996
这个作者很懒,什么都没留下…
展开
-
HDU 4548 美素数 // 素数筛法
题目描述美素数解题思路参考代码#include <stdio.h>#include <string.h>const int maxn = 1000010;bool IsPrime[maxn];int Prime[maxn/2];int ans[maxn];void GetPrime(){ int tot = 0; memset(IsPrime,true,sizeof(Is原创 2015-07-26 17:26:18 · 385 阅读 · 0 评论 -
FOJ 1402 猪的安家 // 中国剩余定理
题目描述Problem 1402 猪的安家解题思路中国剩余定理的模板题。。参考代码#include<iostream>using namespace std;typedef __int64 ll;const int maxn = 1010;ll a[maxn],b[maxn];ll extended_euclid(ll a, ll b, ll &x, ll &y) { ll d原创 2015-06-01 23:00:27 · 486 阅读 · 0 评论 -
HDU 4291 A Short problem // 矩阵快速幂, 循环节
题目描述HDU 4291 A Short problem解题思路题目大意:g(n)g(n) = 3g(n−1)g(n - 1) + g(n−2)g(n - 2) 其中, g(0)g(0) = 0, g(1)g(1) = 1求 g(g(g(n)))g(g(g(n))) mod 1000000007将递推关系变形为 : (g(n+1)g(n))\begin{pmatrix} g(n+1) \\原创 2015-08-12 22:43:56 · 407 阅读 · 0 评论 -
UVALive 6428 A+B // 扩展欧几里德
Problem Description There is a computer, which has two memory cells (let us denote these cells by the letters a and b). Each cell (variable) stores some integer at any time. The computer can execute原创 2015-10-02 23:10:11 · 609 阅读 · 0 评论