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
spoj
SPOJ
4487. Can you answer these queries VI(GSS6) splay
一个序列,四中操作,在x前插入y;删除位置x的数;把位置x的数改成y;查询区间[x,y]的最大子段和。算是维护数列的简化版吧,但时间卡的要死=...输入挂+输出挂都用上了才勉强卡过去....#include #include #include #include #include usingnamespacestd; typedefintll; constintmaxn=200000+10000
yanglei040
·
2014-03-04 23:00
spoj
1029. Matrix Summation(二维树状数组)
1、http://www.
spoj
.com/problems/MATSUM/2、题目大意:给一个n*n的矩阵,对这个矩阵有三种操作,一是SETxynum将(x,y)位置的数改成num,二是SUMx1y1x2y2
sdjzping
·
2014-03-03 21:00
SPOJ
QTREE LCT
单旋splay的LCT 刚好卡过。。 #include#include#include#include#include#defineMAXN100000usingnamespacestd;structnode;node*pt;structnode{node*l,*r,*f;intval,size,mx;node(){}node(int_val){l=r=f=NULL,val=_val,size=1
acrossthesky
·
2014-03-03 20:34
LCT
树
spoj
problems
spoj
1825 Free tour II(树的点分治)
spoj
1825FreetourII(树的点分治)09年漆子超论文第二题。主要是在算经过某一棵树的根的答案这一步很难想。假设这个根节点为u,有若干个子树v。
No__stop
·
2014-02-22 14:00
树分治
SPOJ
3273 Order statistic set
红果果的treap模板题。。。白书版treapOrderstatisticsetTimeLimit: 2000MS MemoryLimit: Unknown 64bitIOFormat: %lld&%llu[Submit] [GoBack] [Status] DescriptionEnglishVietnameseInthisproblem,youhavetomaintainadynamic
u012797220
·
2014-02-16 16:00
treap
spoj
NQUEEN N皇后 DLX
经典N皇后问题,本来是做POJ3239的,结果写完了才发现n最大300..DLX一样会超时,而且那题居然是构造做的...
spoj
上n最多只有50,而且初始会给出若干个已有皇后的位置。
yanglei040
·
2014-02-13 03:00
spoj
417 The lazy programmer(贪心&优先队列)
SPOJ
ProblemSet(classical)417.ThelazyprogrammerProblemcode:LAZYPROG Anewweb-designstudio,calledSMART
y5885922
·
2014-01-21 19:00
c
算法
ACM
[置顶] 啦啦
动态规划:区间dp,树状dp,数位dphdu3555,sgu258,sgu390 队列优化:zoj3399最小表示法的状态压缩DP:
spoj
2159 专题链接:http://acm.hust.edu.cn
dslovemz
·
2014-01-09 14:00
Spoj
375 QTREE1 树链剖分裸题
题目链接:http://www.
spoj
.com/problems/QTREE/题意:T个测试案例n个点的树下面n-1条边和边权 changeuv把第u-th给出的边的边权改为vquery询问路径[u,
qq574857122
·
2013-12-14 21:00
(Relax ST1.4)POJ 1056 IMMEDIATE DECODABILITY(判断一个字符串是否是另外一个字符串的前缀)
importjava.util.ArrayList; importjava.util.List; importjava.util.Scanner; publicclas
sPOJ
_1056{ publicstaticbooleanisPrefix
caihongshijie6
·
2013-12-04 10:00
spoj
220求至少出现两次且不重叠的最长公共子串
YouaretheKingofByteland.Youragentshavejustinterceptedabatchofencryptedenemymessagesconcerningthedateoftheplannedattackonyourisland.YouimmedietalysendfortheBytelandianCryptographer,butheiscurrentlybusy
xingyeyongheng
·
2013-12-03 22:00
SPOJ
QTREE(Query on a tree树链剖分)
SPOJ
QTREE其实我只是来贴下我的模板。。。树链剖分的大致构造过程是这样的,先第一遍dfs,计算出重儿子,然后第二遍dfs就是根据重儿子构造重链,并构造线段树代码:
No__stop
·
2013-11-30 19:00
树链剖分
website programmer should vist
HereisanexhaustivelistofwebsitesthatIhavebookmarkedwhichmayhelpyou:ProgrammingPracticeandContesthttp://www.codechef.com/http://www.
spoj
.com
qinglinsan
·
2013-11-29 23:00
Substitution Cipher
spoj
SCYPHER
http://www.
spoj
.com/problems/SCYPHER/拓扑排序,要求是全序集#include #include #include #include #include #include
gyarenas
·
2013-11-24 14:00
Spoj
1716 Can you answer these queries III 线段树 单点修改 区间求最大子段和
题目链接:点击打开链接==原来写1的时候已经把更新函数写好了。。#include #include #include #include #include #include #include usingnamespacestd; #defineN50050 #defineLson(x)tree[x].l #defineRson(x)tree[x].r #defineL(x)(x>1;} intlma
qq574857122
·
2013-11-22 22:00
SPOJ
4168 Square-free integers
求1-n之间Square-freeintegers的个数。第一种方法是裸的容斥原理,枚举每一个质因子要还是不要,然后用总数减去存在平方质因子的数的个数。剪枝的方法是在dfs内进行循环,这样避免每次都去递归试探一个质因子不要的情况。代码基本是抄的,剪枝很强力。#include #include usingnamespacestd; typedeflonglongll; constintX=10000
zzxyyx_1
·
2013-11-22 21:00
容斥原理
mobius函数
(Relax 数论 1.17)POJ 3101 Astronomy(分数的最小公倍数)
importjava.math.BigInteger; importjava.util.Arrays; importjava.util.Scanner; publicclas
sPOJ
_3
caihongshijie6
·
2013-11-21 10:00
(Relax 数论 1.1)POJ 2429 GCD & LCM Inverse(已知GCD、LCM,反求a、b)
importjava.math.BigInteger; importjava.util.Scanner; publicclas
sPOJ
_2429{ staticlonggcd(longa,longb
caihongshijie6
·
2013-11-19 10:00
(Relax 贪心1.4)POJ 2325 Persistent Numbers(使用贪心策略解决这么一个问题: 给定一个数n,求一个最小的数m,使得m的各位的乘积==n)
importjava.math.BigInteger; importjava.util.Scanner; publicclas
sPOJ
_2325{ publicstaticvoidmain(String
caihongshijie6
·
2013-11-18 19:00
spoj
694之后缀数组
SPOJ
ProblemSet(classical)694.DistinctSubstringsProblemcode:DISUBSTRGivenastring,weneedtofindthetotalnumberofitsdistinctsubstrings.InputT-numberoftestcases.T
xingyeyongheng
·
2013-11-12 21:00
SPOJ
-SQRBR Square Brackets
原题传送:http://www.
spoj
.pl/problems/SQRBR动态规划。设f[i][j]表示前i个位置在合法情况下缺少j个右括号的方案数。
·
2013-11-12 19:00
rack
spoj
687. Repeats
687.RepeatsProblemcode:REPEATSAstringsiscalledan(k,l)-repeatifsisobtainedbyconcatenatingk>=1timessomeseedstringtwithlengthl>=1.Forexample,thestrings=abaabaabaabaisa(4,3)-repeatwitht=abaasitsseedstring
u010422038
·
2013-11-10 16:00
spoj
694 705. New Distinct Substrings
705.NewDistinctSubstringsProblemcode:SUBST1Givenastring,weneedtofindthetotalnumberofitsdistinctsubstrings.InputT-numberoftestcases.T #include #include usingnamespacestd; #definemaxn200500 intwa[maxn],
u010422038
·
2013-11-09 14:00
SPOJ
9126 Time to live
点击打开
SPOJ
9126题意:给定一个n台计算机的网络的连接图,这个图是一棵树的形式。现在要以某一台计算机为路由器,问其它的计算机到路由器的最长的距离的最小值思路:给定一个树,我们能够求出树的直径。
cgl1079743846
·
2013-11-08 12:00
(拓扑排序11.3.1)POJ 1270 Following Orders(拓扑排序: 求变量串在约束组的作用下产生的有序集)
packagecom.njupt.acm; importjava.util.Scanner; publicclas
sPOJ
_1270{ publicstaticintpre[];//入度序列 publicstaticbooleanhas
caihongshijie6
·
2013-11-08 10:00
(二叉搜索树10.1.2)POJ 1577 Falling Leaves(根据删除叶子节点的顺序输出计算一颗二叉树的前序遍历序列)
packagecom.njupt.acm; importjava.util.Scanner; publicclas
sPOJ
_1577{ publicstaticvoidmain(String[]args
caihongshijie6
·
2013-11-07 10:00
SPOJ
- BALNUM Balanced Numbers
SPOJ
-BALNUMBalancedNumbersTimeLimit: 1000MS MemoryLimit: Unknown 64bitIOFormat: %lld&%llu[Submit] [GoBack
u011788531
·
2013-11-04 19:00
Algorithm
DFS
SPOJ
057 Supernumbers in a permutation
原题链接:http://www.
spoj
.com/problems/SUPPER/这道题n())或降序查找(greater())。
·
2013-11-01 17:00
number
spoj
COT 可持久化数据结构 (LCA模版)
查询树链第K大。 每个版本的线段树维护的是从这个节点到根的树链的版本,由于树链第K大,在统计比X小的数个数时是可以进行加减法运算的,所以 就可以用可持久化数据结构。维护个数时,sum=f(a)+f(b)-f(c)-f(d) :c为a,b的最近公共祖先,d为c的父亲节点。这样就是四个版本运算。同时:二分可以直接在树上跑,判断左半区域的和是否大于K,大于K说明第K大的
OceanLight
·
2013-10-30 10:00
(高精度运算4.7.26)POJ 1220 NUMBER BASE CONVERSION(高精度数的任意进制的转换——方法:ba1----->10进制----->ba2)
packagecom.njupt.acm; importjava.math.BigInteger; importjava.util.Scanner; publicclas
sPOJ
_1220_1{
caihongshijie6
·
2013-10-30 09:00
Uva 1514 &&
spoj
9890 拆点匹配L模板 + 时间戳优化
题目链接:http://www.
spoj
.com/problems/NWERC11D/PieceittogetherTomhasdevelopedaspecialkindofpuzzle:itinvolvesawholebunchofidenticalpuzzlepieces.ThepieceshavetheshapeofthreeadjointsquaresinanL-shape.Thecorn
qq574857122
·
2013-10-29 13:00
(字符串的处理4.7.13)POJ 2141 Message Decowding(字符串的加密与解密&&所有都是字符且是2行形式的输入输出处理)
packagecom.njupt.acm; importjava.util.Arrays; importjava.util.Scanner; publicclas
sPOJ
_2141{ publicstaticvoidmain
caihongshijie6
·
2013-10-28 15:00
(字符串的模式匹配4.7.12)POJ 2121 Inglish-Number Translator(将英文数字转换成阿拉伯数字)
packagecom.njupt.acm; importjava.util.HashMap; importjava.util.Map; importjava.util.Scanner; publicclas
sPOJ
caihongshijie6
·
2013-10-28 12:00
Uva 1514 &&
spoj
9890 拆点匹配L模板 + 时间戳优化
题目链接:http://www.
spoj
.com/problems/NWERC11D/PieceittogetherTomhasdevelopedaspecialkindofpuzzle:itinvolvesawholebunchofidenticalpuzzlepieces.ThepieceshavetheshapeofthreeadjointsquaresinanL-shape.Thecorn
qq574857122
·
2013-10-27 10:00
(数组的应用二:高精度运算4.2.1)POJ 1504 Adding Reversed Numbers(将一个数取反)
packagecom.njupt.acm; importjava.math.BigInteger; importjava.util.Scanner; publicclas
sPOJ
_1504{ publicstaticvoidmain
caihongshijie6
·
2013-10-25 11:00
SPOJ
NETADMIN Smart Network Administrator
最小最大化问题惯用二分,
SPOJ
似乎很喜欢点标号乱搞?
speedcell4
·
2013-10-21 17:00
SPOJ
IM Intergalactic Map
从1出发经过2到达3,不走相同边,从2做源点,1、3合并为汇点看最大流是不是2就好了……点标号会坑爹,map处理……/* Author:Speedcell Update:2013-10-16 Version:soppYcell2.4 */ #include #include #include #include #include #include #include #include #inclu
speedcell4
·
2013-10-21 17:00
spoj
694 Distinct Substrings(求不同的子串个数,后缀数组基础题)
题目:http://www.
spoj
.com/problems/DISUBSTR/题目大意:给你一个字符串,然后让你求出它的不同的子串的个数。
u010794465
·
2013-10-20 15:00
POJ 1220 (两种任意进制之间的转换(大数),java的BigInteger)
参考大神的,用BigIntegerpackagecom.zyh.hdu; importjava.math.BigInteger; importjava.util.Scanner; publicclas
sPoj
1220
u011282069
·
2013-10-20 11:00
SPOJ
PGCD 4491. Primes in GCD Table && BZOJ 2820 YY的GCD (莫比乌斯反演)
4491. Primes in GCD Table Problem code: PGCD Johnny has created a table which encodes the results of some operation -- a function of two arguments. But instead of a boring multiplication tabl
·
2013-10-19 22:00
table
SPOJ
DISUBSTR Distinct Substrings
每个子串一定是某个后缀的前缀,然后枚举后缀就知道这个后缀能贡献多少个子串,然后height可以查到有多少个重复了,所以累加答案就好了……/* Author:Speedcell Update:2013-10-16 Version:soppYcell2.4 */ #include #include #include #include #include #include #include #incl
speedcell4
·
2013-10-19 10:00
(DA1.5.3)POJ 3094 Quicksum()
importjava.util.ArrayList; importjava.util.HashMap; importjava.util.Map; importjava.util.Scanner; publicclas
sPOJ
caihongshijie6
·
2013-10-18 21:00
双向BFS
id=1077#include//双向BF
Spoj
107716ms #include #include #include usingnamespacestd; constintV=362882; structnod
gaotong2055
·
2013-10-17 14:00
SPOJ
AMR12A The Black Riders(二分+二分匹配)
有n个人,m个洞。每个洞能容纳一个人,每个人到每个洞需要花费一些时间。每个人到达一个洞后可以花C的时间来挖洞,这样该洞的容量就变成2了。求能使至少K个人进洞的最短时间。还是将求极值问题转化为判定问题。二分枚举时间,能否在time的时间内让至少K个人进洞?求进洞人数当然用二分匹配做。g[i][j]为第i个人到第j个洞的时间。如果g[i][j] #include #include #include #
diary_yang
·
2013-10-16 17:00
SPOJ
AMR12C Entmoot(二分+圆的面积交)
题意是有n个人,每个人有各自坐标以及速度,求一个点X,使得所有点走到X点,耗时最大的那个人的耗时最小。输出这个时间。抽象成圆的面积交:二分枚举时间将求极值问题转换为判定问题。如何判断是否存在一个点X,使得所有点都能在time时间内到达X?每个人在time时间内的运动范围是以其初始座标为圆心,半径v*time的一个圆。那么问题就很直观了,只要由time生成的这n个圆存在交,那么所有人就能在time时
diary_yang
·
2013-10-16 17:00
POJ 1001(高精度运算)
packagecom.njupt.acm; importjava.math.BigDecimal; importjava.util.Scanner; publicclas
sPOJ
_1001{ publicstaticvoidmain
caihongshijie6
·
2013-10-14 20:00
spoj
1043. Can you answer these queries I (线段树)
题目链接:http://www.
spoj
.pl/problems/GSS1/ 题意:给出n个数,询问某一区间中,最大的连续子段和。
qian99
·
2013-10-13 10:00
数据结构
线段树
spoj
10628 Count on a tree (主席树+lca)
题意:给出一棵树,树上每个节点都有权值,有m个询问,求u到v的路径上第k大的数。思路:用主席树为树上每个节点建立一棵线段树,和区间第k大的求法差不多,由于是在树上,只是添加的顺序有一些问题。每个节点对应的线段树表示从当前节点到根节点的路径中的数据,根据这个,如果我们找到了两个节点的lca,那么我们可以发现,这两条路径其实覆盖了它们公共祖先到根节点的路径,求第k大的时候只要把这一部分减去就行了,不过
qian99
·
2013-10-11 21:00
数据结构
主席树
SPOJ
-PGCD Primes in GCD Table (Mobius反演 好题)
题意:给你a,b,求gcd(i,j)=k(k为素数)的个数,1=2,ki为不大于n的素因子。设cnt(n)= F(n)*(mu(n/k1)+mu(n/k2)+mu(n/k3)+...)对于mu(n/k1)如果这个值为0的话就可以忽略了。所以可以枚举所有mu(x)不为0的数,然后cnt(x*k)+=mu(x),就可以处理出所有的cnt(n),然后用上面的分段的方法就可以解决了。具体见代码/*****
u010710717
·
2013-10-11 18:00
SPOJ
1811 Longest Common Substring SAM
-----------------Astringisfinitesequenceofcharactersoveranon-emptyfinitesetΣ.Inthisproblem,Σisthesetoflowercaseletters.Substring,alsocalledfactor,isaconsecutivesequenceofcharactersoccurrencesatleaston
cyendra
·
2013-10-10 14:00
上一页
22
23
24
25
26
27
28
29
下一页
按字母分类:
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
其他