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
n的约数(数论+DFS)
constintN=100+5;constintprime[]={0,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};
lln
,m,t,ans;inti,j,k;voidDFS
穷源溯流
·
2020-07-06 21:51
New
coder
#
搜索与回溯算法
莫比乌斯反演(HDU5663)
题意:思路:代码:1constintmaxn=10000000+10;2
lln
,m,a;3llmiu[maxn],v[maxn];4llsum[maxn];5voidEratosthenes(intn)
JayShao
·
2020-07-06 14:00
暴力,STL,哈希技术,Floyd判圈算法(计算器谜题,uva 11549)
就空间而言,Floyd判圈法usingnamespacestd;typedeflonglongll;inlinellmp(llx,
lln
){llret=1;while(n){if(n&1)r
冷月残星
·
2020-07-06 09:58
大白书-第1章-算法设计基础
暴力
STL
哈希技术
Floyd判圈算法
Codeforces Round \#479 (Div. 3)(题解)
直接用个位数字与k比较,如果n大,那么输出n-k,否则需要判断是否能把个位去掉#include#includeusingnamespacestd;typedeflonglongll;intmain(){
lln
东さん
·
2020-07-06 08:11
CF
Codeforces Round #552 (Div. 3) B
typedeflonglongll;typedefunsignedlonglongull;constintmaxn=2e5+5;inta[maxn],cnt;std::vectorv;signedmain(){
lln
wzazzy
·
2020-07-06 08:30
codeforces
算法学习->欧拉降幂(欧拉+快速幂)
llouler(
lln
){llans=n,a=n;for(lli=2;i*i1){ans-=ans/a;}returnans;}voidouler(){euler[1]=1;for(inti=2;i>=
wuyileiju__
·
2020-07-06 08:35
数学
快速幂/矩阵快速幂
欧拉函数
数论基础——欧拉函数
所以,根据通式我们可以打出以下代码:lleular(
lln
){llans=n;for(inti
浦柳人
·
2020-07-06 04:27
数论黑洞&思维暴力
UVA - 11538 ——Chess Queen(推公式)
://vjudge.net/problem/UVA-11538#include#include#include#defineLLlonglongusingnamespacestd;intmain(){
LLn
creator平
·
2020-07-06 03:45
ACM白书
【组合计数】UVA - 11538 - Chess Queen
考虑同一对角线的情况不妨设,n#include#includeusingnamespacestd;typedeflonglongll;
lln
,m;intmain(){while(1){cin>>n>>m
weixin_34405354
·
2020-07-06 01:05
hdu-2838(Cow Sorting)----》树状数组
#include#includetypedef__int64LL;constLLM=100005;LLa[M],c[M];
LLn
;LLlowbit(LLx){returnx&(-x);}voidadd(
风儿--zsj
·
2020-07-05 16:49
小知识
HDU--1556--区间查询+区间更新
个整数ab(a#include#include#include#include#include#defineLLlonglongusingnamespacestd;constintmaxa=1e6+10;
LLn
queque_heiyaa
·
2020-07-05 10:38
#
常用模板代码
#
HDU题目
C. Computer Game——(普通二分查找)(CF-1400)
当前电量大于a时,他可以选择只打游戏,然后打完这局电量减少a当前电量大于b(busingnamespacestd;#definelllonglongconstllup=1e9+1;llcheck(llk,
lln
Probie Tao
·
2020-07-05 10:12
二分
Codeforces Round #596 D
include#includeusingnamespacestd;typedeflonglongll;typedefdoubleld;constintINF=1e5+9;mapmp;llPower(llx,
lln
邵光亮
·
2020-07-05 09:34
CodeForces
Codeforces Round #557 (Div. 2) [based on Forethought Future Cup - Final Round]
A.ZoningRestrictionsAgain暴力每次取区间最小值#include#definelllonglongusingnamespacestd;constllN=5e5+100;
lln
,h,
qq_41722217
·
2020-07-05 08:51
C++
补
欧拉筛选+唯一分解(模板)
#include#defineMAXN1000005usingnamespacestd;typedeflonglongll;llprime[MAXN];llvis[MAXN];llcnt;
lln
;voidisprime
熙言丶
·
2020-07-05 08:27
模板
数论
UVA 11538 : Chess Queen
简单题#include#includeusingnamespacestd;typedefunsignedlonglongll;intmain(){
lln
,m;while(scanf("%llu%llu"
ITKaven
·
2020-07-05 06:35
ACM
Codeforces Round #636 (Div. 3)
#includeusingnamespacestd;typedeflonglongll;intmain(){intt;cin>>t;while(t--){
lln
;cin>>n;llsum=4;while
Lecxcy_Kastreain
·
2020-07-05 05:42
漫谈系列—大数定律
今天我们聊聊大数定律(LawofLargeNumbers,
LLN
),这个概率论中的重要基石。(最后面有一道测试题,有兴趣的同学可以挑战看看)大数定律讲了一件什么事情?
技术宅-百度
·
2020-07-05 02:09
算法基础
【BZOJ 4052】[Cerc2013]Magical GCD 暴力+gcd
#include#include#include#include#definemaxn100021#defineLLlonglongusingnamespacestd;
LLn
,a[
pbihao
·
2020-07-05 01:52
ac之路
bzoj
数学
暴力
智商
102263 - ArabellaCPC 2019(部分)解题报告
easy#includeusingnamespacestd;typedeflonglongll;constintINF=0x3f3f3f3f;constintN=1e5+5;
lln
,k;intmain(
CoordinateKND
·
2020-07-04 20:27
板子
definelllonglongusingnamespacestd;constintmaxn=1e6+5;constintINF=0x3f3f3f3f;constllMOD=1e9+7;structMatrix{llm[2][2];}ans,rec;
lln
只有魔法才能对抗魔法
·
2020-07-04 16:27
板子
XHXJ's LIS HDU - 4352
0usingnamespacestd;typedeflonglongll;lldp[30][3000][11];intdata[30],k;intget_num(
lln
)//去判断每一位
deerly_
·
2020-07-04 14:40
数位dp
洛谷1036 选数(DFS)
_2,…,x_nx1,x2,…,xn,以及111个整数kkk(k#include#include#include#includeusingnamespacestd;typedeflonglongll;
lln
Whyckck
·
2020-07-04 09:31
NKOJ 3616(CQOI 2016) 伪光滑数(暴力堆/可持久化可并堆+dp)
include#include#include#definellunsignedlonglongusingnamespacestd;structnode{llx,v,p;};booloperatorQ;
lln
Mogician_Evian
·
2020-07-04 07:31
堆与可并堆
动态规划
Educational Codeforces Round 49 (Rated for Div. 2) B. Numbers on the Chessboard
ACcode:#includeusingnamespacestd;typedeflonglongll;
lln
,q,a,b,ans;intmain(){cin>>n>>q;while(q--){cin>>
图南1204
·
2020-07-04 06:35
模拟题目
codeforces
Codeforces Round #509 (Div. 2) B. Buying a TV Set
ACcode:#include#includeusingnamespacestd;typedeflonglongll;
lln
,m,x,y,s1,s2,ans;llgcd(llm,
lln
){whi
图南1204
·
2020-07-04 06:03
codeforces
Educational Codeforces Round 46 (Rated for Div. 2) A. Codehorses T-shirts
#includeusingnamespacestd;#definelllonglonglla[5][5],b[5][5];intmain(){
lln
;cin>>n;strings;for(lli=0;i
bryce1010
·
2020-07-04 05:09
codefoces
Codeforces Round #633 (Div. 2) A~D题解
DA.FillingDiamondsB.SortedAdjacentDifferencesC.PoweredAdditionD.EdgeWeightAssignmentA.FillingDiamonds如果这个菱形是竖着的,那么后面的形状便会固定答案就是nnn#includeusingnamespacestd;typedeflonglongll;intt;
lln
More Than Over
·
2020-07-04 04:04
codeforces题解
HDU3634(矩形切割)
includeusingnamespacestd;constintN=205;#defineLLlonglongtypedefstruct{LLx1,y1;LLx2,y2;LLsum;LLv;}Node;NodeT[N];
LLn
ACdreamers
·
2020-07-04 04:54
计算几何
Codeforces Round #636 (Div. 3) ABCD
A等比数列求和,找一个n可以整除的就行#includeusingnamespacestd;#definelllonglongllans[35];intmain(){
lln
;inti,j;ans[0]=1
甦萌
·
2020-07-02 07:58
codeforces
Atcoder Beginner 116 C - Grand Garden
#include#include#include#include#include#include#include#includeusingnamespacestd;typedeflonglongLL;
LLn
explodee
·
2020-07-01 23:58
扩展Lucas定理 扩展Lucas板子
include9#include10#include11#include12usingnamespacestd;13typedeflonglongLL;14constintmaxn=1000005;1516
LLN
diezhan7052
·
2020-07-01 22:48
Codeforces 1142A(性质、暴举)
1constintmaxn=1e5+5;2
lln
,k,a,b,aa,minn=INF,maxx=-1;3setbb;45llgcd(lla,llb){6returnb?
dengliaotu5386
·
2020-07-01 22:35
矩阵模板hdu5015,UVA 10655,UVA 11149
hdu5015n是#include#includeusingnamespacestd;typedeflonglongll;constintP=10000007;constintN=13;
lln
,m;structmatrix
伟大的蚊子
·
2020-07-01 21:27
数学一点皮毛
AtCoder Beginner Contest 172 A-E
includeusingnamespacestd;typedeflonglongll;constintM=1e5+7;intmain(){ios::sync_with_stdio(false);cin.tie(0);
lln
夕林山寸
·
2020-07-01 18:04
atcoder
数学---组合数学
数论——莫比乌斯/容斥
2018 icpc 南京网络赛
#includeusingnamespacestd;#definelllonglongllfac[103];intmain(){
lln
,T;cin>>T;while(T--){cin>>n;coutusingnamespacestd
还是太年轻
·
2020-07-01 16:38
区域赛
4826 Problem A 计算组合数
要求将计算阶乘运算的函数写为fact(n),函数返回值的类型为float输入mn输出对应表达式的值样例输入21样例输出2经验总结基础题~~AC代码#includetypedeflonglongLL;LLcombine(
LLn
漫浸天空的雨色
·
2020-07-01 16:11
codeup
计算组合数
4826
codeup
C++
2020牛客寒假算法基础集训营1 题解
#includeusingnamespacestd;typedeflonglongll;constllmod=1e9+7;intmain(){
lln
,m;scanf("%lld%lld",&
Authur_gyc
·
2020-07-01 14:35
矩阵
算法
动态规划(dp)
计算几何
PTA 练习 L1-006 连续因子 (20 分)
输入格式:输入在一行中给出一个正整数N(1usingnamespacestd;typedeflonglongll;intmain(){
lln
,sum,m,Maxlen,b;sc
Mercury_Lc
·
2020-07-01 11:42
PTA题
AtCoder Beginner Contest 160 F.Distributing Integers(组合数学+换根dp)
definepbpush_backconstintN=2e5+10,mod=1e9+7;vectore[N];intsz[N],n,u,v;lldp[N],fac[N],Finv[N],inv[N],ans[N];llmodpow(llx,
lln
Code92007
·
2020-07-01 08:06
#
树形dp/换根dp/长链剖分
换根dp
组合数学
树形dp
233 Matrix HDU - 5015 (递推+矩阵快速幂)
includeusingnamespacestd;typedeflonglongll;constllmod=10000007;constintN=12;structnode{lla[13][13];};nodeshu,ans,mp;
lln
肘子zhouzi
·
2020-07-01 07:30
矩阵
牛客练习赛35题解
constintN=1e4+100;constintINF=0x3f3f3f3f;constintmod=1e9+7;lla[100];intmain(){for(inti=1;i>T;while(T--){
lln
从零开始的小栗子
·
2020-07-01 04:52
二次剩余模板
llq_pow(lla,llb,llp){llans=1;while(b){if(b&1)ans=ans*a%p;a=a*a%p;b>>=1;}returnans;}llQuadratic_residue(
lln
smiling~
·
2020-06-29 09:16
数论
二次剩余
模板
牛客多校Round 4
typedeflonglongll;constllmod=1e9+7;chars[100005];intlen;mapmp;llgetphi(llo){if(mp[o])returnmp[o];llres=o;
lln
weixin_30235225
·
2020-06-27 15:15
牛客练习赛 66C公因子 题解
考场时想多了,想到了负数、正数各种复杂的处理,但是不需要),最后处理一下即可代码#include#include#include#definelllonglongconstintMAXN=1e6+10;
lln
Werner_Yin
·
2020-06-27 08:00
poj 1808 Quadratic Residues 【平方剩余】【数论】
#include#defineLLlonglongLLpow_mod(LLa,
LLn
,LLmod){LLres=1;while(n){if(n&1)res=res*a%mod;n>
zwzwzwh
·
2020-06-26 22:08
数学
【HDU 6217 2017ACM/ICPC亚洲区沈阳站】BBP Formula
BBP算法的一个模板#include#includeusingnamespacestd;typedeflonglongll;llremain(llm,
lln
,llk,llextra){lltemp1=1
Hacb
·
2020-06-26 21:21
BBP
周中练习2题目整理
还是看代码吧lldp[5005][5005];llf[5005][5005];
lln
;l
snayf
·
2020-06-26 13:04
ubuntu 安装redash
安装redashhttps://blog.csdn.net/frone/article/details/85252652#_nodejsnpmdocker_1https://blog.csdn.net/
lln
Drchen_usts
·
2020-06-25 17:08
BI---redash搭建
求逆序对(树状数组)
Na[j]&&i2#definelllonglong3#definemod10000000094#definelowbit(x)x&(-x)5usingnamespacestd;6
lln
,sum[100005
谁伴我流浪
·
2020-06-25 11:00
上一页
8
9
10
11
12
13
14
15
下一页
按字母分类:
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
其他