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
P1347 排序(拓扑排序)
=1)vis[aa]=1,
tot
++;//
tot
记录的是目前能算得上点(因为是
a8613585
·
2020-08-18 14:34
树形DP专题
includeusingnamespacestd;constintMAX=6e3+5;intn,a[MAX],d[MAX];structP{intto,nxt;}e[MAX];inthead[MAX],
tot
qianyri
·
2020-08-18 14:32
树形DP
洛谷——P1347 排序
一个有序的数列A,B,C,D表示A#include#include#include#include#include#defineN110usingnamespacestd;inta,b,n,m,s,sum,
tot
weixin_34384557
·
2020-08-18 13:32
洛谷 P1347 排序
排序题目描述一个不同的值的升序排序数列指的是一个从左到右元素依次增大的序列,例如,一个有序的数列A,B,C,D表示A2#include3#include4#include5#include67constintMAXN=27;89intn,m,
tot
weixin_30642029
·
2020-08-18 13:50
【洛谷_P1347】排序
排序题目题目描述一个不同的值的升序排序数列指的是一个从左到右元素依次增大的序列,例如,一个有序的数列A,B,C,D表示A#includeusingnamespacestd;intn,m,b[1000],v[1000],d[1000];inthead[1000],
tot
SSL_GYX
·
2020-08-18 13:25
拓扑
BFS
C#如何测试代码运行时间
需要测试的代码....stopwatch.Stop();//停止监视TimeSpantimespan=stopwatch.Elapsed;//获取当前实例测量得出的总时间doublehours=timespan.
Tot
QQQ2556338777
·
2020-08-18 10:21
poj-3237 Tree
与节点y之间的路上所有边的权值取相反数数;节点数n#include#include#include#defineN100001#definelsonl,mid,noto[N],val[N];intn,
tot
ww140142
·
2020-08-18 10:43
poj
数据结构
OIer刷题记录
HDU-6031 Innumerable Ancestors(二分+树上倍增)
代码#include#defineDBG(x)cerrst;queueQ;voidaddedge(intu,intv){edge[
tot
].to=v;e
weixin_30832405
·
2020-08-18 09:26
hdu4280 Island Transport (最大流ISAP算法)
defineMAXN100002#defineMAXE400002#defineINF0x3f3f3f3fstructnode{intfrom,to,next;intcap;}edge[MAXE];intn,m,
tot
不可不戒
·
2020-08-18 08:04
网络流
spoj COT && COT2
#include#include#include#include#include#defines(i)T[i].s#defineN100005usingnamespacestd;intn,m,siz,
tot
beginendzrq
·
2020-08-18 08:33
线段树&&主席树
莫队
yzoj P2043 & 洛谷 P1282 多米诺骨牌 题解
#includeusingnamespacestd;constintmaxn=1e4+5;intn,s,x,y,
tot
,ans;intv[maxn],w[maxn],dp[maxn];intmain()
aqg41577
·
2020-08-18 08:55
数据结构与算法
求最长不下降子序列 简单动态规划问题
(i)≠b(j)(i≠j),若存在i1#includeusingnamespacestd;intans[200];intMax=0,Max_f;intn,a[1000]={},dp[1000]={},
tot
January_one
·
2020-08-18 08:42
c++
UVA 11762 Race to 1
设dp[i]为i的期望,fac为素因子的数量,
tot
为素数数量,,则dp[i]=1+(1-fac/
tot
)*dp[i]+Σdp[i/pk]/to
HYB733093411
·
2020-08-18 07:33
DP
【SPOJ-COT】Count on a tree【主席树】【LCA】
Pigonometry*/#include#includeusingnamespacestd;typedeflonglongLL;constintmaxn=100005,maxnode=2000005;intn,m,
tot
BraketBN
·
2020-08-18 07:17
可持久化数据结构
最近公共祖先
poj2486 Apple Tree 树上分组背包
includeusingnamespacestd;constintN=205;structE{intto,nxt;}edge[N*2];intdp[N][N][2];intson[N],val[N];intidx[N],
tot
yxr0105
·
2020-08-18 07:11
poj
树形dp
背包
dp
【知识小结】圆方树 && 广义圆方树
的博客模板namespaceT{vectore[maxn*2];inttag[maxn*2];voidadde(intx,inty){//coutdfn[x])continue;//find_circle++
tot
Thomas_ZQQ@Runespoor
·
2020-08-18 05:30
知识点总结
图论
洛谷 P1014 Cantor表
新手村的纪念题目点击链接查看这个问题在二维数组的入门题目中也有类似的出现例如这道题(点击查看)经过分析可以发现,这一张表按照题目所述的元素走向应该按照奇数与偶数分开(这种问题都可以这样解决)#includeusingnamespacestd;intmain(){intN,
tot
Coming Liu
·
2020-08-18 02:17
P5731 【深基5.习6】蛇形方阵
AC代码:#include#includeusingnamespacestd;intmain(){intn;scanf("%d",&n);inta[n][n],
tot
,x,y;memset(a,0,sizeof
Guan_qiqi
·
2020-08-18 02:53
洛谷
【模板】求欧拉回路
摘自李煜东《算法竞赛进阶指南》#includeconstintN=1e5+10,M=1e6+10;structEdge{intv,nx;}e[M];intn,m,hd[N],vis[M],
tot
,top
不进清北不改名
·
2020-08-18 01:56
模板
2n皇后问题
includeusingnamespacestd;constintmaxn=8;intA[maxn][maxn];intB[maxn],C[maxn];inttot=0;voidblack(intn,intcur){if(cur==n)
tot
追梦者__Alomiga
·
2020-08-18 01:53
算法练习
openjudge 8469 特殊密码锁
includeconstintN=3000+20;usingnamespacestd;inttot,ans1=0,ans2=0,len;chara[N],b[N];intx[N],y[N];voidinit(){
tot
M_ercury_
·
2020-08-17 23:04
贪心
【Luogu_P4017】最大食物链计数
链接思路:我们要设两个数组分别记录它的入度和出度,在拓扑排序时判断它是否是最高级消费者,就把它的总链数加起来代码:#includeusingnamespacestd;intn,m,k,x,y,
tot
;structnode
V-Legendary skeleton
·
2020-08-17 23:51
题解
拓扑排序
【Luogu_P1347】排序
题目链接思路:直接附代码#include#include#include#include#include#include#includeusingnamespacestd;intn,m,
tot
,head
V-Legendary skeleton
·
2020-08-17 23:51
题解
拓扑排序
【Luogu_P1983】车站分级
把没有停靠的车站向停靠了的车站连一条边,然后在拓扑排序#include#include#include#include#include#include#includeusingnamespacestd;intn,m,
tot
V-Legendary skeleton
·
2020-08-17 23:51
题解
拓扑排序
ccf csp 201803-1 跳一跳
#includeusingnamespacestd;intmain(){intstate,prev=1,
tot
=0;while(true){cin>>state;if(state==0){break;}
大吉大利,今晚AC
·
2020-08-17 23:40
csp
UVALive 4960 Sensor network(MST+LCA)
includeusingnamespacestd;constintmaxn=355;constintmaxm=100010;constintinf=0x3f3f3f3f;intn,m;inthead[maxn],
tot
just_sort
·
2020-08-17 23:37
ACM/ICPC图论_LCA
数论 素数
intx){//判断x是不是质数,是返回true,不是返回falseif(xconstintN=100000+5;boolprime[N];//prime[i]表示i是不是质数1为是素数intp[N],
tot
henucm
·
2020-08-17 22:18
数论
模板
ubuntu 下连接 github
shell里检查是否可以连接到GitHub:
[email protected]
如果看到:Warning:Permanentlyadded‘github.com,204.232.175.90’(RSA)
tot
dreamsfire
·
2020-08-17 22:29
linux学习
P5728 【深基5.例5】旗鼓相当的对手
二维数组进行记录,二重循环不重不漏#include#includeusingnamespacestd;ints[1001][4],
tot
;intmain(){intn;cin>>n;for(inti=1
戎码关山
·
2020-08-17 22:53
#
洛谷
P4445 [AHOI2018初中组]报名签到
includeusingnamespacestd;longlongtot;intmain(){intn;cin>>n;int*a=newint[n+5];for(inti=1;i>a[i];for(inti=1;ia[i+1])
tot
戎码关山
·
2020-08-17 22:53
#
洛谷
Day6 下(
includeusingnamespacestd;typedeflonglongLL;constintN=1e5+100;inta[N],n,len;chars[N];intw[N],maxn;LLf[N],
tot
banghuo2937
·
2020-08-17 21:39
数据结构与算法
NOIP2018模拟9.15总结
240RANK1暴力真是爽T1题意有N个点,M条边,K个特殊点,边权为1求每个点到离他最远的特殊点的最短距离NK#defineN300001usingnamespacestd;inti,j,k,l,n,m,
tot
精细_精甚_细腻
·
2020-08-17 21:52
总结
洛谷 [P1995] 程序自动分析
并查集+离散化首先本题的数据范围很大,需要离散化,STL离散化代码://dat是原数据,id是编号,sub是数据的副本sort(sub+1,sub+
tot
+1);size=unique(sub+1,sub
aiwa6731
·
2020-08-17 21:03
OpenJudge 1.11-0.7 和为给定数
,r,mid;cin>>n;for(inti=1;i>a[i];cin>>m;sort(a+1,a+n+1);for(inti=1;ia[mid])l=mid+1;elser=mid-1;}a[i]=
tot
WhiStLenA
·
2020-08-17 20:00
noi
洛谷1217 有线电视网 树上dp
;k--)for(intj=1;j#include#definemaxn3005usingnamespacestd;structE{intto,nxt,d;}b[maxn];intfst[maxn],
tot
Loi_a
·
2020-08-17 20:06
===DP及优化===
DP
AGC019 E.Shuffle and Swap-DP+NTT
AbiAbi,求有几种方式使得A=B字符串长度#include#includeusingnamespacestd;chara[100010],b[100010];intn,num,f[510][510],
tot
Fizzmy
·
2020-08-17 19:24
脑洞
FFT
DP
自己学校出cha的dian联zheng考jie(11.7)
的表达式:题解只是说要贪心的构造x,一开始我还是有点懵的py了一下学长的代码,发现真的是贪心注意:只有m为整数的时候才有一下的操作我们确定了一个n之后,m中b的次方最大的就是n我们就从b^n次方开始:
tot
Coco_T_
·
2020-08-17 17:49
日常hu测
二分
群论_置换_轮换
乱搞
贪心
pytorch LSTM 训练CIFAR10数据集
importtorchimporttorchvisionfromtorchvisionimporttransformsfromtorchimportnnfromtorchimportoptimfromtorch.autogradimportVariableimporttorch.nn.functionalasFtransform=transforms.Compose([transforms.
ToT
Alphapeople
·
2020-08-17 16:34
人工智能
深度学习
计算机视觉
UVA315- Network(无向图割点)
includeusingnamespacestd;constintMAXN=1005;structEdge{intto,next;boolcut;}edge[MAXN*10];inthead[MAXN],
tot
LYoGa
·
2020-08-17 15:46
图论-深度优先遍历
Polya 定理练习题
DpUva10294,11077,LA3641:P146~149,Polya定理Uva11762#include#include#include#includeconstintmaxn=1e6+4;intprime[maxn],
tot
::Dash::
·
2020-08-17 12:58
uva
POJ-3421 X-factor Chains---求因子+递推 或 素因子+组合数学
思路一:自己的解答:首先求出所有的因子,排序,然后定义一个length数组和
tot
数组,length[i]表示从第i个因子到最后一个因子的最大链长,
tot
[i]表示第i个因子到最后一个因子的最大链长
weixin_34081595
·
2020-08-17 06:54
牛客练习赛65题解(第四题)
constLLmaxn=1e6+10;constLLmod=1e9+7;LLvis[maxn],prime[maxn];LLtot,ans=1;doublemx;vectorp[maxn];LLn;voidinit(){
tot
qq_3030364995
·
2020-08-17 06:04
codeforces 1239D
#includeusingnamespacestd;constintmaxn=1000005;constintmaxm=1000005;inthe[maxn],ver[maxm],ne[maxm],
tot
职业砖瓦匠
·
2020-08-17 05:55
Codeforces Round #263 (Div. 1) B. Appleman and Tree(给一棵树,每个点为白色或黑色,切断一些边,使得每个连通块有且仅有一个黑点,问划分方案数。)
includeusingnamespacestd;constintN=1e5+100;constintMOD=1e9+7;structEdge{intto,next;}e[N*2];inta[N],ans[N],
tot
_zidaoziyan
·
2020-08-17 05:02
树形dp
A*和K短路
需要把所有步数#include#include#includeusingnamespacestd;constintmaxn=1000,maxm=100000,maxk=1000;intn,m,st,gl,K,
tot
ZigZagK
·
2020-08-17 04:58
Astar和K短路
算法&数据结构总结By_ZZK
1003 Emergency(两点间最短路径的条数)
用
tot
[i]表示起点到第i个点最短路径的条数。num[i]表示起点到第i个点的最短路中权值和的最大值,dis[i]表示当前从起点到i的最短路的距离。
luyehao1
·
2020-08-17 01:17
ACM-最短/长路径
ACM-日常训练
2017.9.24 三色二叉树 思考记录
所以枚举下面点的情况转移就可以了码:#include#includeusingnamespacestd;#includevectorv[100005];intf[100005][2],g[100005][2],
tot
_hlly_
·
2020-08-17 00:08
题目
HDU4825 01字典树模板题
includeusingnamespacestd;constintMAXN=100000+7;structnode{intnext[2];intcnt;intw;}t[MAXN*33];inta[MAXN],num[33],
tot
Start_to_crazy
·
2020-08-16 23:44
字典树
~Keywords Search~~~~AC自动机
输入:第一行是一个整数N,表示关键词个数,下面有N个关键词,Nq;for(inti=0;iusingnamespacestd;constintN=1e6+1;inttrie[N][26],num[N],
tot
HAUT_Xjl
·
2020-08-16 23:51
算法
【GDOI2013模拟1】病毒传播
上标:#include#include#defineN1510usingnamespacestd;intm,a[N],s[N],bz[N],
tot
=0;longlongK;i
Larry1118
·
2020-08-16 23:48
矩阵乘法
上一页
7
8
9
10
11
12
13
14
下一页
按字母分类:
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
其他