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
[Solver]
SPOJ
FINFRAC
题目地址:http://www.
spoj
.com/problems/FINFRAC/题目大意:给4个整数a,b,c,d,寻找两个整数p,q,使得a/b0和y>0(如果等于0,就不能严格大于小于了),有
gogdizzy
·
2013-03-27 17:00
数论
解题报告
spoj
1812 LCS2 (后缀自动机)
http://www.
spoj
.com/problems/LCS2/题意:求多个串的最长公共子串。
dyx404514
·
2013-03-25 21:00
spoj
1811 LCS (后缀自动机 SAM)
http://www.
spoj
.com/problems/LCS/题意:求两个字符串A,B的最长公共子串。字符串长度不超过250000。
dyx404514
·
2013-03-25 21:00
SPOJ
3273 Order statistic set(Treap应用)
题目链接:Clickhere~~题意:设计一个数据结构,可以在log(n)的时间内插入、删除、返回第k大、求某值的rank。解题思路:可以给在treap的基础上,每个节点加个size记录总共涵盖多少节点。调了一天,终于调出来了。好累啊。对于null节点取size的时候要格外小心,否则会指针访问未知内存,导致RE。所以我尝试了使用函数来返回值,果然可以实现空节点取size了,哈哈。贴出来大家交流学习
dgq8211
·
2013-03-19 12:00
SPOJ
10649 Mirror Number(三进制回文)
/*题目:MirrorNumber题目描述:AnumberiscalledaMirrornumberifonlateralinversion,itgivesthesamenumberi.eitlooksthesameinamirror.Forexample101isamirrornumberwhile100isnot. Giventwonumbersaandb,findthenumberofmir
laziercs
·
2013-03-17 16:00
UVA 1457
SPOJ
5154 Decrypt Messages
也是hdu3223。但是用c++交MLE,用g++交TLE。。。瞬间感到自己十分的无知啊。。。 还是求x^q=amodp,求出来所有x排序求几年几分几秒==如果做过的话,难点在于模拟吧==年月日和时分秒是不一样的,年月日初始是1,而时分秒初始是0。。提前算出每年每月每天用多少秒就好了,另外注意leapyear和leapsecond...细节都在solve()里了很好理解的。。#include #
zzxyyx_1
·
2013-03-07 22:00
[置顶] [Learning] SAM
Fromcxlove资料http://fanhq666.blog.163.com/blog/static/8194342620123352232937/题目http://www.
spoj
.pl/problems
dslovemz
·
2013-02-27 19:00
SPOJ
TTM To the moon(主席树+区间操作)
viewmode=contentsby---cxlove题目:给定一个序列,查询当前区间和,历史某个时期的区间和,以前区间修改,时间回滚操作http://www.
spoj
.com/problems/TTM
acm_cxlove
·
2013-02-03 14:23
ACM_数据结构
SPOJ
TTM To the moon(主席树+区间操作)
viewmode=contents by---cxlove题目:给定一个序列,查询当前区间和,历史某个时期的区间和,以前区间修改,时间回滚操作http://www.
spoj
.com/problems
ACM_cxlove
·
2013-02-03 14:00
SPOJ
COT 树上第K大(LCA+主席树)
http://www.
spoj
.com/problems/COT/为了做这题,先去学了一下DFS+RMQ的LCA求法。这题和普通的第K大类似。普通的第K大,是从后往前建立主席树,前一个在后一个的
acm_cxlove
·
2013-02-01 20:07
ACM_数据结构
SPOJ
COT 树上第K大(LCA+主席树)
http://www.
spoj
.com/problems/COT/ 为了做这题,先去学了一下DFS+RMQ的LCA求法。这题和普通的第K大类似。普通的第K大,是从后往前建立主席树,前一个在
ACM_cxlove
·
2013-02-01 20:00
POJ 1986 Distance Queries(在线LCA)
id=1986 我只是为了
SPOJ
COT来做一下LCA的。。。在线的LCA就是,先搞出一个欧拉序列然后RMQ中间部分,其实就是a到lca(a,b)到b的一棵子树找到最小深度即可。
ACM_cxlove
·
2013-02-01 18:00
SPOJ
DQUERY (离线数状数组||在线主席树)
viewmode=contents by---cxlove题目:给出一个序列,查询区间内有多少个不同的树链接:http://www.
spoj
.com/problems/DQUERY/ 跟着岛娘,适妞一起学主席树
ACM_cxlove
·
2013-02-01 12:00
[置顶] 【主席树】 跟岛娘学主席树
A http://www.
spoj
.com/problems/DQUERY/岛娘的资料:http://paste.ubuntu.com/1426159/http://paste.ubuntu.com/1426225
dslovemz
·
2013-01-30 03:00
spoj
694 OR 705 不相同的子串的个数
每个子串一定是某个后缀的前缀,那么原问题等价于求所有后缀之间的不相同的前缀的个数。如果所有的后缀按照suffix(sa[1]),suffix(sa[2]),suffix(sa[3]),......,suffix(sa[n])的顺序计算,不难发现,对于每一次新加进来的后缀suffix(sa[k]),它将产生n-sa[k]+1个新的前缀。但是其中有height[k]个是和前面的字符串的前缀是相同的。所
azheng51714
·
2013-01-24 13:00
spoj
61
写个总结吧,因为挺多细节的我们可以这样考虑,设a[i]=1如果第i个字符是( =-1如果第i个字符是)然后设src[i]=a[1]+a[2]+...+a[i]可以证明,如果一个括号序列是合法的话,那么src[1],src[2]..src[N]都是大于等于0的但是小心,这还是不足够的,这只是必要条件其次,如果一个括号序列是合法的话,src[N]必定等于0综合起来就是,一个合法的括号序列等价于 s
zzz2012
·
2012-12-28 19:00
spoj
GSS2 1557 Can you answer these queries II(成段更新)
题意:给你N个数,每个数a[i]的范围在[-100000,100000],然后有Q个查询,每个查询问区间[x,y]内最大子区间和为多少,并且重复出现的值只能计算一次(如果是负数,输出0,即可以子区间可以为空)。 离线处理查询。每个值只能计算一次的方法同之前的hdu3333TuringTree&hdu3874Necklace(成段更新)及CodeforcesRound#136(Div.2)D.
shiqi_614
·
2012-12-20 03:00
2012 最后一个月
ACM,数学,都不行啊,,,,,总有人问我做了多少题目了,唉唉,POJ103+hdu133+zoj30+ +++,sguuvaural
spoj
usaco等等,再加上TC,CF和其他一些比赛做的题目,一年总共也没有
ArcTan
·
2012-12-03 21:00
SPOJ
4106 Fast Maximum Matching
大意不再赘述,题目链接:https://www.
spoj
.pl/problems/MATCHING/思路:HK算法求二分最大匹配模板,注意下标从1开始哦。
Wall_F
·
2012-12-02 14:00
泛型使用小结
泛型使用小结1、不得在超类中使用通配符,例如publicclas
sPoj
oModelTreeextendsIdentifiableTree错误信息如下:ThetypePojoModelTreecannotextendorimplementIdentifiableTree.Asupertypemaynotspecifyanywildcard2
阳小良
·
2012-11-29 13:14
java
spoj
3179 DPEQN 题解
题目连接:http://www.
spoj
.pl/problems/DPEQN/本题是探求多元一次同余方程的解法,虽然本题只要求一个解,但是我们完全可以求出所有解。
niuox
·
2012-11-27 14:00
SPOJ
7258 SUBLEX (SAM)
viewmode=contents by---cxlove 题目:给出一个串,查询字典序排在第k个的是哪个子串http://www.
spoj
.pl/problems/SUBLEX/ 由于SAM能遍历所有的子串
acm_cxlove
·
2012-11-27 14:36
ACM_字符串
SPOJ
7258 SUBLEX (SAM)
viewmode=contents by---cxlove 题目:给出一个串,查询字典序排在第k个的是哪个子串http://www.
spoj
.pl/problems/SUBLEX/ 由于SAM能遍历所有的子串
ACM_cxlove
·
2012-11-27 14:00
SPOJ
1812 LCS2(SAM)
viewmode=contents by---cxlove 题目:求多个串的LCShttp://www.
spoj
.pl/problems/LCS2/ 先将一个串建SAM,然后用后面的串去匹配,对于每一个串
ACM_cxlove
·
2012-11-26 20:00
SPOJ
1811 Longest Common Substring(SAM)
viewmode=contents by---cxlove 题目:求出两个串的LCShttp://www.
spoj
.pl/problems/LCS/ 先将A串建立SAM。
ACM_cxlove
·
2012-11-25 17:00
SPOJ
8222 Substrings(SAM)
转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove?viewmode=contents by---cxlove 题意:给一个字符串S,令F(x)表示S的所有长度为x的子串中,出现次数的最大值。求F(1)..F(Length(S)) (感谢clj的翻译>_ #include #include #include #include #include #include
ACM_cxlove
·
2012-11-25 16:00
SPOJ
4206 二分匹配HK算法
模板题前向星建边的HK算法#include #include #include #include #include usingnamespacestd; constintmaxn=50100; constintmaxm=151000; constintINF=0x3f3f3f3f; structEDGE { intb; intnext; }; intnx,ny,m;
luyuncheng
·
2012-11-23 02:00
SPOJ
GSS 5. Can you answer these queries V
题意 和GSS1一样,还是一个长度为n的序列和m个querry,只不过这次querry的格式是x1y1x2y2,求max{a[i]+a[i+1]+...+a[j]},x1=x2:把整个i和j的取值分为三类讨论: (1)、x1 #include #include #include usingnamespacestd; constintN=10010; constintINT_IN
zhjchengfeng5
·
2012-11-22 14:00
SPOJ
GSS 1. Can you answer these queries I
题意 给一个含有n(1 #include #include #include usingnamespacestd; constintN=50010; constintINT_INF=0x3fffffff; intval[N]; classseg_tree { private: structdata { intst,en,val,Max,Lmax,Rmax; }T[N>1; build(
zhjchengfeng5
·
2012-11-22 14:00
Spoj
375 Qtree 树链剖分 + 线段树 解法
前面介绍过Qtree的动态树解法,现在写一种更高效的,使用树链剖分,数据结构采用线段树:题目链接:http://www.
spoj
.pl/problems/QTREE/代码:#include #include
niuox
·
2012-11-04 15:00
封装“最小费用最大流”的一个类_poj2516
#include #include #include //最小费用最大流 namespacepifu { charbuf[4000000]; classK
sPOJ
Allocator { intm_pos
himulakensin
·
2012-11-01 16:00
SPOJ
42. Adding Reversed Numbers
https://www.
spoj
.pl/problems/ADDREV/用python写真的很短....很爽...#!
tclh123
·
2012-10-28 16:00
用python写acm /
SPOJ
- 1
拿acm写东西真的很练代码功底,第一次拿python写感觉不错——————————————————http://www.
spoj
.pl/problems/TEST/
SPOJ
的第一题1、在线做法#!
tclh123
·
2012-10-28 06:00
Spoj
375 Qtree Link - Cut Tree 解法
Qtree第一种解法,采用动态树。详情参考杨哲《Qtree解法的一些研究》。数据结构用SplayTree。要特别注意理解Link-CutTree,尤其是他的Access操作。#include #include #include #include usingnamespacestd; #defineMAXN10005 intfather[MAXN]; structANode { intv; in
niuox
·
2012-10-15 23:00
struct
tree
cmd
null
query
Access
【索引】 Advanced Data Structures :: Disjoint Set
AdvancedDataStructures::DisjointSetPOJ1611-TheSuspect
sPOJ
2524- UbiquitousReligion
sPOJ
2236-WirelessNetworkPOJ1703
Ra_WinDing
·
2012-10-09 21:00
【Author : DS❤MZ 】 To Do list
Problems:Unsolved:http://www.
spoj
.pl/problems/KPSUM/http://acm.bnu.edu.cn/bnuoj/problem_show.php?
dslovemz
·
2012-10-08 13:00
list
spoj
371
最小费用流水之#include #include #include #defineN1010 #defineinf100000000 usingnamespacestd; intn,cnt; inthead[N],pre[N],vis[N]; intdis[N]; intans; structEdge{ intu,v,c,next; intw; }edge[8010]; voidinit(){ m
waitfor_
·
2012-10-07 17:00
spoj
segment
差分约束 离散化端点之后把端点和相邻端点之间的线段当作新图的顶点提供一组样例,wa的估计都wa这了input5121130240350450output1#include #include #include #include #defineN410 usingnamespacestd; intnum[N*4]; inttim[N*4],dis[N*4]; boolvis[N*4]; inthead
waitfor_
·
2012-10-06 20:00
c
input
output
spoj
1470 Another Sequence Problem
题目链接:http://www.
spoj
.pl/problems/SEQ2/我因为y和n的顺序写错,导致TLE了一天。。再次悲剧。。
niuox
·
2012-10-03 22:00
struct
cmd
null
insert
Build
UP
spoj
861 SWAPS & uva 11990 "Dynamic'' Inversion(动态维护逆序对)
题意:有150000个数,10000条操作,每次将第i个数变为x,讯问每次操作后逆序对的数目。解法1:树状数组+treap,树状数组的每个元素都是一棵树,这样可以在lognlogn时间内查询前i项有多少个小于等于k的元素,当某个元素法师改变时,只需从树状数组中对应的treap中进行元素的删减,每次修改前后统计的第i个元素形成的逆序对数,便可知每次操作后逆序对的数目。由于Treap常熟很大,因此虽然
kksleric
·
2012-10-03 19:00
c
struct
query
Build
spoj
GSS1
SPOJ
GSS系列题YouaregivenasequenceA[1],A[2],...,A[N].
zuihoudebingwen
·
2012-09-25 20:00
Integer
query
Build
qt
output
Numbers
spoj
GSS系列
YouaregivenasequenceAofN(N #include #include #definemaxn50005 #defineinf1000000000 #definelcroot>1; build(lc,l,mid); build(rc,mid+1,r); data[root]=update(data[lc],data[rc]); } voidmodify(introot,intl,
zuihoudebingwen
·
2012-09-25 20:00
struct
tree
Integer
query
Build
output
数位dp
cat=25http://www.
spoj
.pl/problems/SORTBIT/这题是学习上面博客的,贴下,方便以后自己复习#include #include #include usingnamespacestd
struggle_mind
·
2012-09-20 15:00
SPOJ
839 Optimal Marks
839.OptimalMarksProblemcode:OPTMYouaregivenanundirectedgraphG(V,E).Eachvertexhasamarkwhichisanintegerfromtherange[0..231 –1].Differentvertexesmayhavethesamemark.Foranedge(u,v),wedefineCost(u,v)=mark[u
zhjchengfeng5
·
2012-09-18 14:00
SPOJ
4487. Can you answer these queries VI(GSS6 Splay tree)
article/details/7854526 by---cxlove题目:给出4种操作在某个位置,插入一个数将某个位置的数删掉将某个位置的数修改查询某个区间的最大子段和http://www.
spoj
.pl
ACM_cxlove
·
2012-09-17 20:00
SPOJ
2916 Can you answer these queries V(GSS5 线段树)
http://www.
spoj
.pl/problems/GSS5/ 更新部分类似,查询部分也一样。主要是把每一种查询分清楚。我是分为三种情况第一种:两
ACM_cxlove
·
2012-09-16 20:00
struct
query
UP
pair
SPOJ
2713. Can you answer these queries IV(GSS4 线段树)
acm_cxlove/article/details/7854526 by---cxlove 题目:给出N个数,两种操作,更新操作为把区间的每一个数,都开方,查询操作为区间求和http://www.
spoj
.pl
ACM_cxlove
·
2012-09-15 20:00
优化
query
UP
pair
SPOJ
1716 Can you answer these queries III(GSS3 线段树)
/blog.csdn.net/acm_cxlove/article/details/7854526 by---cxlove题目:求出最大子段和,有更新操作,将某个数修改http://www.
spoj
.pl
ACM_cxlove
·
2012-09-15 19:00
c
struct
query
UP
pair
SPOJ
1557 Can you answer these queries II(GSS2 线段树)
blog.csdn.net/acm_cxlove/article/details/7854526 by---cxlove 题目:求出区间的最大子段和,而且相同的数只能计算一次http://www.
spoj
.pl
ACM_cxlove
·
2012-09-15 19:00
c
struct
query
UP
pair
SPOJ
1043 Can you answer these queries I(GSS1 线段树)
转载请注明出处,谢谢http://blog.csdn.net/acm_cxlove/article/details/7854526 by---cxlove题目:查询区间最大子段和http://www.
spoj
.pl
ACM_cxlove
·
2012-09-15 16:00
struct
query
UP
pair
上一页
25
26
27
28
29
30
31
32
下一页
按字母分类:
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
其他