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
Codechef
【
codechef
】Alok-nath and His Sanskars(数字能不能被等分,记忆化深搜)
Input: 2 53 12456 53 12457http://www.
codechef
.com/problems/SANSKAR#include intflag,n; longlonga[21],z
cacyth
·
2015-06-19 13:00
【
codechef
】Steady tables(dp)
Input: 3 11 22 23 Output: 2 25 273 ExplanationTestcase1:Thereareonly2suchgridspossible0and1.http://www.
codechef
.com
cacyth
·
2015-06-16 23:00
【
codechef
】Chef and His Friend (甲乙相遇的概率,分类)
Input: 2 2211 1111 Output: 0.750000 1.000000http://www.
codechef
.com/JUNE15/problems/FRNDMTNG考虑问题要全。。
cacyth
·
2015-06-16 23:00
【
codechef
】Chef and Polygons(灵活题,坑题)
ExplanationInthepicturethefirstpolygonismarkedin green,second-in red andthirdin blue color.http://www.
codechef
.com
cacyth
·
2015-06-16 17:00
【
codechef
】 Historical Junctions(开放想方法,分类)
Input: 2 44 12 23 34 41 46 12 23 34 41 13 24 Output: 44 15 26 37 48 00http://www.
codechef
.com/SNCK151A
cacyth
·
2015-05-28 13:00
【
codechef
】Devu and binary String(字符串不超过连续k个相同,最少改几个,分类)
Input: 3 21 11 22 11 41 1001 Output: 1 10 0 11 2 1010 http://www.
codechef
.com/MAY15/problems/DEVSTR
cacyth
·
2015-05-28 12:00
【
codechef
】 Special Economic Zone(二分图匹配,难想到)
1 ExplanationCielwillselectcity 1 and 3 asSEZ.So x=2 (city 1 and 3), y=1 (city 2), x-y=1.http://www.
codechef
.com
cacyth
·
2015-05-22 14:00
【
codechef
】Strategy for the World Cup(组合打表)
Input: 6 1029 629 619 419 519 1039 Output: 2 4 1 1 0 12http://www.
codechef
.com/COOK55/problems/WORLDCUP
cacyth
·
2015-05-19 19:00
May Challenge 2015(
CodeChef
2015年5月月赛)
ChefandnewrecipeRupsarecentlystartedtointernunderChef.Hegaveher N typeofingredientsofvaryingquantity A1,A2,...,AN respectivelytostoreit.Butassheislazytoarrangethemsheputsthemal
caduca
·
2015-05-19 14:00
Algorithm
编程
算法
ACM
CodeChef
【
codechef
】Special Shortest Walk(STL妙用,优先队列)
1≤SumofNoveralltestcases≤100000 1≤SumofMoveralltestcases≤500000 3≤N≤100000 2≤M≤500000 1≤T≤2000 1≤Z≤100000000 1≤X,Y≤N X!=Y source!=sinkandtherearenomultiedges. sourceandsinkwillnotbeconnectedbyadirecte
cacyth
·
2015-05-18 14:00
【
codechef
】Zombinatorial(找规律)
Youaregivenafunctionfwhichisdefinedas:Yourtaskistofindthevalueof where M isgivenininput.InputFormatFirstlinecontains T,thenumberoftestcases.Firstlineofeachtestcasecontain3spaceseparatedintegers N, M a
cacyth
·
2015-05-17 15:00
【
codechef
】Chef and Strange Formula(找规律,灵活题)
Input: 57 12345 Output: 6 Explanation F(1)=1*(1!+1)=2 F(2)=1*(1!+2)+2*(2!+2)=3+8=11 F(3)=1*(1!+3)+2*(2!+3)+3*(3!+3)=4+10+27=41 F(4)=1*(1!+4)+2*(2!+4)+3*(3!+4)+4*(4!+4)=5+12+30+112=159 F(5)=1*(1!+5)+
cacyth
·
2015-05-15 20:00
codechef
-Chef and Prime Divisors
codechef
-ChefandPrimeDivisorsYouaregiventwopositiveintegers–AandB.YouhavetocheckwhetherAisdivisiblebyalltheprimedivisorsofB.InputThefirstlineoftheinputcontainsanintegerTdenotingthenumberoftestcases.Th
loy_184548
·
2015-05-14 21:00
数学
CodeChef
【
codechef
】Chef and Prime Divisors(判断A能否被B的所有素因子整除)
#include #include #include #include #include #include #include #include #include #include #definelllonglong #definemod1000000007 usingnamespacestd; llgcd(lla,llb){ returnb?gcd(b,a%b):a;} intmain(){ in
cacyth
·
2015-05-13 23:00
【
codechef
】Set Difference (灵活题,超时)
ChuruisworkingasadatascientistinCoderpur.Heworksonalotofdataonthedailybasis.Oneday,hefoundaninterestingproblem,whichwasveryeasytosolveforsmalldatabutwasgettingmorecomplexwithincreasingnumberofdatapoin
cacyth
·
2015-05-13 20:00
codechef
-Set Difference
SetDifferenceTimeLimit:1secSourceLimit:50000Bytes ChuruisworkingasadatascientistinCoderpur.Heworksonalotofdataonthedailybasis.Oneday,hefoundaninterestingproblem,whichwasveryeasytosolveforsmalldatabutw
loy_184548
·
2015-05-12 21:00
找规律
【
codechef
】Magical Transformation(dp,技巧题)
IrfanandhisbrotherYusufwerelookingatphotographsoftheirvacationtoHawaii.Irfannoticedsomethinginteresting.HenoticedthatiftheirauntMansihadabigbeardandamoustacheshewouldresembletheiruncleAmit.Hetriedtomo
cacyth
·
2015-05-09 15:00
【
codechef
】Clash of Clans
ThewarhasbeendeclaredintheClashofClansandtheclan'sleaderhasdesignedasmartstrategytoconfirmhisside'svictoryinthiswar.Hisstrategyisasfollows-Whenanymemberofhisclanmemberwillattackatanymemberoftheenemy's
cacyth
·
2015-05-02 22:00
【
codechef
】Superlucky Numbers(组合取模,枚举)
EshaanandNischaydecidedtoplayagame.NischayaskedEshaantochoose2distinctdigits A and B.Eshaancallsapositiveinteger“lucky”,ifitcontainsonlythedigits A and B.Nischaycallsthisnumber“superlucky”ifsumofitsdi
cacyth
·
2015-05-02 22:00
【
codechef
】Strings Classes(枚举灵活题)
WhiledevelopingAppsforArtificialIntelligence,Arushhastousespecifictypeofstrings(words)calledClassCstrings.Allthestringshavebeenclassifiedinto3classes:ClassA :Asequenceoflettersthatreadthesameforwardan
cacyth
·
2015-05-02 22:00
【
codechef
】Nikhil and Commands(字符串删减,分类)
Nikhillearnttwonewcommands pwd and cd onthefirstdayofOperatingSystemslab.pwd -commanddisplaysthecurrentworkingdirectoryand,cd -changesthelocationofworkingdirectory.Ifthecdparametercontains ".."(withou
cacyth
·
2015-05-02 22:00
【
codechef
】Arush Challenge(灵活题)
ArushwasnotalwayspooratMathematicsbuthisrecentperformanceshadnotbeenthatgoodandhehadlosthisconfidence.NowhiselderbrotherwasdeterminedtobringbackhisconfidencebackinMathematics.Sohemadeatrickyquestionan
cacyth
·
2015-05-02 22:00
【
codechef
】Lazy Players
ConcernedwiththefitnesslevelsoftheplayersintheNationalTeam,thecoachdecidestocarryoutarunningdrillinthenexttrainingsession.So,hesetsupcheckpointsinthetraininggroundatdifferentpositions.Afterevaluatinge
cacyth
·
2015-04-30 22:00
【
codechef
】 Zeroes(大数灵活题)
Viratlovesmathematicalquestions.Theotherdayhecameacrossaninterestingquestionwhichrequiredhimtofindoutthenumberoftrailingzeroesforthefunction. F(n)=11*22......NN,where N isaninteger.Viratsolvedtheprobl
cacyth
·
2015-04-30 17:00
【
codechef
】一维王国问题(最少需要几颗炸弹)
N onedimensionalkingdomsarerepresentedasintervalsoftheform [ai ,bi] ontherealline.Akingdomoftheform [L,R] canbedestroyedcompletelybyplacingabombatapoint x onthereallineif L≤x≤R.Yourtaskistodeterminemi
cacyth
·
2015-04-24 13:00
【
codechef
】Jovians from Jupiter(父亲和孩子不能同时上船)
Jovians,thecitizensofJupiter,haveaverylonglife,andalltheJoviansareapartofonefamily.Sincetheyhaveaverylonglife,inordertocontrolpopulation,alltheJoviansareallowedtohaveatmost2childrenandnotmore.Joviansr
ccyy-
·
2015-04-21 19:38
灵活题
【
codechef
】Jovians from Jupiter(父亲和孩子不能同时上船)
Jovians,thecitizensofJupiter,haveaverylonglife,andalltheJoviansareapartofonefamily.Sincetheyhaveaverylonglife,inordertocontrolpopulation,alltheJoviansareallowedtohaveatmost2childrenandnotmore.Joviansr
cacyth
·
2015-04-21 19:00
【
codechef
】Gcd Queries(灵活题,分类)
#include #include #include #include #include #include #include #include #include #definelllonglong usingnamespacestd; intx[100001];//把memset删掉就不超时了。。。 inty[100001]; intgcd(inta,intb){ returnb?gcd(b,a%
cacyth
·
2015-04-21 18:00
【
codechef
】Sereja and Votes(模拟)
Serejaconductedavotingabout N ofhisopinions. Ai percentofpeoplevotedforopinionnumber i.Thisstatisticsiscalledvalidifsumofall Ai isequalto 100.Nowletusdefineroundingupofastatistics A.If Ai isnotaninteg
cacyth
·
2015-04-21 11:00
【
codechef
】Kisses(dp,技巧题)
Mohitandhisgirlfriendareplayingagamenamed'Ascendingsort'.Thenormsofthegameareasfollows:Initialy N integersaretakenrandomlyandarekeptonthetable.TheonewhomakestheseNnumbersasacsendingnumberswinsthegame.
cacyth
·
2015-04-19 18:00
【
codechef
】Chef and A Large Permutation(技巧题)
TodayisChef'sbirthday.Hismomgiftedhimatrulylovablegift,apermutationoffirst N positiveintegers.SheplacedthepermutationonaverylongtableinfrontofChefandleftitforhimtoplaywithit.Butastherewasalotofpeoplec
cacyth
·
2015-04-16 11:00
【
codechef
】Towers(比较难想到方法的模拟题)
ThereareNtowersinacity.AllNtowersareplacedinasinglerow.Scoreoftoweriisthethenumberoftowersvisibletoitsrightside.TowerjwillbevisibletoToweriifitsatisfiesthefollowingcondition,Ifheightoftowerjislessthan
cacyth
·
2015-04-15 12:00
【
codechef
】Yet Another Problem On Strings (找最优解)
Youaregivenastring X consistingoflowercasealphabets.Youarerequiredtogeneratethe largest stringY from X byfollowingthegiveninstructionsbelow:frequency(Y[i])in X >=frequency(Y[j])in X,where 1ASCII(Y[j])
cacyth
·
2015-04-14 11:00
【
codechef
】 Chef and Piano Scales (简单题)
Recently,Chefgotobsessedwithpiano.Heisajustarookieinthisstuffandcannotmovehisfingersfromonekeytootherfastenough.Hediscoveredthatthebestwaytotrainfingerspeedistoplayscales.Therearedifferentkindsofscale
cacyth
·
2015-04-14 09:00
【
codechef
】Devu and his Class(巧妙的 模拟,分类讨论)
Devulikestoplaywithalockof N dials.Eachdialrotatesfromnumbers0to9clockwise(i.e.0to1,2to3and8to9).Youcannotrotatefrom9to0.Initiallyallthedialsofthelockaresetto0.Fromthecurrentlock,Devucanmoveanydialtoa
cacyth
·
2015-04-11 17:00
【
codechef
】 Count Substrings (大数技巧题)(二分+计数,易超时)
Youaregivenastring S oflength N consistingonlyof 0sand 1s.Youarealsogivenaninteger K.Youhavetoanswer Q queries.Inthe ith query,twointegers Li and Ri aregiven.Thenyoushouldprintthenumberofsubstringsof
cacyth
·
2015-04-09 18:00
CodeChef
SIGNWAVE (打表找规律)
题意:给你两个函数aisin(2^i*x),0≤x≤2π,fori=0,1,…,S−1,bjcos(2^j*x),0≤x≤2π,forj=0,1,…,C−1,现在题目给出S,C,K问你,存在多少个点使得,至少有K个函数穿过。解析:为什么写这题呢,是因为想让自己记住,当实在想不出怎么做的时候可以,暴力打表找规律。这题的做法是写了一个暴力程序,让后根据这个程序打出的表找到规律。至于暴力程序,还是有技巧
HelloWorld10086
·
2015-03-15 19:00
CodeChef
signwave
CodeChef
STRSUB(dp+二分)
题意:(中文题意)https://
codechef
_shared.s3.amazonaws.com/download/translated/MARCH15/mandarin/STRSUB.pdf解析:先预处理一个数组
HelloWorld10086
·
2015-03-09 19:00
CodeChef
STRSUB
CodeChef
- CDSW153 Virat and his challenge(容斥原理)
题意:给一个区间[L,R]求这个区间内能被小于n的素数,整除的数的个数。解析:容斥原理,虽然不能马上求出[L,R]区间内的答案,但是可以利用容斥原理转化为求[0,L-1]区间内的个数和[0,R]区间内的个数。最终答案就是[0,R]-[0,L-1]AC代码#include #include #include #include #include usingnamespacestd; typedeflo
HelloWorld10086
·
2015-02-27 22:00
CodeChef
WPROB(数组辅助+暴力求解)
这边有中文的题目:https://
codechef
_shared.s3.amazonaws.com/download/translated/LTIME21/mandarin/WPROB.pdf解析:因为每次移动木块
HelloWorld10086
·
2015-02-22 22:00
CodeChef
CDMU02(数组辅助查询)
题目大意:给你一个字符串p,然后给你q次的查询,每次查询一个单词以及对应区间[L,R]内的相应的字母,出现的次数。解析:可以用一个数组dp[27][N]表示在当前位置该位置上的字符出现了几次。查询时就dp[ch-‘a’][R]-dp[ch-‘a’][L-1]进行询问。总结:我最早的时候想成了用线段树来做,不过马上被我给否决了。因为这里只有查询没有修改。#include #include #incl
HelloWorld10086
·
2015-02-22 22:00
CodeChef
JNTUV1(找规律)
题目大意:给你这样一个序列3,4,33,34,43,44,333,334,343,344,433,434,443,444,3333,3334,3343,3344……..,找到其中的规律,输入n,输出对应的数字。解析:可以把这个序列等价于一个二进制0,1,00,01,10,11,模拟这个序列的生成就ok了。#include #include #include #include #include us
HelloWorld10086
·
2015-02-22 21:00
CodeChef
STFM - Chef and Strange Formula (康托展开)
思路康托展开X=a[n]∗(n−1)!+a[n−1]∗(n−2)!+...+a[i]∗(i−1)!+...+a[1]∗0!那么对照一下题目里的公式。F(x)=1∗1!+2∗2!+3∗3!+...+x∗x!+(1+2+3..+x)∗x后面的和大家都会算。前面一时找不到规律,后来请教了hcbbt巨巨。他一眼就看出是康托展开!前面就是序列x+1,x,x−1,...,2,1的康托展开。显然x+1个元素的排
u014247806
·
2015-02-16 21:00
ACM
codechef
Alok-nath and His Sanskars
把大小为n的集合S分成k个子集,使得每个子集的子集和相等,即Si=average(S)对于n=6,k=3,1,2,3,3,4,5,第一个子集可能会选择(1,2,3),导致其他子集无法拼凑成功,这就意味着可能需要回溯而实际上回溯搜索肯定会爆所以应该从大到小的进行选择。因为大的可以被拆成小的,如果5无法跟其他数拼凑成平均数,那2,3也肯定不可以最后注意一个所有值都为0且k>n的情况#include#i
u011327476
·
2014-12-16 15:13
数学
搜索
CodeChef
November Challenge 2014
重点回忆下我觉得比较有意义的题目吧。水题就只贴代码了。DistinctCharactersSubsequence水。代码:1#include 2#include 3#include 4#include 5#include 6#include 7#include 8#include 9#definepbpush_back 10#definempmake_pair 11#defin
·
2014-12-06 01:00
code
BZOJ 3514
Codechef
MARCH14 GERALD07加强版 LCT+主席树
题目大意:N个点M条边的无向图,询问保留图中编号在[l,r]的边的时候图中的联通块个数。思路:看到了wulala的题解,这里就直接粘过来了。葱娘说这是一个很巧妙的题。。有一个比较猎奇的做法:首先把边依次加到图中,若当前这条边与图中的边形成了环,那么把这个环中最早加进来的边弹出去并将每条边把哪条边弹了出去记录下来:ntr[i]=j,特别地,要是没有弹出边,ntr[i]=0;这个显然是可以用LCT来弄
jiangyuze831
·
2014-12-03 11:00
主席树
bzoj
CodeChef
可持久化线段树
Link-Cut-Tree
程序猿最应去的网站有哪些?
下面是一些Quora用户推荐的国外网站,与广大程序猿或者希望学习编程的朋友们分享:1)编程练习和竞赛类http://www.
codechef
.com/http://www.spoj.com/p/http
wangliqiang1014
·
2014-10-14 10:00
程序猿最应去的网站
BZOJ 3514
Codechef
MARCH14 GERALD07加强版 Link-Cut-Tree+划分树
题目大意:给定n个点m条边的无向图,求问当图中只有【编号在[l,r]区间内】的边存在时图中的联通块个数强制在线注意联通块是指联通了就是同一块,不是Tarjan求的那种块看到这题的那一刻我就想小便有木有0.0这尼玛怎么做?可持久化并查集?暴力?分块乱搞?。。。后来看了HZWER大神的博客才知道这种巧妙的算法0.0太强大了直接复制wulala的题解讲得很清楚不累述了wulala葱娘说这是一个很巧妙的题
PoPoQQQ
·
2014-09-29 07:00
划分树
bzoj
LCT
Link-Cut-Tree
BZOJ3514
程序员常去的网站
下面是一些Quora用户推荐的国外网站,与广大程序猿或者希望学习编程的朋友们分享:1)编程练习和竞赛类http://www.
codechef
.com/http://www.spoj.com/p/http
rookieding
·
2014-09-27 22:00
程序员最应该去的网站
下面是一些Quora用户推荐的国外网站,与广大程序猿或者希望学习编程的朋友们分享:1)编程练习和竞赛类http://www.
codechef
.com/http://www.spoj.com/p/http
dong413876225
·
2014-09-24 20:00
上一页
1
2
3
4
5
6
7
下一页
按字母分类:
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
其他