数论
ZONE画派
正在学习计算机视觉相关
展开
-
20140714 「初等数论 - 拓展欧几里得+同余模方程」POJ 1061 青蛙的约会
Online JudgeProblem SetAuthorsOnline ContestsUserWeb BoardHome PageF.A.QsStatistical ChartsProblemsSubmit ProblemOnline StatusProb.ID:RegisterUpdate your infoAu原创 2014-07-14 17:06:06 · 831 阅读 · 0 评论 -
20141002 【 数论--概率 】 hdoj 5035 Delivery
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-10-02 11:55:15 · 685 阅读 · 0 评论 -
20141001 【 高精度?/数论--斐波那契数列 】 hdoj 1568 Fibonacci
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime J原创 2014-10-01 17:55:30 · 1667 阅读 · 0 评论 -
20141002 【 数论——组合数 】 UVa 10375 Choose and divide
E. Choose and divideTime Limit: 3000msMemory Limit: 131072KB64-bit integer IO format: %lld Java class name: MainSubmit Status[PDF Link]Problem D: Choose and divide原创 2014-10-02 16:34:37 · 680 阅读 · 0 评论 -
20140930 【 数论 -- 本福特定律 】 2014-上海区域赛-网络预选赛 hdoj 5051 Fraction
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-09-30 17:34:39 · 1150 阅读 · 0 评论 -
20140925 【 初等数论--欧拉函数 】 UVa 10214 - Trees in a Wood
Problem HTrees in a Wood.Input: Standard InputOutput: Standard OutputTime Limit: 10 secondsBackgroundThe saying ``You can't see the wood for the trees'' is not only a cliche, but is al原创 2014-09-25 11:31:38 · 721 阅读 · 0 评论 -
【初等数论】 求一个数有多少约数及所有约数之和、分解质因数
今天做题遇见,于是就搜了一下,于是就有了这篇文章。(其实我不知道原理....Orz)我觉得分解质因数的最优算法应该不是我这篇文章中的这个.....谁有好的算法可以给我说一下,谢谢。 1.有多少个约数:先分解质因数因数的次数分别是4,2,1所以约数的个数为(4+1)*(2+1)*(1+1)=5*3*2=30个eg:先分解质因数720=2^4*3^2*5因数的转载 2014-09-07 09:22:41 · 3912 阅读 · 1 评论 -
20140915 【 数论 - Miller_Rabin素数测试 】 51nod 1106 . 质数检测
#include #include #include typedef long long LL;LL Pow(LL a, LL n, LL mod){ LL an = 1; a %= mod; while( n ){ if( n&1 ) n--, an = an*a%mod; n >>= 1; a = a*a%m原创 2014-09-15 11:15:34 · 929 阅读 · 0 评论 -
20140926 【 初等数论 】 51nod 1179 . 最大的最大公约数
#include #include #include using namespace std;typedef long long LL;const int MAXN = 1e6 + 10;LL gcd(LL a, LL b){ return b ? gcd(b, a%b) : a;}int n;LL a[MAXN], x;int main(){ while原创 2014-09-26 21:22:47 · 1282 阅读 · 0 评论 -
20140911 【 初等数论 】 poj 2262 Goldbach's Conjecture
#include #include using namespace std;#define MAXN 1000000char prime[MAXN/7];int p[MAXN+10];int np, n;void init(){ prime[0] = 3; np = 0; for(int i=2; i<MAXN; i++) if( !( pri原创 2014-09-11 20:14:00 · 788 阅读 · 0 评论 -
20140911 【 初等数论 】 51nod 1113 . 矩阵快速幂
徐华杰 矩阵乘法 修改1113 . 矩阵快速幂基准时间限制:3 秒 空间限制:65536 KB 分值: 40给出一个N * N的矩阵,其中的元素均为正整数。求这个矩阵的M次方。由于M次方的计算结果太大,只需要输出每个元素Mod (10^9 + 7)的结果。Input第1行:2个数N和M,中间用空格分隔。N原创 2014-09-11 10:04:28 · 901 阅读 · 0 评论 -
【 Lucas定理 】 组合数取模
组合数取模在ACM竞赛中是一个很重要的问题,很多选手因为数据太大而束手无策,今天就来详细讲解它。 组合数取模就是求的值,当然根据,和的取值范围不同,采取的方法也不一样。 接下来,我们来学习一些常见的取值情况 (1)和 这个问题比较简单,组合数的计算可以靠杨辉三角,那么由于和的范围小,直接两层循环即可。 (2)转载 2014-09-12 13:37:19 · 558 阅读 · 0 评论 -
20140911 【 初等数论 】 51nod 1242 . 斐波那契数列的第N项
徐华杰 斐波那契数列 数论 修改1242 . 斐波那契数列的第N项基准时间限制:1 秒 空间限制:65536 KB 分值: 0斐波那契数列的定义如下:F(0) = 0F(1) = 1F(n) = F(n - 1) + F(n - 2) (n >= 2)(1, 1, 2, 3, 5, 8原创 2014-09-11 09:47:18 · 798 阅读 · 0 评论 -
20140714 「初等数论 - 拓展欧几里得+同余模方程」POJ 2115 C Looooops
Online JudgeProblem SetAuthorsOnline ContestsUserWeb BoardHome PageF.A.QsStatistical ChartsProblemsSubmit ProblemOnline StatusProb.ID:RegisterUpdate your infoAu原创 2014-07-14 17:03:32 · 636 阅读 · 0 评论 -
20140714 「初等数论 - 中国剩余定理」 POJ 1006 Biorhythms
数论:拓展欧几里得 + 同余模方程模板一份。题解嘛,有空再补。。。(其实就是模板题。)#include #include using namespace std;typedef long long LL;int main(){ //freopen("1006.in","r",stdin); LL p, e, i, d, n=21252, no=0; whi原创 2014-07-14 18:56:41 · 1001 阅读 · 0 评论 -
20140714 「初等数论 - 卡特兰数」 POJ 2084 Game of Connections
import java.util.*;import java.math.*;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int MAXN = 202; BigInteger[] a = new BigInteger[MAXN];原创 2014-07-14 20:57:41 · 714 阅读 · 0 评论 -
【 整数划分 - 问题 】
整数划分问题是算法中的一个经典命题之一,有关这个问题的讲述在讲解到递归时基本都将涉及。所谓整数划分,是指把一个正整数n写成如下形式: n=m1+m2+...+mi; (其中mi为正整数,并且1 如果{m1,m2,...,mi}中的最大值不超过m,即max(m1,m2,...,mi) 例如但n=4时,他有5个划分,{4},{3,1},{2转载 2014-10-04 12:19:46 · 522 阅读 · 0 评论