• 「CF454A」 Little Pony and Crystal Mine

    「CF454A」 Little Pony and Crystal Mine

    TwilightSparkleoncegotacrystalfromtheCrystalMine.Acrystalofsize n (n isodd; n > 1)isan n × n matrixwithadiamondinscribedintoit.Youaregivenanoddinteger n.Youneedtodrawacrystalofsize n.Thediamondcellsofthematrixshouldberepresentedbycharacter"D".Allothercellsofthematrixshouldberepresentedbycharacter"*".Lookattheexamplestounderstandwhatyouneedtodraw.InputTheonlylinecontain...

    02014年8月2日3,734模拟
  • 「BZOJ1684」[Usaco2005 Oct] Close Encounter

    「BZOJ1684」[Usaco2005 Oct] Close Encounter

    DescriptionLackingevenafifthgradeeducation,thecowsarehavingtroublewithafractionproblemfromtheirtextbook.Pleasehelpthem.Theproblemissimple:Givenaproperlyreducedfraction(i.e.,thegreatestcommondivisorofthenumeratoranddenominatoris1,sothefractioncannotbefurtherreduced)findthesmallestproperlyreducedfractionwithnumeratoranddenominatorintherange1..32,767thatisclosest(butnotequal)tothegivenfraction.找...

    02014年7月29日2,425模拟
  • 「BZOJ1349」[Baltic2006] Squint

    「BZOJ1349」[Baltic2006] Squint

    DescriptionWriteaprogramtocalculateintegersquareroots.InputTheinputisreadfromatextfilenamedsquint.in.Itsonlylineconsistsofaninteger0<=n<2^63.OutputItsonlylineconsistsofthesmallestnonnegativeintegerqsuchthatq^2>=n.SampleInput122333444455555SampleOutput11060446HINTsqrt(122333444455555)=11060445.038765619.题解直接sqrt(n)真是神题啊[crayon-66467c44a1f48939759407/] ...

    02014年7月28日2,719模拟
  • 「BZOJ1622」[Usaco2008 Open] Word Power 名字的能量

    「BZOJ1622」[Usaco2008 Open] Word Power 名字的能量

    Description    约翰想要计算他那N(1≤N≤1000)只奶牛的名字的能量.每只奶牛的名字由不超过1000个字待构成,没有一个名字是空字体串,  约翰有一张“能量字符串表”,上面有M(1≤M≤100)个代表能量的字符串.每个字符串由不超过30个字体构成,同样不存在空字符串.一个奶牛的名字蕴含多少个能量字符串,这个名字就有多少能量.所谓“蕴含”,是指某个能量字符串的所有字符都在名字串中按顺序出现(不一定一个紧接着一个...

    02014年7月28日2,923模拟
  • 「BZOJ1647」[Usaco2007 Open] Fliptile 翻格子游戏

    「BZOJ1647」[Usaco2007 Open] Fliptile 翻格子游戏

    DescriptionFarmerJohnknowsthatanintellectuallysatisfiedcowisahappycowwhowillgivemoremilk.HehasarrangedabrainyactivityforcowsinwhichtheymanipulateanMxNgrid(1<=M<=15;1<=N<=15)ofsquaretiles,eachofwhichiscoloredblackononesideandwhiteontheotherside.Asonewouldguess,whenasinglewhitetileisflipped,itchangestoblack;whenasingleblacktileisflipped,itchangestowhite.Thecowsarerewardedwhenth...

    22014年7月28日6,335模拟
  • 「CF452A」Eevee

    「CF452A」Eevee

    YouaresolvingthecrosswordproblemKfromIPSC2014.Yousolvedallthecluesexceptforone:whodoesEeveeevolveinto?Youarenotveryintopokemons,butquickgooglinghelpedyoufindout,thatEeveecanevolveintoeightdifferentpokemons:Vaporeon,Jolteon,Flareon,Espeon,Umbreon,Leafeon,Glaceon,andSylveon.Youknowthelengthofthewordinthecrossword,andyoualreadyknowsomeletters.Designersofthecrosswordmadesurethatthe...

    02014年7月28日3,536模拟
  • 「CF451C」Predict Outcome of the Game

    「CF451C」Predict Outcome of the Game

    Thereare n gamesinafootballtournament.Threeteamsareparticipatinginit.Currently k gameshadalreadybeenplayed.Youareanavidfootballfan,butrecentlyyoumissedthewhole k games.Fortunately,yourememberaguessofyourfriendforthese kgames.Yourfrienddidnottellexactnumberofwinsofeachteam,insteadhethoughtthatabsolutedifferencebetweennumberofwinsoffirstandsecondteamwillbe d1 andthatofbetweensecondand...

    02014年7月25日2,951模拟
  • 「CF451B」 Sort the Array

    「CF451B」 Sort the Array

    Beingaprogrammer,youlikearraysalot.Foryourbirthday,yourfriendshavegivenyouanarray a consistingof n distinct integers.Unfortunately,thesizeof a istoosmall.Youwantabiggerarray!Yourfriendsagreetogiveyouabiggerarray,butonlyifyouareabletoanswerthefollowingquestioncorrectly:isitpossibletosortthearray a (inincreasingorder)byreversing exactlyone segmentof a?Seedefinitionsofsegmentandreve...

    02014年7月25日2,440模拟
  • 「BZOJ3702」「FJ互测」二叉树

    「BZOJ3702」「FJ互测」二叉树

    Description(tree.c/.cpp/.pas)现在有一棵二叉树,所有非叶子节点都有两个孩子。在每个叶子节点上有一个权值(有n个叶子节点,满足这些权值为1..n的一个排列)。可以任意交换每个非叶子节点的左右孩子。要求进行一系列交换,使得最终所有叶子节点的权值按照中序遍历写出来,逆序对个数最少。InputFormat(tree.in)第一行n下面每行,一个数x如果x==0,表示这个节点非叶子节点,递归地向下读入其左孩子和右孩子的信息,如果x!=0,表示...

    12014年7月24日4,463模拟,线段树
  • 「BZOJ1637」[Usaco2007 Mar] Balanced Lineup

    「BZOJ1637」[Usaco2007 Mar] Balanced Lineup

    DescriptionFarmerJohn决定给他的奶牛们照一张合影,他让N(1≤N≤50,000)头奶牛站成一条直线,每头牛都有它的坐标(范围:0..1,000,000,000)和种族(0或1)。一直以来FarmerJohn总是喜欢做一些非凡的事,当然这次照相也不例外。他只给一部分牛照相,并且这一组牛的阵容必须是“平衡的”。平衡的阵容,指的是在一组牛中,种族0和种族1的牛的数量相等。请算出最广阔的区间,使这个区间内的牛阵容平衡。区间的大小为区间内最右边的...

    12014年7月23日2,657模拟
  • 「fj夏令营」解释器

    「fj夏令营」解释器

    「题目描述」小呆同学热爱计算机科学。他最近对Python这种语言非常感兴趣,不仅希望学会怎么写Python的脚本,更希望搞清楚Python的解释器是怎么实现的,他找到了你,希望你可以编写一个简单的Python解释器。你被要求实现Python解释器中两种简单的功能:语句类型格式解释赋值语句A=B把B的值赋给A,这里的B是一个合法的Python表达式。forexample:>>>a=1//a=1>>>b=a+100//b=101输出语句print(A1[,A2,....

    32014年7月20日3,892模拟,二分法
  • 「BZOJ3689」「FJ2014集训」异或之

    「BZOJ3689」「FJ2014集训」异或之

    「题目描述」给定n个非负整数A[1],A[2],……,A[n]。对于每对(i,j)满足1<=i<j<=n,得到一个新的数A[i]xorA[j],这样共有n*(n-1)/2个新的数。求这些数(不包含A[i])中前k小的数。注:xor对应于pascal中的“xor”,C++中的“^”。「输入格式」第一行2个正整数n,k,如题所述。以下n行,每行一个非负整数表示A[i]。「输出格式」共一行k个数,表示前k小的数。「样例输入」451134「样例输出」02255「样例解释」1xor1=0(...

    02014年7月13日4,691模拟
8 / 18 « 上一页 1 ...6 7 8 9 10 ...18 下一页 »