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
sicily
[
sicily
online]1194. Message Flood
/* 大小写不区分,没看到,提交了好几次 我的map,感觉set应该更好 Constraints TimeLimit:1secs,MemoryLimit:32MB Description Well,howdoyoufeelaboutmobilephone?Youranswerwouldprobablybesomethinglikethat“It’ssoconvenientandbenefit
qiuchenl
·
2012-12-10 22:00
[
sicily
online]1033. City Road
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionLonglongago,cityOldwasallaroundthewaterandwasdividedintoM*Nsmallsquarehouses.ThecityOldhadonlytwobridges,inthesouthwestcornerandnortheastcorner.It
qiuchenl
·
2012-12-10 20:00
sicily
1001 Alphacode
这题一开始没想到dp(动态规划),所以弄了好久好久。后来看别人的blog,知道是dp,就根据推导公式写,结果还是写错,后来发现原来是 自己少处理当前某个位置的数为0的情况。 思路:每次新加入一个数字处理时 (1)不为0 直接拼接的话,那么个数值时可能没变的,如21,原本是3,再加1,可能个数还是1,因为31大于26. 此时再考虑另一种情况,那就是跟前一位结合,如果结合后小于27,那么就是cnt=f
Dijason
·
2012-12-10 20:00
1001
sicily
[
sicily
online]1050. Numbers & Letters
ConstraintsTimeLimit:3secs,MemoryLimit:32MBDescriptionIntheearly80’s,apopularTVshowonDutchtelevisionwas‘CijfersenLetters’(NumbersandLetters).Thisgameconsistedoftwogameelements,inwhichthemaingoalwastoo
qiuchenl
·
2012-12-10 11:00
sicily
2502 买珍珠
Description珍珠市场上有N(N ≤100)种等级的珍珠,每种珍珠的需求数量是Bi,单位价格是Pi。不幸的是,这个市场是黑市——购买一种珍珠,需要额外多付10个同种珍珠的钱(如果不购买当然不用)。针对这种情况,我们可以用高等级的珍珠来代替低等级的珍珠。举个例子,需要5个等级1的珠子(单位价格10元)、100个等级2的珠子(单位价格20元)。按照正常情况下购买需要花费(5+10)*10+(1
Ciel
·
2012-12-09 15:00
dp
ACM
sicily
soj
[
sicily
online]1045. Space Management
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionThenewgeneralmanagerGillBateshasbeentoaseminarontimemanagement.Eversinceshehasbeenbotheringallofherstafftomanagetheirowntime.Nowsheplanstotakeiton
qiuchenl
·
2012-12-09 14:00
[
sicily
online]1070. Hansel and Grethel
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionOnawarmsummerafternoon,HanselandGrethelarewalkingtogetherinthefields.Itisgettinglateand,tobehonest,theyarelost.Grethelisalittlescared,stillvividly
qiuchenl
·
2012-12-08 15:00
[
sicily
online]1077. Cash Machine
ConstraintsTimeLimit:10secs,MemoryLimit:32MBDescriptionABankplanstoinstallamachineforcashwithdrawal.Themachineisabletodeliverappropriatebillsforarequestedcashamount.ThemachineusesexactlyNdistinctbilld
qiuchenl
·
2012-12-08 13:00
[
sicily
online]1063. Who's the Boss
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionSeveralsurveysindicatethatthetalleryouare,thehigheryoucanclimbthecorporateladder.AtTALLEnterprisesInc.this"defactostandard"hasbeenproperlyformaliz
qiuchenl
·
2012-12-07 19:00
[
sicily
online]1010. Zipper
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionGiventhreestrings,youaretodeterminewhetherthethirdstringcanbeformedbycombiningthecharactersinthefirsttwostrings.Thefirsttwostringscanbemixedarbitr
qiuchenl
·
2012-12-07 10:00
[
sicily
online]1048. Inverso
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionThegameof‘Inverso’isplayedona3x3gridofcoloredfields(eachfieldiseitherblackorwhite).Eachfieldisnumberedasfollows: 1 2 3 4 5 6 7 8 9 Theplayercancli
qiuchenl
·
2012-12-06 21:00
[
sicily
online]1017. Rate of Return
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionJillhasbeeninvestinginamutualfundforawhile.Sinceherincomehasvaried,theamountofmoneyshehasaddedtotheinvestmenthasvaried,andshehasn’talwaysaddedtoth
qiuchenl
·
2012-12-06 15:00
[
sicily
online]1099. Packing Passengers
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionPTA,Pack‘emTightAirlinesisattemptingtheseeminglyimpossible—toflywithonlyfullplanesandstillmakeaprofit.Theirstrategyissimplicityandefficiency.Their
qiuchenl
·
2012-12-06 10:00
[
sicily
online]1047. Super Snooker
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionOnoneofmymanyinterplanetarytravelsIlandedonabeautifullittleplanetcalledCrucible.Itwasinhabitedbyanextremelypeace-lovingpeoplewhocalledthemselvesSn
qiuchenl
·
2012-12-05 21:00
[
sicily
online]1012. Stacking Cylinders
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionCylinders(e.g.oildrums)(ofradius1foot)arestackedinarectangularbin.Eachcylinderonanupperrowrestsontwocylindersintherowbelow.Thecylindersinthebottom
qiuchenl
·
2012-12-05 16:00
[
sicily
online]1009. Mersenne Composite N
/* 移位操作的限制 Constraints TimeLimit:1secs,MemoryLimit:32MB Description Oneoftheworld-widecooperativecomputingtasksisthe"GrandInternetMersennePrimeSearch"--GIMPS--strivingtofindever-largerprimenumbersb
qiuchenl
·
2012-12-05 11:00
[
sicily
online]1003. Hit or Miss
/*按照过程模拟 Constraints TimeLimit:1secs,MemoryLimit:32MB Description Oneverysimpletypeofsolitairegameknownas"HitorMiss"(alsoknownas"Frustration,""Harvest,""Roll-Call,""Talkative",and"Treize")isplayeda
qiuchenl
·
2012-12-05 10:00
[
sicily
online]1083. Networking
/*输入进行处理的最小生成树(我用的是prim算法) Constraints TimeLimit:1secs,MemoryLimit:32MB Description Youareassignedtodesignnetworkconnectionsbetweencertainpointsinawidearea.Youaregivenasetofpointsinthearea,andaseto
qiuchenl
·
2012-12-04 20:00
[
sicily
online]1091. Maximum Sum
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionGivenasetofnintegers:A={a1,a2,...,an},wedefineafunctiond(A)asbelow: t1 t2 d(A)=max{∑ai +∑aj |1 #include #include #in
qiuchenl
·
2012-12-04 17:00
[
sicily
online]1011. Lenny's Lucky Lotto
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionLennylikestoplaythegameoflotto.Inthelottogame,hepicksalistof N uniquenumbersintherangefrom 1 to M.Ifhislistmatchesthelistofnumbersthataredrawn,hew
qiuchenl
·
2012-12-04 10:00
[
sicily
online]1046. Plane Spotting
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionCraigisfondofplanes.Makingphotographsofplanesformsamajorpartofhisdailylife.Sincehetriestostimulatehissociallife,andsinceit’squiteadrivefromhishome
qiuchenl
·
2012-12-03 20:00
[
sicily
online]1052. Candy Sharing Game
/* 直接模拟 Constraints TimeLimit:1secs,MemoryLimit:32MB Description Anumberofstudentssitinacirclefacingtheirteacherinthecenter.Eachstudentinitiallyhasanevennumberofpiecesofcandy.Whentheteacherblowsawh
qiuchenl
·
2012-12-03 15:00
[
sicily
online]1024. Magic Island
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionThereareNcitiesandN-1roadsinMagic-Island.Youcangofromonecitytoanyother.Oneroadonlyconnectstwocities.Oneday,Thekingofmagic-islandwanttovisittheisla
qiuchenl
·
2012-12-03 10:00
[
sicily
online]1051. Biker's Trip Odomete
/*不懂这个题目要考啥 Constraints TimeLimit:1secs,MemoryLimit:32MB Description MostbicyclespeedometersworkbyusingaHallEffectsensorfastenedtothefrontforkofthebicycle.Amagnetisattachedtooneofthespokesonthefron
qiuchenl
·
2012-12-02 20:00
[
sicily
online1087. A Funny Game
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionAliceandBobdecidetoplayafunnygame.Atthebeginningofthegametheypickn(13,weusec1,c2,...,cn todenotethecoinsclockwiseandifAliceremovec2,thenc1 andc3 a
qiuchenl
·
2012-12-02 19:00
[
sicily
online]1090. Highways
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionTheislandnationofFlatopiaisperfectlyflat.Unfortunately,Flatopiahasnopublichighways.SothetrafficisdifficultinFlatopia.TheFlatopiangovernmentisaware
qiuchenl
·
2012-12-01 20:00
[
sicily
online]1034. Forest
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionInthefieldofcomputerscience,forestisimportantanddeeplyresearched,itisamodelformanydatastructures.Nowit’syourjobheretocalculatethedepthandwidthofgi
qiuchenl
·
2012-11-30 16:00
[
sicily
online]1022. Poor contestant Prob
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionAseverybodyknown,“BGmeeting”isveryverypopularintheACMtrainingteamofZSU. Aftereachonlinecontest,theywillgooutfor“smoking”.Whowillbethepooronesthath
qiuchenl
·
2012-11-29 20:00
sicily
1317. Sudoku
题目链接
sicily
1317这题咋一看以为不简单,因为第一感觉是时间复杂度很大,可想想写起来应该不难,于是飞快的写了个dfs。 结果是证明了我的感觉,超时了。
Dijason
·
2012-11-29 20:00
[
sicily
online]1006. Team Rankings
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionIt'spreseasonandthelocalnewspaperwantstopublishapreseasonrankingoftheteamsinthelocalamateurbasketballleague.TheteamsaretheAnts,theBuckets,theCats,
qiuchenl
·
2012-11-28 16:00
[
sicily
online]1093. Air Express
/*Constraints TimeLimit:1secs,MemoryLimit:32MB Description FlyItToday!(FIT),anairexpresscompany,chargesdifferentamountsforpackagesdependingontheirweight.Forexample,onesetofratesmaybe: Packageweight
qiuchenl
·
2012-11-27 21:00
[
sicily
online]1035. DNA matching
/*用map,注意重复 Constraints TimeLimit:1secs,MemoryLimit:32MB Description DNA(Deoxyribonucleicacid)isfoundedineverylivingcreatureasthestoragemediumforgeneticinformation.Itiscomprisedofsubunitscallednucl
qiuchenl
·
2012-11-27 19:00
[
sicily
online]1031. Campus
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionAtpresent,ZhongshanUniversityhas4campuseswithatotalareaof6.17squarekilometerssittingrespectivelyonbothsidesofthePearlRiverorfacingtheSouthChinaSea
qiuchenl
·
2012-11-27 10:00
[
sicily
online]1028. Hanoi Tower Sequence
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionHanoiTowerisafamousgameinventedbytheFrenchmathematicianEdourardLucasin1883.Wearegivenatowerofndisks,initiallystackedindecreasingsizeononeofthreepe
qiuchenl
·
2012-11-26 20:00
[
sicily
online]1020. Big Integer
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionLonglongago,therewasasupercomputerthatcoulddealwithVeryLongIntegers(noVeryLongIntegerwillbenegative).DoyouknowhowthiscomputerstorestheVeryLongInte
qiuchenl
·
2012-11-26 16:00
[
sicily
online]1036. Crypto Columns
/* Constraints TimeLimit:1secs,MemoryLimit:32MB Description Thecolumnarencryptionschemescramblesthelettersinamessage(orplaintext)usingakeywordasillustratedinthefollowingexample:SupposeBATBOYisth
qiuchenl
·
2012-11-25 20:00
[
sicily
online]1029. Rabbit
/* 1,大整数加法,用string模拟 2,用一个数组模拟兔子成长过程 Constraints TimeLimit:1secs,MemoryLimit:32MB Description Therabbitshavepowerfulreproductionability.Onepairofadultrabbitscangivebirthtoonepairofkidrabbitseverymo
qiuchenl
·
2012-11-24 21:00
[
sicily
online]1027. MJ, Nowhere to Hide
/*用两个map来实现 Constraints TimeLimit:1secs,MemoryLimit:32MB Description OnBBS,thereisafamiliartermcalledMJ(shortforMaJia),whichmeansanotherBBSIDofonepersonbesideshis/hermainID. Thesedays,alotofACMersp
qiuchenl
·
2012-11-24 15:00
[
sicily
online]1014. Specialized Four-Dig
/* Constraints TimeLimit:1secs,MemoryLimit:32MB Description Findandlistallfour-digitnumbersindecimalnotationthathavethepropertythatthesumofitsfourdigitsequalsthesumofitsdigitswhenrepresentedinhexad
qiuchenl
·
2012-11-23 21:00
[
sicily
online]1007. To and Fro
/* Constraints TimeLimit:1secs,MemoryLimit:32MB Description MoandLarryhavedevisedawayofencryptingmessages.Theyfirstdecidesecretlyonthenumberofcolumnsandwritethemessage(lettersonly)downthecolumns,pa
qiuchenl
·
2012-11-23 16:00
[
sicily
online]1002. Anti-prime Sequences
ConstraintsTimeLimit:3secs,MemoryLimit:32MBDescriptionGivenasequenceofconsecutiveintegersn,n+1,n+2,...,m,ananti-primesequenceisarearrangementoftheseintegerssothateachadjacentpairofintegerssumstoacompo
qiuchenl
·
2012-11-21 15:00
[
sicily
online]1001. Alphacode
ConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionAliceandBobneedtosendsecretmessagestoeachotherandarediscussingwaystoencodetheirmessages:Alice:"Let'sjustuseaverysimplecode:We'llassign`A'thecodewo
qiuchenl
·
2012-11-20 11:00
sicily
1800 Sequence【线段树-RMQ】
题目链接:http://soj.me/1800题目大意:给出一个序列a1,a2,a3,……an,求它的一个子序列使的这个子序列的和最小,并且这个子序列的长度只能在L和U之间。对于这类子序列求和问题问法真是太多了,如果子序列长度没有上下界的话可以用动态规划来做,不过有上下界的时候,貌似没有想到动态规划的算法。本题的思路大致如下:首先求的整个序列的前缀和数组preSum[],那么S[i,j]就可以表示
lifajun90
·
2012-11-17 19:00
sicily
1136 山海经【线段树】
题目链接:http://soj.me/1136题目的问题是频繁的区间查询,对于频繁的区间查询问题,很明显不能暴力地每次遍历了,一般需要经过预处理然后通过二分或者线段树的方式来查找(其实都是二分的思想)。线段树的典型用法是频繁的更新一段区间,查询一段区间,每次都是O(lgN)的复杂度,那么总体复杂度就是O(NlgN)。本题的应用场景虽然没有频繁的更新区间,不过也适合线段树的使用场景(一般的二分查找搞
lifajun90
·
2012-11-16 13:00
sicily
1022 Poor contestant Prob
我要吐槽下,被自己坑了两个多小时,也说明自己测试不仔细!仅仅在输出xxxissopoor少了一点,一点呀!一个点就等于我的两个小时T_T,都没天理了。言归正传,说说解题思路。1经过本人的不懈努力,经验之谈,不要用c++的cout做输出,很容易超时!用c的printf2这题数据量应该很大,用传统的排序方法是过不了滴,在这里要用堆,大根堆和小根堆小解:小根堆简单的说就是一个数组里面总是最小的那个排在首
Dijason
·
2012-11-08 18:00
sicily
1003 Hit or Miss
这道题做起来比较像在做阅读理解......表示英语不好的伤不起。 读了M次,没怎么懂题意,最后在参考其他人的代码才明白过来。 这里有一个讲解题意讲的比较清楚的,我就不累赘了。 http://blog.csdn.net/chenhq1991/article/details/7795757#include #include #include usingnamespacestd; intmain()
Dijason
·
2012-11-05 19:00
sicily
1006 Team Rankings
在这题卡了很久,主要是没读懂题意,今天再去看题,突然就明白了。 关键是medianranking的定义,其实这个定义跟逆序数一个意思。 接着是对于给出的voters的处理,这些是用来做一个源字符串的(词穷,不知道怎么叫更准确),用来确定给出的ranking有多少个逆序数。 因为一共有5!=120个ranking,所以需要一个个的算了。这里有一个偷懒的函数,c++的algorithm库中的全排列函数
Dijason
·
2012-11-05 00:00
team
1006
sicily
Ranking
sicily
1029 Rabbit
我就比较水,直接模拟整个过程,因为m值不大。 每个模拟过程: k[m]=k[m-1];//一个月过去了,孩子们长大一岁了! ... k[1]=k[0]; parent=parent+k[m];//孩子都长大了,能生孩子了。这加法需要用高精度 k[0]=parent;//新生的孩子们 长大的过程一直循环就可以搞定了。 #include #include #include #include usin
Dijason
·
2012-11-04 22:00
算法
sicily
rabbit
1029
sicily
1153 马的周游问题
比1152的数据量大了,所以需要有一定的策略。 在这里使用的是dfs+启发函数。这里的启发函数指当前位置下一步能到达未被访问的位置个数。 策略就是先对下一步能到达未被访问位置的个数最少的进行dfs,这个可以理解成是选择代价最小的先搜索。 因为下一步能到达的未被访问的位置个数越少,那么后继产生的结点越少,展开的树子结点就相对较少,因此对于搜索速度是有一定提高的。 http://soj.me/1153
Dijason
·
2012-11-03 11:00
sicily
1762
题目:http://soj.me/1762这题其实只要想清楚就不难的了。就是按什么规则来选择哪两行或者哪两列直接是否该间隔。我的规则就是记录每两行或者两列有交谈的对数。当然按题意,会把这个记录在行号或者列号较小的地方。//===================#include#includeusingnamespacestd;structpos{ pos(){ num=0; } int
Dijason
·
2012-11-02 19:00
上一页
9
10
11
12
13
14
15
16
下一页
按字母分类:
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
其他