数论
Rancho__
这个作者很懒,什么都没留下…
展开
-
乘法逆元-洛谷-P3811
题目背景这是一道模板题题目描述给定n,p求1~n中所有整数在模p意义下的乘法逆元。输入输出格式输入格式: 一行n,p 输出格式: n行,第i行表示i在模p意义下的逆元。 输入输出样例输入样例#1:10 13输出样例#1:179108112534说明1≤n≤3×10^6 , n<p<20...原创 2018-10-28 19:36:15 · 98 阅读 · 0 评论 -
Supreme Number
A prime number (or a prime) is a natural number greater than 11 that cannot be formed by multiplying two smaller natural numbers.Now lets define a number NN as the supreme number if and only if each...原创 2018-09-11 10:30:56 · 113 阅读 · 0 评论 -
素数计算之埃氏筛法、欧拉筛法
埃氏筛法int main(){ const int maxNumber=200; int isPrime[maxNumber]; int i; int x; for (i=0;i<maxNumber;i++) { isPrime[i]=1; } for (x=2;x<maxNumber;x++) { if (isPrime[x]) { for...原创 2018-09-09 17:05:20 · 167 阅读 · 0 评论 -
POJ-2891 Strange Way to Express Integers(拓展中国剩余定理)
放一个写的不错的博客:https://www.cnblogs.com/zwfymqz/p/8425731.htmlPOJ好像不能用__int128。#include <iostream>#include <stdio.h>typedef long long ll;const int maxn=1e6+10;ll m[maxn],r[maxn];void e...原创 2019-08-19 14:44:48 · 116 阅读 · 0 评论 -
欧拉函数
在数论,对正整数n,欧拉函数是小于或等于n的正整数中与n互质的数的数目(因此φ(1)=1)。互质是公约数只有1的两个整数,叫做互质整数。原创 2019-08-23 16:54:03 · 71 阅读 · 0 评论