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
TOT
逃学的小孩
#include#include#include#defineLLlonglongusingnamespacestd;constLLN=200005;LLn,m,head[N],
tot
,dis[N],kis
weixin_30363981
·
2020-09-16 00:55
开发工具
hdu-4635(有向图缩点+判断强连通)
求在原有向图上最多可以添加多少边,使其仍满足不是强连通图思路:缩点后分成两部分,保证两部分不强连通(两部分之间,其中一部分的入度或出度应为0),然后用sum(所有边)-
tot
(已有边)-两部分点数的乘积
w-y-p
·
2020-09-15 23:29
图
最小费用最大流模板
intu,intv,intcap,intcost):u(u),v(v),cap(cap),cost(cost){}}eg[M];inttot;intfirst[N],Next[M];voidinit(){
tot
XTU_wcb
·
2020-09-15 23:43
网络流之费用流
poj 3177 Redundant Paths(Tarjan,边双连通分量)
includeusingnamespacestd;constintMAXN=5010;constintMAXM=20010;structEdge{intto,next;boolcut;}edge[MAXM];inthead[MAXN],
tot
算球?
·
2020-09-15 23:45
强连通分量/双连通分量
BZOJ 2780 后缀自动机
#include#include#include#include#include#includeusingnamespacestd;constintmaxn=505000;intn,m,cnt,
tot
,
magic_sheep
·
2020-09-15 22:53
后缀自动机
luogu P3313 [SDOI2014]旅行
(a):(b))usingnamespacestd;intn,m,k,x,y,z,
tot
,root[100039],top[100039],d[100039],fa[100039],idea,id[
fxt275307894a
·
2020-09-15 22:57
洛谷
树剖
线段树
动态开点
2019年我能变强组队训练赛第八场
includeusingnamespacestd;constintmaxm=50100;constintmaxn=500;charch[200];intt,to[maxm],head[maxn],nex[maxm],
tot
dctika1584
·
2020-09-15 22:21
2019.06.25【NOI2019】模拟(三维前缀和、三维差分、混合图求欧拉回路)
而显然sum=sigma(val[i][j][k]*(
tot
^w-(
tot
-x)^w))。
tot
表示所有能选的长方体,x表示这
tot
个长方体中有几个是包含(i,j,k)的。
chiyankuan
·
2020-09-15 22:05
省选/NOI
luogu P4408 [NOI2003]逃学的小孩
(a):(b))usingnamespacestd;intn,m,k,x,y,z,maxs,start,now,cur;longlongmaxn,d[3][200039],ans,
tot
,pus
fxt275307894a
·
2020-09-15 21:19
洛谷
dfs
树的直径
spfa
Kuangbin 带你飞专题十一 网络流题解 及模版 及上下界网络流等问题
这个问题目前先就EK把structEdge{intu,v,next;LLcap,flow;}edge[MAXM];inthead[MAXN],
tot
;voidadd_edge(intu,int
deko2014
·
2020-09-15 21:15
数据结构与算法
V4yne的模板----树的问题
structnode{intto,next;intwei;}edge[2*maxn];inttot;inthead[maxn];voidedge_init(){memset(head,0,sizeof(head));
tot
V4yne.
·
2020-09-15 21:30
树
动态规划
板子梳理
UVA1146 Now or later
#includeusingnamespacestd;constintN=2e3+5;intn,l,r,mid,ans,
tot
,a[N*2];structnumber{intx,y;}num[N];intnow
Love_xyh
·
2020-09-15 21:42
2-SAT
强连通分量
二分法
[HNOI2010]平面图判定
注意边数为10000,但根据平面图性质,musingnamespacestd;constintN=605,M=8e5+5;intT,n,m,
tot
,a[10005],b[10005],c[N],id[N
Love_xyh
·
2020-09-15 21:36
2-SAT
强连通分量
图论
【二进制枚举】求在n个数中取任意个数加起来组成x的方案数
(1#include#include#include#includeusingnamespacestd;intnum[21];intmain(){intn,x,i,j,temp,
tot
=0;scanf(
Mankind_萌凯
·
2020-09-15 12:52
算法
洛谷单源最短路径-----堆优化的dijkstra算法
)#include#include#include#includeusingnamespacestd;intd[100005];boolf[100005];inthead[100005],n,m,s,
tot
LZU_er
·
2020-09-15 05:56
洛谷题解
算法
dijkstra
51nod 1238 最小公倍数之和 V3 【欧拉函数+杜教筛】
constlonglongN=1000005,m=1000000,inv2=500000004,inv4=250000002,inv6=166666668,mod=1e9+7;longlongn,phi[N],q[N],
tot
weixin_30823833
·
2020-09-15 03:44
BZOJ 2301 HAOI2011 Problem b 容斥原理+莫比乌斯反演
多次询问有多少个数对(x,y)满足a#include#include#include#defineM100100usingnamespacestd;typedeflonglongll;llmu[M],prime[M],
tot
PoPoQQQ
·
2020-09-15 02:55
BZOJ
容斥原理
莫比乌斯反演
最大公约数和最小公倍数问题
inline是用来加速的if(b==0)returna;returngcd(b,a%b);}intmain(){intn,m,
tot
=0;cin>>n>>m;//m是lcm,n是gcdfor(inti=
longint64
·
2020-09-15 02:19
Oracle ORA-01653 无法扩展表空间
查看表空间的使用情况(注表空间大写)SELECTUPPER(F.TABLESPACE_NAME)"表空间名",D.
TOT
_GROOTTE_MB"表空间大小(M)",
sophiemantela
·
2020-09-15 01:31
oracle
2018年湖南省第十四届大学生计算机程序设计竞赛 CSU 2170: 千万别用树套树
100000+100;structNode{intl,r;inttype,id;};intn,q;Nodenode[maxn],a[maxn],b[maxn];inttree[maxn],user[maxn],
tot
ITKaven
·
2020-09-14 21:44
ACM
魔兽地图dotr
,求能获得的最大价值以及方案【输入】第一行n(nbthenexit(a)elseexit(b);end;procedureconnect(a,b,c:longint);inline;begininc(
tot
weixinding
·
2020-09-14 21:32
【CodeForces】708 C. Centroids 树的重心
n#include#includeusingnamespacestd;constintmaxn=400010;intfirst[maxn],
tot
,size[maxn],n,p,top[maxn];intmx
weixin_34387468
·
2020-09-14 21:25
数据结构与算法
洛谷 3386 二分图匹配模板 匈牙利算法
includeusingnamespacestd;constintMAXN=2000001;intfst[MAXN],nxt[MAXN],ss[MAXN];boolvis[MAXN];intn,m,e,
tot
Loi_cgold
·
2020-09-14 19:32
匈牙利算法
模板
codeforces1407C Chocolate Bunny
1407/problem/C因为是1-n的排列,那么如果pi%pjusingnamespacestd;typedeflonglongll;constintmaxl=3e5+10;intn,m,cnt,
tot
二分抄代码
·
2020-09-14 19:51
交互
cf965e Short Code
ref#include#include#include#include#includeusingnamespacestd;intn,
tot
,dfn[100005],s[100005][26],dep[100005
dianjiaxian1205
·
2020-09-14 18:49
BZOJ 4816[SDOI2017]数字表格(莫比乌斯反演)
\(T#includeusingnamespacestd;constintmod=1e9+7;constintN=1e6+7;intQ,n,m,
tot
;intprime[N],mu[N],f[N],g[
adolflee2050
·
2020-09-14 18:00
LOJ#6229. 这是一道简单的数学题(莫比乌斯反演+杜教筛)
\(n#include#includeusingnamespacestd;constintmod=1e9+7;constintN=2e6+7;intn,
tot
,inv2=mod+1>>1,inv6=166666668
adolflee2050
·
2020-09-14 18:00
AIM Tech Round 3 (Div. 1) C. Centroids(每个点能否删掉一条边再添加一条边使得这个点成为重心)
constintN=4e5+100;structEdge{intto,next;}e[N*2];inttot,head[N],n,size[N],mx,a[N],up[N],up_max[N];voidinit(){
tot
_zidaoziyan
·
2020-09-14 18:28
树形dp
[ZJOI 2009] 假期的宿舍
1433[算法]二分图匹配[代码]#includeusingnamespacestd;#defineMAXN55structedge{intto,nxt;}e[MAXN*MAXN];inti,j,n,T,
tot
a576969381
·
2020-09-14 18:23
php
从拓扑排序到2-sat
从拓扑排序到2-sat拓扑排序#include#include#include#include#definemaxn100005usingnamespacestd;intn,m,
tot
;intdeg[maxn
Rising_shit
·
2020-09-14 18:45
dfs
【树套树】【BZOJ 2141】排队
题目思路代码#include#defineN200002#defineM5000002usingnamespacestd;intn,m,q[N],ans;inths[N],
tot
,num[M];intsum
CE自动机
·
2020-09-14 18:38
hdu1691(静态字典树|对字符串进行排序)Phone List
,反之输出YES//静态字典树#include#include#include#includeusingnamespacestd;constintmn=10001;intstr[mn*11][11],
tot
ai52learn
·
2020-09-14 04:17
字典树
template
51 nod 1775 LIS Counting
1usingnamespacestd;#definelllonglong#defineN300#defineMod5000007lla[N],b[N],f[2][Mod+10],st[2][Mod+10],
tot
shiyongyang
·
2020-09-14 04:00
LIS
动态规划好题
LeetCode 59. 螺旋矩阵II
classSolution{public:vector>generateMatrix(intn){vector>a(n,vector(n));intx=0,y=0;a[x][y]=1;inttot=1;while(
tot
WA-Accepted
·
2020-09-14 04:04
LeetCode
紫书UVA 524
#includeusingnamespacestd;#definemaxn100intcheck[maxn],prime[maxn],
tot
=0,vis[maxn];intn;voidshai(){for
Dilly__dally
·
2020-09-14 03:12
紫书第七章习题
bzoj4804: 欧拉心算
include#include#definelllonglong#defineN10000005usingnamespacestd;llphi[N],ans;intvis[N],pri[N/10],n,T,
tot
zhouyuyang233
·
2020-09-14 01:02
辣鸡八中
数论
考前复习 之 高精模板
位数不同吧还有可能比位数最长的还要长#include#include#include//bymars_chusingnamespacestd;chara[1005],b[1005];intans[1005],
tot
mars_ch
·
2020-09-14 00:45
模板
乱搞
bzoj 1131 [POI2008]Sta
defineintlonglong//bymars_chusingnamespacestd;structdata{intf,t,nxt;}e[1000005*2];intfirst[1000005],
tot
mars_ch
·
2020-09-14 00:44
bzoj
dp
dp专栏
链式前向星(模板)
head数组存储最后插入该链表的边的编号,每条边插入都是在该链表的表头插入,然后head前移指向当前新边(即当前编号
tot
),新节点指向原来的头结点!
ITNXD
·
2020-09-14 00:53
模板
算法与数据结构
vijos-1951 玄武密码
include#include#include#defineN100001#defineM10000001usingnamespacestd;queueq;intfail[M],next[M][4],root,
tot
ww140142
·
2020-09-13 20:19
其他OJ
其他题型
OIer刷题记录
2016 Benelux Algorithm Programming Contest (BAPC 16)
的代码FST了,按题意模拟不断删点,实际上和拓扑排序删点相似#includeusingnamespacestd;inthead[300003*2],nxt[300003*2],to[300003*2],
tot
amwm52937
·
2020-09-13 18:34
【板子】树链剖分
Spoj375IThink题意:带修改树上两点最大路径Code#include#includeusingnamespacestd;constintsm=1e4+10;charinst[10];intn,a,b,cnt,
tot
Etta19
·
2020-09-13 18:43
线段树
树链剖分
小板子
最短路计数——Dijkstra
传送门受到题解的启发,用DijkstraA掉(手工代码)思路:1.无向无权图,建图的时候别忘记建来回的有向边2.无权,那么边长建成1就好了3.最短路采用Dijkstra(堆优化)来做,计数操作改装进去,
tot
weixin_30747253
·
2020-09-13 06:05
数据结构与算法
洛谷 1821 [USACO07FEB]银牛派对Silver Cow Party
include3#include4#defineLLlonglong5#definergregister6#defineN2000107usingnamespacestd;8intn,m,s,ans,
tot
weixin_30332705
·
2020-09-13 06:54
stock cpp
defineSTOKC_H_#includeclassStock{private:std::stringcompany;longshares;doubleshare_val;doubletotal_val;voidset_
tot
wezzdo
·
2020-09-13 05:32
cpp
#HDU 2186 Popular Cows
includeusingnamespacestd;constintmaxn=1e5+5;structnode{intv,next;}e[maxn];intdfn[maxn],low[maxn],suo[maxn],cnt,
tot
东野圭吾#
·
2020-09-13 03:17
Tarjan
字符串算法的应用
structTrie{inttot,ch[maxn][26],end[maxn];voidinit(){while(
tot
--)cl(ch[
tot
+1]),end[
tot
+1]=0;
tot
=1;}intappend
SeddonShen
·
2020-09-13 01:35
算法学习
算法
字符串
CCF CSP 2020-06-05 乔乔和牛牛逛超市
include#defineLLlonglongusingnamespacestd;constintN=100010,M=2000010;constLLINF=2e9;intn,m,S,T;inth[N],
tot
hbulzh
·
2020-09-12 13:17
网络流
CCF
CCF CSP 201403-4 网络延迟
树的最长直径#include#includeusingnamespacestd;constintN=1e5+10;intd[N],ans;inth[N],
tot
,vis[N];structEdge{intto
hbulzh
·
2020-09-12 13:17
CCF
树形DP
最长上升子序列 基础动规题
题目最长上升子序列描述一个数的序列ai,当a1usingnamespacestd;intmain(){intMax=0;intn,a[1000],dp[1000],
tot
=0;//定义变量cin>
January_one
·
2020-09-12 12:36
c++
上一页
3
4
5
6
7
8
9
10
下一页
按字母分类:
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
其他