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
srm
Topcoder
SRM
687 (Div 2) 250.Quorum __ sort
ProblemStatement Inoneorganizationtheyhavendifferentcommittees.Theorganizationhasaverylargenumberofemployees.Eachemployeeisamemberofeachcommittee.Eachcommitteehasaquorum:thesmallestnumberofmembersthat
ProLightsfxjh
·
2016-04-15 01:00
sort
ACM
topcoder
SRM
687
Topcoder
SRM
413 (Div 2) 1000.InfiniteSequence
ProblemStatement NOTE:Thisproblemstatementcontainssubscriptsthatmaynotdisplayproperlyifviewedoutsideoftheapplet.Let'sconsideraninfinitesequenceAdefinedasfollows:A0 =1;Ai =A[i/p] +A[i/q] foralli>=1,whe
ProLightsfxjh
·
2016-04-14 19:00
search
ACM
413
memory
1000
problem
topcoder
SRM
Topcoder
SRM
413 (Div 2) 1000.InfiniteSequence
ProblemStatement NOTE:Thisproblemstatementcontainssubscriptsthatmaynotdisplayproperlyifviewedoutsideoftheapplet.Let'sconsideraninfinitesequenceAdefinedasfollows:A0 =1;Ai =A[i/p] +A[i/q] foralli>=1,whe
ProLightsfxjh
·
2016-04-14 19:00
search
ACM
413
memory
1000
problem
topcoder
SRM
TopCoder
SRM
687 div1 500
题意是已知一个无向图所有点对间的最小割,构造一个合法的原图。看了题解得知有个叫Gomory-Hutree的东西,即最小割树。解题要点是,你要知道一个图的所有点对最小割,一定能用一棵树做到。于是我们的目标变为构造这样一棵树。我们可以用分治法,不断把当前点集划分为两个点集,其中两个点集的点之间流量是当前最小,不断分治直到集合只剩一个点。#include usingnamespacestd; #def
squee_spoon
·
2016-04-13 21:00
最小割树
【TopCoder
SRM
302Div1 900】JoinedString
ProblemStatementYouaregivenavectorwords.Returntheshorteststringthatcontainsallthewordsassubstrings.Ifthereareseveralpossibleanswers,returntheonethatcomesfirstlexicographically.题意:给定n个大写英文构成的字符串,找到一个长度
CreationAugust
·
2016-03-16 17:00
状压dp
linux解压命令
tar cvf /data/d2/apps.tar apps cd /data01/applsrm/
SRM
tar xvf apps.tar jar cvf /data01/xxx.jar
youyanweixiao
·
2016-03-10 23:52
【TC-
SRM
461Div1】Fencing Garden【Meet In The Middle】【二分】
2013年国家队论文题。《搜索问题中的meetinthemiddle技巧》的最后一题。/*FootprintsInTheBloodSoakedSnow*/ #include #include #include usingnamespacestd; typedeflonglongLL; constintmaxn=45,maxm=2000005; constdoubleeps=1e-5; in
BraketBN
·
2016-03-06 21:00
搜索
in
二分
middle
the
meet
TopCoder
srm
683 div2 1000
已经弱到去div2混了……题意:给一棵无根树,计算它的所有子树的大小的和。这个问题转化为统计每个节点的“贡献”,即它在所有可能的子树中出现了多少次。还是先拿有根树来考虑,假设我们已经计算出了树t所有节点的“贡献”,如果在t中的某个叶子v上,连接一棵新的子树t’会怎么样呢?这样一来,v的贡献会将会被乘上“子树t’的树根的贡献+1”。于是,我们可以通过dfs,计算出以每个节点为根的子树中,该节点的“贡
squee_spoon
·
2016-03-06 14:00
DFS
SRM
682 Div2 1000 SubtreesCounting
题面:定义一个树的value为树的所有联通子图的节点数之和求给出的一个树的value感觉很巧妙的一个树dp因为是一个无根树,不妨把0号节点提起来作为根,记Tx为以x为根节点的子树定义Sx为在Tx中选择x的value(然后答案就是∑x:树上所有的节点Sx)定义Cx为在Tx中选择x的联通子图的个数考虑两个树,分别以st和x为根,而且分别计算出了他们各自的S和C的值那么,将x连到st上作为st的子节点时
a1s4z5
·
2016-03-03 18:00
Topcoder
SRM
683 Div2 B
贪心的题,从左向右推过去即可#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include usingnamespacestd; cla
huayunhualuo
·
2016-03-03 15:00
Topcoder
SRM
683 Div2 - C
树形Dp的题,根据题意建树。DP[i][0]表示以i为根节点的树的包含i的时候的所有状态点数的总和Dp[i][1]表示包含i结点的状态数目对于一个子节点vDp[i][0]=(Dp[v][1]+1)*Dp[i][0]+Dp[v][0]*Dp[i][1]表示子节点的所有状态与i的所有的状态之间的组合(可以不组合,所以DP[v][1]+1),接下来更新i的状态数目DP[i][1]=Dp[i][1]*(D
huayunhualuo
·
2016-03-03 15:00
TC
SRM
683 div2 EqualSubstrings2 纯暴力
纯暴力,一对一对的找,就可以了,而且,直接使用string的函数都没问题的,不过我不太会用,就转换成了数组窝刚开始的时候,还自做小聪明,先枚举长度i,从1到n-1,然后对于每个长度,枚举各个子串的首位置j(j+i #include #include #include #include #include #include #include #include #include usingnamespa
code12hour
·
2016-03-03 01:00
TC
SRM
683 div2 MoveStonesEasy 贪心
有n堆石子,每堆的石子数为a1,a2,...,an。现在想把它变成b1,b2,...,bn。如果不能,输出-1。如果能,输出最小移动次数。每次只能将一个石子从该堆移动到相邻堆上,且空堆不能跳过。如假设5为空堆,则从4移到6视为2次而不是1次。思想:我是贪心做的,先算两个序列的和,不相等就输出-1。然后对于ai和bi,把较小的变为0,较大的变为abs(ai-bi)。就是只需要把相差的那部分移走或者移
code12hour
·
2016-03-02 13:00
【TopCoder】
SRM
680 DIV 2
1.BearPair之bigDistance1.1题目概述在ans2: 44print"%d:wrong"%i 45 46 47if__name__=="__main__": 48srcFileName="F:\Qt_prj\hdoj\data.in" 49desFileName="F:\workspace\cpp_hdoj\data.in" 50GenData(srcFileNam
Bombe
·
2016-02-28 23:00
TC
SRM
682 DNASequence
水题,给你一个string,找出只由ACGT四个字符组成的最长连续子串的长度代码:#include #include #include #include #include #include usingnamespacestd; classDNASequence { public: intlongestDNASequence(stringstr) { boolisDNA[55]; memset(is
code12hour
·
2016-02-24 17:00
srm
534
250Description给你一个1*n的棋盘。两人轮流行动,每一个人能够把”o”向右移动到空格子。或者跨越连续两个”o”到空格子。一个”o”到最右端的时候消失。问谁获胜。Solution一个比較有趣的题,我们考虑每一个”o”到最右端的距离。两种行动事实上都是改变距离的奇偶,所以事实上仅仅须要考虑终于状态和距离和的奇偶性就可以。Code#include usingnamespacestd; co
yxwkaifa
·
2016-02-17 11:00
SRM
144-149
SRM
144:MatchOverview:http://www.topcoder.com/stat?
农夫三拳
·
2016-02-16 10:08
TopCoder
SRM
681 Div. 2 Problem 500 - ExplodingRobots (枚举)
题意两个机器人一开始在不同的坐标,有一个上下左右的指令序列,他们可以按顺序任意执行一些指令,问有没有可能到同一个地方。思路一般都会先想到记录一下两只机器人能走过的地方,如果有重复就能爆炸。然而指令长度为50,这样需要250,肯定不行。注意到X和Y相距很小,那么我们可以枚举一只机器人理论上能活动的每一个点,看看第二只能不能到这个点。判断的方法很简单,看看那只机器人到这个点需要几步方向即可。然后我们一
u014247806
·
2016-02-11 20:00
ICPC
TopCoder kawigiEdit插件配置
kawigiEdit插件可以提高TopCoder编译,提交效率,可以管理保存每次
SRM
的代码。
huayunhualuo
·
2016-01-28 13:00
SRM
678 div2 (1000题待补)
SRM
678div2(1000题待补)通过数:1Standingchange:1015-1003250:一些droid和doors,问每个doors中距离最近的droids中,距离差最大的距离值多少。
beihai2013
·
2016-01-14 08:00
Topcoder
SRM
677 div2
SRM
677div2通过数:2250:问[L,R]区间内有多少个素数且它是回文数的数。由于数据范围比较小,直接暴力就可以。
beihai2013
·
2016-01-13 08:00
CF/
SRM
的口胡记录
感觉整体BZOJ做做丝毫没有前途,几个大爷都在淦
SRM
,我就来开个坑来口胡一波CF/
SRM
以便快速滚粗。(因为是口胡就不设计数器了,其实是我懒。【
SRM
645】Easy按区间排排序直接扫一遍就可以了。
YJMWOI
·
2016-01-11 11:00
TopCoder
SRM
677 Div. 2 550 - FourStrings (枚举)
题意给四个字符串,问能包括他们四个,并且长度最短的字符串的长度是多少。思路长度越短,说明上一个字符串末尾和当前字符串开头的相同越多。考虑到数据非常小,我们可以枚举所有排列,然后逐个处理。当前字符串有两种选择它是之前字符串的子串,那么就可以直接跳过。他能和之前字符串的末尾消去一部分。这时候通过截取子串来判断。然后合并剩下的字符串,继续下一个。最后取所有排列的最小值。代码classFourString
u014247806
·
2015-12-29 18:00
ICPC
[置顶] 休养生息阶段刷题记录
(目前持续颓废中TopCoderSRM679div2 250500 1000 div1 250600 900(Rating1510->1589)
SRM
678div2250500 1000div1250500900
quailty
·
2015-12-23 15:00
TopCoder
SRM
676 Div. 2 Problem 550 - BoardEscapeDiv2
题意Alice和Bob玩游戏,一个棋子,只能走K步,轮到谁谁不能动就输,问最后谁赢。思路暴力搜索必胜点。对于某个位置,我们暴力搜索四周有没有先手必败的点,如果有的话这个点就是必胜点。因为k很小,随便搞搞就行了。代码classBoardEscapeDiv2{ public: introw,col; piist; vectormp; intdfs(intx,inty,intk,intvis[50][
u014247806
·
2015-12-20 17:00
ICPC
Topcoder
SRM
676 div2
通过数:1250:裸的多重背包,次数是min{budget/cost[i]的下界,tim[i]},即最多能降多少时间,代价是cost[i]现场忘了照着版调了一阵。#include #include #include #include #include #include #include #include #include #include #include #include #include #i
beihai2013
·
2015-12-19 11:00
转帖-Linux学习(Find命令使用实例)
find/-namehttpd.conf find/-nameaccess_log2>/dev/null find/etc-name'*
srm
*' find/-amin-10#查找在系统中最后
erichd
·
2015-12-11 16:00
TopCoder
SRM
674 div1 250
一棵树,给一个数组num[1...n],如果i是根,i拥有num[i]个“孩子”,否则i拥有num[i]-1个“孩子”。问在所有树的可能形态中,可能的最远的两个点的距离。首先应该想到,num[i]实际上表示的是点i有多少条边,就能直接判断出树是否合法了。然后答案就是n-数组中1的个数+1。因为度大于1的那些点,可以连成一串,在这一串的头尾补上度为1的点就行了,这肯定是合法的最长距离。
squee_spoon
·
2015-12-01 14:00
APACHE配置文件中文详解
##再读取此文档后,服务器将继续搜索运行#E:/ProgramFiles/ApacheGroup/Apache/conf/
srm
.conf #E:/ProgramFiles/ApacheGroup/
a8816919
·
2015-11-23 17:12
服务器
中文
配置文件
虚拟主机
IP地址
APACHE配置文件中文详解
##再读取此文档后,服务器将继续搜索运行#E:/ProgramFiles/ApacheGroup/Apache/conf/
srm
.conf #E:/ProgramFiles/ApacheGroup/
a8816919
·
2015-11-23 17:12
中文
服务器
配置文件
虚拟主机
IP地址
【
SRM
】649 t2
题意一个数列\(A\),数的范围均在\([0,2^N-1]\)内,求一个\(B\),使得新生成的数列\(C\)中逆序对最多(\(C_i=A_ixorB\)),输出最多的逆序对。(\(|A| usingnamespacestd; typedeflonglongll; #definepbpush_back constintN=150005; structnode{ node*c[2]; ints; v
iwtwiioi
·
2015-11-22 18:00
【
SRM
】518 Nim
题意\(K(1\leK\le10^9)\)堆石子,每堆石子个数不超过\(L(2\le50000)\),问Nim游戏中先手必败局面的数量,答案对\(10^9+7\)取模。分析容易得到\(f(i,k)=\sum_{j=0}^{n-1}f(i-1,j)f(i-1,k^j),f(1,i(2\lei\leL))=1\),其中\(n=min(2^i,2^i>L)\)。发现其实这就是操作为\(xor\)的卷积。
iwtwiioi
·
2015-11-22 18:00
SRM
587 Div II L3:ThreeColorabilityEasyy
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12699 这道题目是第一次在比赛的时候做出来的,开始还想用brute force,后来发现那太复杂了,于是在纸上画了画,发现一个规律,那就是只有在一个2x2的cell中,如果出现3个N或3个Z方式的cell,那么这种情况下肯定是无法配色成功,因为最后一定会
·
2015-11-13 20:58
color
tc经典题
Single Round Match
SRM
490 DIV1 550pt ( 非常考英语阅读和代码实现能力的一题 ) 推荐代码: wata,官方题解
SRM
490
·
2015-11-13 17:32
c
Test
SRM
Level Three: LargestCircle, Brute Force
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3005&rd=5858 思路: 如果直接用Brute Force搜索所有可能的圆的话,那么搜索空间将很大,所以我用了一个priority_queue结构,将搜索的顺序变为按圆的半径从大到小搜索,所以当搜索到符合条件的圆时,即可停止搜索。这样可以大
·
2015-11-13 16:19
level
Test
SRM
Level One: TemperatureScales
c=problem_statement&pm=6038 因为TopCoder
SRM
比赛使用的编译器进行了升级,所以进行了一次Test
SRM
,这次比赛不计rating.
·
2015-11-13 16:12
level
Test
SRM
Level Two: CountExpressions, Brute Force
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=8157 这道题目跟扑克牌算24的题目比较像,但要简单一些。点击查看 next_permutation 函数 的用法,使用这个函数减轻了不少工作量,而且算法很简洁明了。 代码如下: #include <io
·
2015-11-13 16:11
express
TC
SRM
591 (Div2. Practice only)
250pt TheArithmeticProgression There are three numbers (a, b, c), they represent (x, y, z), respectively. According to the equation y – x = z – y. We can get three equations: x = 2 * y – z; y =
·
2015-11-13 15:08
div
SRM
219 Div II Level One: WaiterTipping,小心约分
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12609&rd=15503 这题目看上去so easy, 但写的时候要特别小心,如果直接按照公式算,没有加下面这一句的话: if (total + total * taxPercent / 100 + (tip + 1) * t
·
2015-11-13 14:34
level
TC
SRM
521 (div. 2) 1000'
比赛时候没搞出来,在赛后好像只能提交不能评测不知道为什么,故我也不知道自己搞得对不对。不过这道题让我会用了map(看了同一房间里面的一个大牛的代码后,而且这个大牛是个中学生好像……)。 #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #
·
2015-11-13 14:58
div
TopCoder
SRM
625 Incrementing Sequence 题解
本题就是给出一个数k和一个数组,包含N个元素,通过每次添加�数组中的一个数的操作,最后须要得到1 - N的一个序列,不用排序。 能够从暴力法入手,然后优化。 这里利用hash表进行优化,终于得到时间效率是O(n*n)的算法,并且常数项应该非常低,速度还挺快的。 思路: 1 假设数组A[i]在1 -N 范围内,就利用bool B[]记录,这个数已经找到了; 2 假设A[i]的值之前已经找到
·
2015-11-13 13:42
sequence
TopCoder:
SRM
579 DIV2 1000
Problem Statement NOTE: This problem statement contains images that may not display properly if viewed outside of the applet. Everybody loves geometry, so here is a geo
·
2015-11-13 12:58
topcoder
TopCoder:
SRM
Problem Statement Given a base word, original, and a compound word, compound, decide if the compound word is valid. A compound word is valid if and only if it i
·
2015-11-13 12:55
topcoder
TopCoder:
SRM
153 DIV2 1000
Problem Statement A large company is trying to put together a team of people to work on some task. In order for any team to work well, the people involved must be able to g
·
2015-11-13 12:54
topcoder
TopCoder:
SRM
150 DIV2 1000
Problem Statement You are given a rectangular map in which each space is marked with one of three characters: '.' (open), 'B' (a brick), or '#' (an indestructible block).
·
2015-11-13 12:53
topcoder
TopCoder
SRM
154 DIV2 1000
Problem Statement Some competitions have judges who score one specific area of a performance. Unfortunately, bad judges do exist and can individually cause one group's rati
·
2015-11-13 12:53
topcoder
TopCoder:
SRM
146 DIV2 1000
Problem Statement This task is about the scoring in the first phase of the die-game Yahtzee, where five dice are used. The score is determined by the values on the upward
·
2015-11-13 12:52
topcoder
TopCoder:
SRM
472 DIV2 1000
Problem Statement Taro is standing on a rectangular island. The island is divided into width x height cells. The coordinate system is introduced so th
·
2015-11-13 12:51
topcoder
TopCoder:
SRM
578 DIV2 500
Problem Statement Crow Keith is looking at the goose cage in the zoo. The bottom of the cage is divided into a grid of square cells. There are some birds sitting on those c
·
2015-11-13 12:50
topcoder
TopCoder:
SRM
288 DIV2 1000
Problem Statement You are given a 4x4 game board consisting of buttons which are either lit or unlit. The buttons are numbered 1-16, like so: 1 2 3 4 5 6 7 8
·
2015-11-13 12:49
topcoder
上一页
6
7
8
9
10
11
12
13
下一页
按字母分类:
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
其他