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
NXT
acm算法模板(4)
读入外挂 int
nxt
_int(){// neg or pos char ch;  
·
2015-11-09 14:24
ACM
字符串匹配--字典树模板
include<string.h> 3 const int maxm=5050; //maxm是所有单词的总长度 4 5 struct trie{ 6 int
nxt
·
2015-11-08 10:37
字符串
【洛谷T580】【模板】template 鸡腿 tarjan找割点
代码:#include #include #include #include usingnamespacestd; constintSIZE=1000010; inthead[SIZE],
nxt
[SIZE
LOI_DQS
·
2015-11-05 10:00
Tarjan
【洛谷T577】【模板】template 最短路 SPFA+dij
usingnamespacestd; typedeflonglongLL; constLLINF=200000000000000000ll; constintSIZE=100010; inthead[SIZE],
nxt
LOI_DQS
·
2015-11-05 09:00
最短路
SPFA
dij
【洛谷1593】【模板】template负环 递归SPFA判负环
include #include usingnamespacestd; constintINF=2000000000; constintSIZE=500010; intn; inthead[SIZE],
nxt
LOI_DQS
·
2015-11-05 08:00
洛谷
【tyvj1322】【模板】危险的桥 tarjan找桥
又是一个模板题…代码:#include #include #include #include usingnamespacestd; constintSIZE=100010; inthead[SIZE],
nxt
LOI_DQS
·
2015-11-04 17:00
tyvj
【东方模拟赛】【模板】上白泽慧音 tarjan找scc
include #include #include #include #include usingnamespacestd; constintSIZE=100010; inthead[SIZE],
nxt
LOI_DQS
·
2015-11-04 15:00
东方
TCP的拥塞控制 (三)
其中上图中的三条线分别描述的是SND.UNA,SND.
NXT
,SND.UNA+SND.WND三
·
2015-11-02 11:22
tcp
BZOJ3747 : [POI2015]Kinoman
首先预处理出[1,i]的答案 设
nxt
[i]表示i下一次出现的位置 随着左端点l往右移,[l+1,
nxt
[l]-1]里答案都减去它的价值,[
nxt
[l],
nxt
[
nxt
[l]]-1]里答案都加上它的价值
·
2015-10-31 16:13
poi
最大流 sap用法 和 模板
typedef struct node{ int v, w; struct node *
nxt
, *op; }NODE; NODE edg[MM]; // 保存所有的边
·
2015-10-31 15:10
SAP
BZOJ1707 : [Usaco2007 Nov]tanning分配防晒霜
#include<cstdio> const int N=7010,inf=~0U>>2; struct edge{int t,f;edge*
nxt
,*pair
·
2015-10-31 11:52
USACO
BZOJ3835 : [Poi2014]Supercomputer
$O(n)$ #include<cstdio> #define N 1000010 typedef long long ll; int n,m,i,x,g[N],
nxt
·
2015-10-31 11:50
super
BZOJ2789 : [Poi2012]Letters
#include<cstdio> #define N 1000010 int n,i,j,k,g[26],
nxt
[N],bit[N];char a[N],b[N];long
·
2015-10-31 11:49
2012
BZOJ3417 : Poi2013 Tales of seafaring
,无论怎么走都不可行 #include<cstdio> const int N=10010,Q=1000010; int n,m,k,i,j,x,y,z,g[N],
nxt
·
2015-10-31 11:49
poi
关联数据和formatter问题-easyui+微型持久化工具
System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Mvc; using
NXT
.Core
·
2015-10-31 11:28
easyui
极度简化版 HeapSort
void heapsort(int* array, int size) { int top = size; int bot = size; int cur; int
nxt
·
2015-10-31 10:25
sort
《挑战》2.1 POJ 2386 Lake Counting (简单的dfs)
iostream> 3 4 using namespace std; 5 6 # define MAX 123 7 8 char grid[MAX][MAX]; 9 int
nxt
·
2015-10-31 09:11
count
POJ_3321_Apple Tree
#include<iostream> using namespace std; const int MAX = 100005; struct apple { int v,
nxt
·
2015-10-30 13:53
apple
C++学习之路--类的构建以及数据转换存储
{ struct Link { void* data; Link* next; Link(void* dat, Link*
nxt
·
2015-10-27 14:26
C++
离线不同数
1 int s[N],a[N];//离线瞎搞 2 int n,q,ans[M]; 3 int
nxt
[N]; 4 map<int,int >mp; 5 struct Question
·
2015-10-21 12:45
链表反转
namespace std; #define NN 1 struct node{ int value; node * next; node(int v = -1, node *
nxt
·
2015-10-21 11:39
链表
【bzoj3036】绿豆蛙的归宿
bfs不知道哪里错了于怒改dfs==|#include#definerep(i,a,b)for(inti=a;i<=b;i++)#definefore(i,u)for(inti=head[u];i;i=
nxt
GEOTCBRL
·
2015-10-03 20:52
水题
简单DP
概率DP
【bzoj3036】绿豆蛙的归宿
不知道哪里错了于怒改dfs==|#include #definerep(i,a,b)for(inti=a;i<=b;i++) #definefore(i,u)for(inti=head[u];i;i=
nxt
GEOTCBRL
·
2015-10-03 20:00
【SCOI2011】糖果 差分约束
掉这个题却恬不知耻的发代码的人的代码:#include #include #include #include usingnamespacestd; constintSIZE=100010; inthead[SIZE],
nxt
LOI_DQS
·
2015-09-23 21:00
图论
差分约束
bzoj2330
HDU 4114 Disney's FastPass
传送门#include usingnamespacestd; #defineprt(k)cerr>j&1)){ int&
nxt
=d[p[j]][s1][s2|(1>j&1)add+=FT[j]; elseadd
u011788531
·
2015-09-22 22:00
Aizu 2249 Road Construction(SPFA算法变形,好题)
4996) #include #include #include #include usingnamespacestd; constintN=10005; constintM=N*4; intfst[N],
nxt
acraz
·
2015-09-20 09:00
HDU 4302 Holedox Eating (multiset模拟)
multiset或者map模拟的水题 有个trick就是--有可能会被呆在原地的多个吃的隐藏的修改了方向然后就跪了 数据还是水了题目里的数据只有一个方向的如果不判断等于pre也可以过 但是等于
nxt
lwt36
·
2015-09-14 21:00
POJ 1201 Intervals(差分约束系统)
特别注意一下隐含条件:0#include#includeusingnamespacestd;constintN=50005;intfst[N],
nxt
[4*N],to[N*4],cost[N*4],e;
acraz
·
2015-09-08 22:37
图论
POJ 1201 Intervals(差分约束系统)
特别注意一下隐含条件:0 #include #include usingnamespacestd; constintN=50005; intfst[N],
nxt
[4*N],to[N*4],cost[N
acraz
·
2015-09-08 22:00
POJ 2752 Seek the Name, Seek the Fame(KMP)
理解好
nxt
数组后这个题目不难题目让求所有原串前后缀,前后缀就是既是前缀也是后缀的字符串。
acraz
·
2015-08-14 17:00
POJ 1961 Period(KMP最小循环节)
不懂如何用
nxt
数组求最小循环节的看这里#pragmawarning(disable:4996) #include #include usingnamespacestd; chars[1000005]
acraz
·
2015-08-14 16:00
POJ 2406 Power Strings(KMP求最小循环节)
先简单介绍一下KMP算法利用
nxt
数组求最小循环节的原理:假设图中的黑色是原来的字符串,现在要求最小循环节,对于
nxt
[len]来说指的是图中蓝色和黄色的长度,而且蓝色和黄色是相等的,那么绿色和紫色也是相等的
acraz
·
2015-08-14 16:00
KMP字符串匹配算法
主要是
nxt
数组的应用。下面来说说
nxt
数组意义:(1)
nxt
[0]=-1(2)
nxt
[i]=k表示模式串s[0,...,k-1]与s[i-k,...i-1]相同且最长接下来考虑一下
nxt
数组的求法。
acraz
·
2015-08-13 16:00
POJ 3169 Layout
defineINF0xfffffff usingnamespacestd; constintV=1010; constintE=20010; intn,ml,md; intpnt[E],cost[E],
nxt
piaocoder
·
2015-08-12 16:00
差分约束系统
LCA模板
include#include#include#include#include#include#include#includeusingnamespacestd;intaim[20000],len[20000],
nxt
Beyoursven
·
2015-08-01 12:32
总结
HDU5326-Work (建反图,遍历)
include constintN=100; intnxt[N],pnt[N],head[N]; intn,m,e; intin[N]; voidAddEdge(intx,inty) { pnt[e]=y;
nxt
KJBU2
·
2015-07-29 16:00
hiho一下 第五十三周(无向图的双连通分量)
include usingnamespacestd; constintINF=1<<29; constintmaxn=20001; constintmaxm=100012*2; inte=0,pnt[maxm],
nxt
KJBU2
·
2015-07-10 16:00
【最大点独立集】【poj1419】【Graph Coloring】
求最大团代码:#include #include #include usingnamespacestd; constintmaxn=11000; inte,ans,res,n,m,head[110],
nxt
zy691357966
·
2015-07-05 16:00
kmp
nxt
数组
昨天看了kmp,
nxt
的数组那部分有两种写法第一种k=0;for(inti=1;i0&&str[k]!
meixiuxiudd
·
2015-06-15 18:00
省选模版复习——后缀数组
constintMaxn=500005; typedeflonglongLL; LLAns; charS[Maxn]; intH[Maxn],Rank[Maxn],q[Maxn],pre[Maxn],
nxt
Zeyu_King
·
2015-04-15 08:00
后缀数组
Codeforces 494B
const int maxn = 100005; const int mod = (int)1e9+7; char s[maxn], t[maxn]; long long dp[maxn][3]; int
nxt
minglotus
·
2015-02-22 10:00
hdu 5172 GTY's gay friends 线段树
思路:对于一个长度为len的区间,如果最大值为len,最小值为1,并且区间元素没有重复的话就说明它是一个1~len的排列,最值可以用线段树来求,对于区间重复的话可以先预处理每个元素的下一个出现位置
nxt
u013654696
·
2015-02-08 14:00
链表是否有环
Node*isLoop(Node*head){ if(head==NULL||head->
nxt
==head) { returnhead; } Node*p=head; Node*q=head; while
u200814499
·
2014-10-18 11:00
递归创建链表
=-1) { Node*node=newNode(); node->v=input; node->
nxt
=create(); returnnode; } returnNULL; }
u200814499
·
2014-10-18 10:00
「后缀数组」完全攻略
后者的构造方法主要是插入字符串到trie树,并生成所有节点,每个节点包含
nxt
和child[26],然后宽搜+dp。初始化每个节点里的
nxt
和child[]。自动机的用处主要是模式串匹配。
brandohero
·
2014-10-18 01:00
HOJ 1007 SPF
dfs求出连通分量这是第一种方法#include#include#includeusingnamespacestd;structpath{intx,y;}s[500001];intfst[500001],
nxt
子饺
·
2014-10-06 14:08
HOJ
割点和桥
Codeforces 282E. Sausage Maximization【trie树(非指针版)】
的最大值(0 #include #include #include #defineN100010 usingnamespacestd; structnode { longlongnxt[2];//存储
nxt
u013912596
·
2014-09-08 18:00
数据结构
C++
ACM
codeforces
POJ-1986-Distance Queries
include #include #include #include usingnamespacestd; constintmaxn=1e5; constintmaxm=5e5; inte,head[maxn],
nxt
z309241990
·
2014-08-29 10:00
LCA
POJ-2749-Building roads
include #include usingnamespacestd; constintinf=1>hate,like; stacks; voidAddEdge(intu,intv) { pnt[e]=v;
nxt
z309241990
·
2014-08-28 20:00
2-sat
POJ-1236-Network of Schools
include #include #include usingnamespacestd; constintmaxn=110; constintmaxm=maxn*maxn; inte,head[maxn],
nxt
z309241990
·
2014-08-26 00: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
其他