数论
qdu_ellery
我有梦想啊!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj3070 Fibonacci(矩阵快速幂模板)
#include<iostream> using namespace std; typedef long long LL; struct mat{ int m[2][2]; }; mat mul(mat a,mat b){ mat ans; for(int i=0;i<2;i++){ for(int j=0;j<2;j++){ ans.m[i][j]=0...原创 2019-04-21 14:59:05 · 131 阅读 · 0 评论 -
大数模板
大数减法模板 #include<iostream> #include<cstring> #include<cstdlib> #define maxn 1000 using namespace std; int a[maxn], b[maxn]; bool myStrcmp(const char str1[], const char str2[]) { ...原创 2019-09-05 22:25:58 · 158 阅读 · 0 评论 -
A/B(数论)(取模)
要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input 数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。 Output 对应每组数据输出(A/B)%9973。 Sample Input 2 1000 53...原创 2019-07-21 17:03:18 · 1872 阅读 · 1 评论 -
POJ1061 青蛙的约会(扩展欧几里得模板)(数论)
两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,...原创 2019-05-15 22:08:27 · 127 阅读 · 0 评论 -
POJ1061 青蛙的约会(扩展欧几里得模板)(数论)
两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,...原创 2019-05-15 22:08:17 · 107 阅读 · 0 评论 -
HDU 4704 Sum(隔板原理+组合数求和公式+费马小定理+快速幂)
#include<iostream> #include<string.h> using namespace std; typedef long long LL; #define mod 1000000007 char s[1000000]; LL bp(LL a,LL b){ LL ans=1; LL res=a; while(b){ if(b&1){ ...原创 2019-04-23 23:16:41 · 133 阅读 · 0 评论 -
HDU 4704 Sum(隔板原理+组合数求和公式+费马小定理+快速幂)
#include<iostream> #include<string.h> using namespace std; typedef long long LL; #define mod 1000000007 char s[1000000]; LL bp(LL a,LL b){ LL ans=1; LL res=a; while(b){ if(b&1){ ...原创 2019-04-23 23:16:31 · 150 阅读 · 0 评论 -
HDU 4704 Sum(隔板原理+组合数求和公式+费马小定理+快速幂)
https://www.cnblogs.com/Annetree/p/7097750.html原创 2019-04-23 22:15:30 · 106 阅读 · 0 评论 -
HDU 4704 Sum(隔板原理+组合数求和公式+费马小定理+快速幂)
https://www.cnblogs.com/Annetree/p/7097750.html原创 2019-04-23 22:15:20 · 135 阅读 · 0 评论 -
hdu 4549 M斐波那契数列 数论 矩阵
#include<iostream> using namespace std; typedef long long LL; struct mat{ LL m[2][2]; }; mat mul(mat a,mat b){ mat ans; for(int i=0;i<2;i++){ for(int j=0;j<2;j++){ ans.m[i][j]=0;...原创 2019-04-23 21:18:40 · 121 阅读 · 0 评论 -
hdu 4549 M斐波那契数列 数论 矩阵
#include<iostream> using namespace std; typedef long long LL; struct mat{ LL m[2][2]; }; mat mul(mat a,mat b){ mat ans; for(int i=0;i<2;i++){ for(int j=0;j<2;j++){ ans.m[i][j]=0;...原创 2019-04-23 21:18:30 · 154 阅读 · 0 评论 -
Reading comprehension HDU - 4990(矩阵快速幂+构造矩阵)
#include<iostream> using namespace std; typedef long long LL; LL n,m; struct mat{ LL m[3][3]; }; mat mul(mat a,mat b){ mat ans; for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ ans.m[...原创 2019-04-27 02:09:46 · 138 阅读 · 0 评论 -
Reading comprehension HDU - 4990(矩阵快速幂+构造矩阵)
#include<iostream> using namespace std; typedef long long LL; LL n,m; struct mat{ LL m[3][3]; }; mat mul(mat a,mat b){ mat ans; for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ ans.m[...原创 2019-04-27 02:09:35 · 99 阅读 · 0 评论 -
数论:逆元,扩展欧几里得模板
https://www.cnblogs.com/neopenx/p/4093951.html原创 2019-04-21 20:06:24 · 113 阅读 · 0 评论 -
数论:逆元,扩展欧几里得模板
https://www.cnblogs.com/neopenx/p/4093951.html原创 2019-04-21 20:06:14 · 162 阅读 · 0 评论 -
poj3070 Fibonacci(矩阵快速幂模板)
#include<iostream> using namespace std; typedef long long LL; struct mat{ int m[2][2]; }; mat mul(mat a,mat b){ mat ans; for(int i=0;i<2;i++){ for(int j=0;j<2;j++){ ans.m[i][j]=0...原创 2019-04-21 14:59:15 · 145 阅读 · 0 评论 -
米勒罗宾素数检测模板
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #define LL unsigned long long//注意这个longlong的定义,必须有 unsigned using namespace std; //米勒 罗宾算法模版 ==...原创 2019-09-20 20:56:51 · 222 阅读 · 0 评论
分享