E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
LLA
poj 2685 GCD快速幂
(am-bm,an-bn)=agcd(m,n)-bgcd(m,n)#include#include#include#include#definelllonglongusingnamespacestd;
lla
zjyang12345
·
2020-08-24 12:01
快速幂
解方程
—————数论—————
ACM
数论
【HDU】 2020暑期杭电多校第八场
for(inti=a;i>t;while(t--)usingnamespacestd;typedeflonglongll;typedefunsignedlonglongull;inlinellgcd(
lla
hcCuriosity
·
2020-08-24 11:27
杭电多校
题解
学习笔记:扩展欧几里得算法(持续更新)
欧几里得算法著名的辗转相除法,用于求a,b的最大公因数(greatestcommondivisor)代码如下:LLgcd(
LLa
,LLb){return!b?
星辰大少主
·
2020-08-24 11:18
学习笔记/板子
数学
扩展欧几里得算法 数学证明【详解】
llexgcd(
lla
,llb,ll&x,ll&y){llans,t;if(b==0)//gcdborder{x=1;y=0;returna;//returnfinalgcd}ans=exgcd(b,a
super_machine_gun
·
2020-08-24 11:50
类欧几里得模板
类欧几里得模板存个类欧几里德模板,想看看原理就看看敦哥(洪华敦)的教程敦哥无敌llinv2=qpow(2,mod-2);llsum(
lla
,llb,llc,lln){if(!
TRZNDP_Z
·
2020-08-24 11:45
模板
845G - Shortest Path Problem?(线性基)
线性基~1#include2usingnamespacestd;3#definelllonglong4structLiBase{5
lla
[63];6//初始化7voidinit(){8memset(a,
weixin_30873847
·
2020-08-24 10:21
C. Ayoub and Lost Array(思维dp)
includeusingnamespacestd;#definelllonglongconstllmod=1e9+7;lldp[200000+5][5];intmain(){lln,l,r;while(cin>>n>>l>>r){
lla
vagrancy7
·
2020-08-24 10:47
题目
dp
P5170 [模板] 类欧几里得算法
>=c)(ausingnamespacestd;typedeflonglongll;constintMod=998244353,inv2=(Mod+1)/2,inv6=(Mod+1)/6;llmul(
lla
FSYo
·
2020-08-24 10:03
牛客算法周周练15——A、B
AC代码:#include#definelllonglongusingnamespacestd;intmain(){lln=0;
lla
[
Friends.
·
2020-08-24 09:32
ACM
线段树模板
lltree1[10000000];lltree2[10000000];lltree3[10000000];lllazy[10000000];llp;
lla
,b,c,d,e,f,g,h;voidWeihu
v1dv1dv1d
·
2020-08-24 09:00
线段树
2019杭电多校第四场1003题解
a:b;}inlinellgcd(
lla
,llb){returnb==0?a:gcd(b,a%b);}inlinellexgcd(
lla
,llb,ll&x,ll&y){lld
V4yne.
·
2020-08-24 09:44
思维
牛客挑战赛39 C 牛牛的等差数列(线段树)(*)
题目链接#include#definelllonglongusingnamespacestd;constintmaxn=2e5+50;intval[maxn];
lla
[maxn>1;build(rt>1
qq_42479630
·
2020-08-24 09:04
线段树
【51nod - 1098】 最小方差(基础数学,公式化简,前缀和,积的前缀和)
Input第1行:2个数M,N,(M>N,M#definelllonglongusingnamespacestd;constintMAXN=1e4+5;
lla
韬光养晦_
·
2020-08-24 09:15
水题纪念
前缀和
数学
51nod1119 机器人走方格v2(逆元+组合数)
(2usingnamespacestd;typedeflonglongll;constintmod=1e9+7;llqpow(
lla
,llb,llmod){llans=1;while(b){if(b&1
青鱼一条
·
2020-08-24 09:42
数论
牛客练习赛51
子串的定义就是存在任意下标a#definelllonglong#defineinf0x3f3f3f3f3f3f3f3fLLusingnamespacestd;
lla
,ab,abc,n;strings;intmain
20164235
·
2020-08-24 09:06
HDU 2669 Romantic 拓展欧几里得模板题
#include#includeusingnamespacestd;typedeflonglongLL;voidgcd(
LLa
,LLb,LL&d,LL&x,LL&y){if(!
小萨摩
·
2020-08-24 09:49
算法
Codeforces Round #643 (Div. 2)C
z三个整数满足a#definelllonglongusingnamespacestd;intmain(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
lla
丶di
·
2020-08-24 08:44
codeforces题解
[BZOJ3817][Sum][类欧几里得算法 数论]
1n(bx+c−⌊bx+ca⌋aa)i+⌊bx+ca⌋∗C2n当k=1和kusingnamespacestd;typedeflonglongll;llT,n,m;doublet;inlinellgcd(
lla
g1n0st
·
2020-08-24 08:57
2017
Bzoj
数论
类欧几里得算法
oi
数论
类欧几里得算法
牛客算法周周练1题解
:要最大的美丽#includeusingnamespacestd;typedeflonglongll;typedefpairpii;constintN=1e5+10;constintM=2e5+10;
lla
wish2lucky
·
2020-08-24 07:44
0830-扩展欧几里得算法+例题
phew~终于看懂了,以前一直以为很高深很高深的算法,结果还是很简单嘛-->参考资料#include#include#definelllonglongusingnamespacestd;voidexgcd(
lla
Faithfully__xly
·
2020-08-24 07:49
Codeforces Round #316 (Div. 2) D. Tree Requests(dsu)
#include#definelllonglongintusingnamespacestd;inlinellgcd(
lla
,llb){returnb?
weixin_30537391
·
2020-08-24 07:35
Codeforces Round #495 (Div. 2) C. Sonya and Robots(模拟)
codeforces.com/contest/1004/problem/C题意:给你n个数字,询问你有多少对(i(iusingnamespacestd;typedeflonglongll;constintmaxn=1e5+5;
lla
yiqzq
·
2020-08-23 22:12
ACM_模拟
hdu1124
include#include#include#include#include#includeusingnamespacestd;constintmaxn=1e9+1;typedeflonglongll;
lla
lliinnhhhan
·
2020-08-23 17:57
我只是菜逼——数论
求将序列变成严格上升序列的最少操作次数
求将序列变成严格上升序列的最少操作次数,考虑i=j-i,a[i]-i#definelllonglong#defineINF0x7fffffff#defineMAXN3010usingnamespacestd;intn;
lla
至尊宝_water
·
2020-08-23 15:58
ACM暑期集训
hdu-6189- Law of Commutation
ac代码:#include#include#include#includeusingnamespacestd;typedeflonglongll;llpow1(
lla
,lln)//快速幂a^n{llan
东曦哥哥
·
2020-08-23 11:42
c++语言
数论
青岛区域赛备战--模板及复习--简单算法
1、快速幂2、LIS及其变形快速幂LLPow(
LLa
,LLn,LLmod){LLt=1;for(;n;n>>=1,a=(a*a%mod))if(n&1)t=(t*a%mod);returnt;}LISinta
Johnson1141
·
2020-08-23 08:13
acm
dp
图论
2019徐州网络A(中国剩余定理非互质m+判断斐波那契数)
先找出最小的n,在判断n经过博弈决定谁赢找出n的过程是中国剩余定理的变种,未给m互质的条件,证明过程https://www.iteye.com/blog/yzmduncan-1323599板子:voidgcd(
LLa
怎么老是你
·
2020-08-23 08:35
中国剩余定理
徐州网络赛
洛谷 P4752 Divided Prime
includeusingnamespacestd;typedeflonglongll;constintmaxn=200000+100;intprime[maxn],tot;boolisprime[maxn];
lla
ITKaven
·
2020-08-23 06:49
ACM
洛谷
快速乘(模板)
快速乘和快速幂原理一样主要用于是64bit整数乘法时会爆longlong但是写高精度又太麻烦的情况代码#include#definelllonglongusingnamespacestd;inlinellksc(
lla
BIGBIGPPT
·
2020-08-23 04:32
分治
快速乘
乘法逆元
#include#definelllonglongllexgcd(
lla
,llb,ll&x,ll&y){if(b==0){x=1;y=0;returna;}llgcd=exgcd(b,a%b,y,x);
saplingyang
·
2020-08-23 02:49
我的算法小笔记
二分+RMQ——洛谷 P1419 寻找段落
这有一个简单的方法,就是把a[]每个数劝减去mid;然后判断有没有一段的和>0;这个用RMQ就好了;#include#defineLllonglongusingnamespacestd;constLlN=1e5+5;
Lla
largecub233
·
2020-08-23 01:20
二分
RMQ
单调队列
【日常学习】【数学】【矩阵乘法】【大数乘方取模】codevs1982 加密算法题解
…,E[n]},且E[1]=E[2]=p(p为一个质数),E[i]=E[i-2]*E[i-1](若2>=1;}returnc;}}ma;inlinellread(){charch=getchar();
lla
ametake
·
2020-08-23 01:56
日常学习
数学
zjnu 1186 乘积最大(区间DP)
那么就有dp[i][j]=max(dp[k][j-1]*x),这里1#include#definell__int64llmax(
lla
,llb){returna>b?a:b;}intmain()
sprite_
·
2020-08-23 01:42
动态规划----------
区间dp
[组合数]lucas定理 排列组合取模
范围大时可以预处理阶乘逆元O(1)计算constintFN=1e5+10;constintMOD=1e9+7;llfac[FN]={1,1},inv[FN]={1,1},f[FN]={1,1};llC(
lla
Zeolim
·
2020-08-23 01:58
技巧
数论
模板
题解 CF448E 【Divisors】
#include#include#definelllonglongusingnamespacestd;
lla
,b,tot;voiddfs(llx,lly){if(tot>=100000)return;if
A_zjzj
·
2020-08-23 00:39
洛谷 P1029 最大公约数和最小公倍数问题 Label:Water&&非学习区警告
y0(22#include3#include4#include5#include6#definelllonglong7usingnamespacestd;8llx,y;9llans;1011llgcd(
lla
weixin_34319999
·
2020-08-22 14:53
Codeforces Round #483 (Div. 1) A B C
包含就行,但是注意每次要把$b=gcd$,不然TLE#includeusingnamespacestd;typedeflonglongLL;typedefunsignedlonglongULL;LLGcd(
LLa
TongChu
·
2020-08-22 12:09
算法
动态规划
数学
质数
gcd
FastStone Capture安装包&正版激活码&使用说明
FastStoneCapture安装包&正版激活码&使用说明下载路径:链接:https://pan.baidu.com/s/1KytvdNsgEsWAocyqv0-
LlA
提取码:c9an一:下载安装程序
陈玉满
·
2020-08-22 04:17
软件
拓展欧几里得求逆元
#include#includeusingnamespacestd;#defineLLlonglongvoidexgcd(
LLa
,LLb,LL&x,L
_leon1999
·
2020-08-22 04:32
2018春季培训
数论
2017 ACM-ICPC EC-Final 一些题解
nk)\sum_{i=k}^{n}{n\choosek}∑i=kn(kn),n#definelllonglongusingnamespacestd;constllmod=1e9+7;llpow_mod(
lla
limn2o4
·
2020-08-22 02:31
ACM
Contest
给定一个数输出它重复n遍的数
#include#include#include#include#definelllonglong#definemod1000000007usingnamespacestd;llqpow(
lla
Sleppypot
·
2020-08-22 00:54
数学
英雄联盟【拉丁美洲
LLA
】电竞API数据接口
英雄联盟电竞API专用电竞数据接口分享使用代码示例演示:英雄联盟【拉丁美洲
LLA
】接口分享使用野子数据http://yes-esports.com/电竞API数据接口调用的示例代码具体如下:importcom.alibaba.fastjson.JSON
王峰
·
2020-08-21 03:32
javascript
vue.js
mysql
Kattis - exponial
n)+ϕ(n)(modn)n#definelllonglongllphi(llx)//欧拉函数{llres=1;for(llp=2;p*p1){res*=x-1;}returnres;}ll_pow(
lla
jiaqizhanzhi
·
2020-08-21 00:10
菜鸡写题
线段树模板
单纯的模板区间求和区间最值区间加法点加法通过区间求和或区间最值可以求点值#includeusingnamespacestd;typedeflonglongll;
lla
[100010];structT{lllt
diefun
·
2020-08-20 23:29
线段树
大组合数取膜(质数)
模板1#include2#include3#include45usingnamespacestd;6typedeflonglongLL;78LLn,m,p;910LLquick_mod(
LLa
,LLb)
as221360
·
2020-08-20 23:15
第一次月考核后讲题总结&神奇的东西1
然后讲了一下递归做法(一行代码实现目的)typedeflonglongll;//下面代码全都进行预处理llgetgcd(
lla
,llb){returnb==0?a:getgcd(
Amaranthzf
·
2020-08-20 22:49
英雄联盟【拉丁美洲
LLA
】电竞API数据接口
英雄联盟电竞API专用电竞数据接口分享使用代码示例演示:英雄联盟【拉丁美洲
LLA
】接口分享使用野子数据http://yes-esports.com/电竞API数据接口调用的示例代码具体如下:importcom.alibaba.fastjson.JSON
王峰
·
2020-08-20 17:54
javascript
vue.js
mysql
英雄联盟【拉丁美洲
LLA
】电竞API数据接口
英雄联盟电竞API专用电竞数据接口分享使用代码示例演示:英雄联盟【拉丁美洲
LLA
】接口分享使用野子数据http://yes-esports.com/电竞API数据接口调用的示例代码具体如下:importcom.alibaba.fastjson.JSON
王峰
·
2020-08-20 17:54
javascript
vue.js
mysql
UVALive 6177 The King's Ups and Downs 规律题
include#include#include#include#include#include#includeusingnamespacestd;typedeflonglongll;constintN=22;
lla
九野的博客
·
2020-08-20 11:13
水题
规律题
Hdu 5909 Tree Cutting
mod=1e9+7;constintv2=(mod+1)/2;vectoredge[maxn];intval[maxn],m;LLdp[maxn][maxn];LLtem[maxn];voidfwt(
LLa
a1s4z5
·
2020-08-20 09:57
--dp(动态规划)---
树状dp
--数学---
上一页
4
5
6
7
8
9
10
11
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他