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
LLN
HDU1061-Rightmost Digit(快速幂取模)
include #include usingnamespacestd; typedef__int64ll; //typedeflonglongll; constintMOD=1000000000;
lln
u011345461
·
2014-08-29 22:00
UVA10518 - How Many Calls?(矩阵快速幂)
代码:#include #include #include #include #include typedeflonglongll; usingnamespacestd;
lln
,b; structmat
u011345461
·
2014-08-28 20:00
【BZOJ】【P3505】【CQOI2014】【数三角形】【题解】【组合数】
枚举斜着的矩阵,矩阵上有gcd(i,j)-1个点,有(n-i)*(m-j)个矩阵,反方向*2完了Code:#include usingnamespacestd; typedeflonglongLL;
LLn
u012732945
·
2014-08-21 17:00
bzoj
省选
hdu 4956 Poor Hanamichi(bestcoder Round 6 1001)
被数据量吓到了代码:#include #include#include #include #include #definelllonglong usingnamespacestd; llsolve(
lln
Baoli1008
·
2014-08-17 23:00
BestCoder
HDU 4952 Number Transformation(公式)
这样一来就可以递推x,那么注意题目中k很大,但是实际上如果i到一定数值之后,x就不会在增长了,这时候就可以break了代码:#include #include typedeflonglongll;
lln
u011217342
·
2014-08-15 00:00
uva 10733 - The Colored Cubes(置换)
#include #include #include usingnamespacestd; typedeflonglongll;
lln
; llsolve(intk){
u011328934
·
2014-08-14 00:00
2014 Multi-University Training Contest 7小记
这部分解方程2-10000直接暴力typedeflonglongLL;
LLn
; intok(intb){ LLm=n; intc; while(m){ c=m%b; if(c==3||c==4||c
u013491262
·
2014-08-12 22:00
快速幂取模总结
模板:LLquickpow(
LLn
,LLm,intmod) { LLans=1; while(m>0) { if(m&1) ans=ans*n%mod; m>>=1; n=n*n%mod
u013013910
·
2014-08-06 10:00
编程
算法
C语言
ACM
快速幂取模
B - Big String
includeusingnamespacestd;#defineLLlonglongLLa[100];intmain(){ chars[]="T.T^__^"; a[0]=4; a[1]=3;
LLn
u013570474
·
2014-08-04 23:00
NYOJ570---欧拉函数求和
输入 每行一个数n(n #include #include #include usingnamespacestd; #defineLLlonglong LLEuler(
LLn
) { LLsum=n;
u013050857
·
2014-07-31 10:00
算法
数论
C语言
nyoj
HDU3555——Bomb(数位DP)
usingnamespacestd; LLdp[25][3]; voidInit() { memset(dp,0,sizeofdp); dp[0][0]=1; for(inti=1;i>t; while(t--){
LLn
u014141559
·
2014-07-23 10:00
[NOIP 2013提高组][Wikioi]解题报告---龟速更新中
Day1T1裸快速幂水题//结果=(x+m*10^k)modn #include #defineLLlonglongint
LLn
,m,k,x; LLfastPow(LLbase,LLe)//base
qpswwww
·
2014-07-12 17:00
hdu4849 Wow! Such City!
include usingnamespacestd; #definell__int64 constintN=1150; llINF=0x3f3f3f3f; lly[N*N],x[N*N],z[N*N];
lln
u013532224
·
2014-07-08 20:00
C++
算法
最短路
uva 10831 - Gerg's Cake(勒让德记号)
解题思路:勒让德记号,判断ap−12≡1%p#include #include #include usingnamespacestd; typedeflonglongll; llpow_mod(lla,
lln
u011328934
·
2014-07-06 09:00
uva 1363 - Joseph's Problem(数论)
参考别人的,自己想了很久,详细题解#include #include #include #include usingnamespacestd; typedeflonglongll; llsolve(
lln
u011328934
·
2014-07-05 22:00
uva 11246 - K-Multiple Free set(数论)
#include #include #include usingnamespacestd; typedeflonglongll; llsolve(
lln
,llk){
u011328934
·
2014-07-04 22:00
uva 10710 - Chinese Shuffle(完美洗牌)
#include #include typedeflonglongll; llpow_mod(lla,
lln
,llmod){ llans=1;
u011328934
·
2014-07-03 12:00
hdu 3037 Saving Beans(组合数学)
#include #include #include usingnamespacestd; typedeflonglongll;
lln
,m,p; llqPow(lla,llk){ ll
u011328934
·
2014-06-23 10:00
uva 10843 - Anne's game(数论cayley定理)
#include #include typedeflonglongll; constllMOD=2000000011; llPow(llx,
lln
){ if(n<0) return1; llans
u011328934
·
2014-06-22 21:00
Codeforces 362D Fools and Foolproof Roads 构造题
include #include #include #include #include #include usingnamespacestd; #defineN123456 #definell__int64
lln
qq574857122
·
2014-06-21 19:00
矩阵经典题目三:poj 3233 Matrix Power Series(等比矩阵求和)
id=3233ps转:用二分方法求等比数列前n项和:即 原理: (1)若n==0 (2)若n%2==0 (3)若n%2==1代码如下:LLsum(LLp,
LLn
) { if(n==0)return1
u013081425
·
2014-06-12 17:00
数论
矩阵
ACdream原创群赛(12)のBUAA选拔赛
voidGetc(){ c[0][0]=1; for(inti=1;i>=1){ if(y&1){ s*=x; s%=mod; } x*=x; x%=mod; } returns; } LLanswer(
LLn
u013491262
·
2014-06-02 17:00
2014百度之星资格赛题解
#include #include #include #include usingnamespacestd; #definell__int64 #defineinf100000000000
lln
,a,
qq574857122
·
2014-05-24 20:00
2014年百度之星程序设计大赛 - 资格赛题解
1001 暴力typedeflonglongLL; intmain(){
LLn
,m,v,k,x; intt,s; cin>>t; while(t--){ scanf("%I64d%I64d%I64d
u013491262
·
2014-05-22 10:00
快速素数判断的方法
#include #include #defineLLlonglong boolf(
LLn
) { if(n==2||n==3||n==5) returntrue; if(n%2==0||n
u013015642
·
2014-05-22 09:00
Codeforces 429D Tricky Function 最近点对
include #include #include #include usingnamespacestd; #defineN100050 #definell__int64 lla[N],sum[N];
lln
qq574857122
·
2014-05-12 15:00
HDU 4028 The time of a day STL 模拟题
include #include #include #include #include #include usingnamespacestd; #definell__int64 #defineN42
lln
qq574857122
·
2014-05-11 18:00
hdu 4704 Sum(费马小定理)
include usingnamespacestd; typedef__int64ll; constintMAXN=100005; chars[MAXN]; constllmod=1000000007;
lln
solotzg
·
2014-05-02 18:00
x^y % m 大数
pid=1759typedeflonglongLL; LLphi(
LLn
){ LLs=n; for(LLi=2;i*i>=1){ if(y&1){s*=x;s%=m;} x*=x;x%=m; } returns
u013491262
·
2014-04-24 15:00
hdu 1796 How many integers can you find 容斥原理
dfs枚举,传参保证当前是加还是减,注意输入检查以及 #include #include #include usingnamespacestd; typedeflonglongll; llt[20];
lln
t1019256391
·
2014-04-17 14:00
ZOJ 3785 What day is that day? 循环节找规律
include #include #include #include #include #include usingnamespacestd; #defineN10000 #definelllonglong
lln
qq574857122
·
2014-04-14 14:00
ZOJ 3785 What day is that day? 循环节找规律
include #include #include #include #include #include usingnamespacestd; #defineN10000 #definelllonglong
lln
qq574857122
·
2014-04-14 14:00
编程之美:1的数目
问题1描述:求1~N十进制中1的数目f,f(12)=5#include typedeflonglongLL; LLSum1s(
LLn
){ LLiCount=0; LLiFactor=1; LLiLowerNum
starcuan
·
2014-03-14 21:00
编程之美
saltstack管理nagios脚本
install_nagios: cmd.script: -source:salt://nagios/nagios.bin -user:root -shell:/bin/bash3.最后把脚本放入到指定目录#
lln
charlie_cen
·
2014-03-13 16:37
saltstack
nagios.bin
UVA 10006 - Carmichael Numbers 快速幂
problem=947题目大意:我们把对任意的1 #include typedeflonglongLL; constintMAXN=65000+10; boolprimer[MAXN]; LLpow(LLx,
LLn
murmured
·
2014-03-08 19:00
编程
ACM
uva
快速幂
rails 调试
#24TheStackTraceAplugincalledRailsFootnoteswillturnthelinesfromthestacktraceintoclickablelinksthatwillopentheappropriatefileinTextMate.Toinstallit,runthefollowinglinefromyourapp’sdirectory(you’
lln
52jobs
·
2014-02-23 22:00
hdu 4588 Count The Carries
中1和0交替的频率随着i的改变而改变#include #include #include #include #include usingnamespacestd; typedef__int64ll;
lln
solotzg
·
2014-02-05 15:00
ZOJ 3149 Breadtree DP
--------------------constintmaxn=100000; constintmaxm=10000; constLLLIM=1234567890LL;
LLn
,k; LLf[maxn
cyendra
·
2014-01-12 22:00
hdu 1286
8)=4,因为1,3,5,7均和8互质code:#include #include"math.h" usingnamespacestd; typedeflonglongLL; LLeuler(
LLn
洛伊佩拉
·
2013-12-03 20:00
hdu 1757 A Simple Math Problem 矩阵基础题
#include #include #include #include #include usingnamespacestd; #defineLL__int64 //constLLmod=9973;
LLn
a601025382s
·
2013-11-12 22:00
矩阵
Error opening terminal:xterm解决方法
1.Forerrormessage"Erroropeningterminal:linux"mkdir-p/usr/share/terminfo/lcd/usr/share/terminfo/
lln
-s/
l0605020112
·
2013-11-08 15:32
Ubuntu基础
Error opening terminal:xterm解决方法
1.Forerrormessage"Erroropeningterminal:linux"mkdir-p/usr/share/terminfo/lcd/usr/share/terminfo/
lln
-s/
l0605020112
·
2013-11-08 15:00
hdu 4091 Zombie’s Treasure Ches 贪心
#include #include #include #include #include #include usingnamespacestd; typedeflonglongll;
lln
,c1,w1
t1019256391
·
2013-10-14 21:00
Hdu 4768 Flyer(2013长春网络赛)
不断的异或就可以了,用了一个等差数列连续异或的模板#include typedef__int64LL; #include usingnamespacestd; LLGet(LLa,LLb,LLc,
LLn
ygqwan
·
2013-09-28 18:00
POJ 1811 Prime Test 素性测试 分解素因子
typedef__int64ll; constllINF=(1LL=m)ret-=m; } a*=2; if(a>=m)a-=m; b/=2; } returnret; } llpow_mod(llx,
lln
u010710717
·
2013-09-25 19:00
hdu 3483 A Very Simple Problem 矩阵
include#include#include#include#includeusingnamespacestd;#defineLL__int64constLLmaxn=55;LLc[maxn][maxn];
LLn
knownothing
·
2013-09-19 21:01
数论*
矩阵
hdu 3483 A Very Simple Problem 矩阵
include #include #include #include usingnamespacestd; #defineLL__int64 constLLmaxn=55; LLc[maxn][maxn];
LLn
a601025382s
·
2013-09-19 21:00
poj 2417 Discrete Logging 求解模方程a^x=b(mod n),n为素数+模板题(baby_step giant_step)
include #include #include #include usingnamespacestd; #defineLLlonglong //快速幂求a^b LLpow_mod(LLa,LLb,
LLn
a601025382s
·
2013-09-16 19:00
模方程
baby_step
giant_step
hdu 3030 Increasing Speed Limits 树状数组
definelowbit(x)(x&(-x)) constLLmod=1e9+7; constLLmaxn=500050; LLa[maxn],b[maxn],c[maxn],f[maxn],ans[maxn];
LLn
a601025382s
·
2013-09-01 19:00
树状数组
ZSTU 3194 复数的幂 二分幂
递归ViewCode#include #include #defineLL__int64 LLa,b,x,y,mod,n; voidgao(
LLn
,LL&x,LL&y) { if(n==1)
c3568
·
2013-08-29 10:00
上一页
16
17
18
19
20
21
22
23
下一页
按字母分类:
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
其他