
acm暑假集训 热身_训练2
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
【51nod-1289】大鱼吃小鱼
题干:有N条鱼每条鱼的位置及大小均不同,他们沿着X轴游动,有的向左,有的向右。游动的速度是一样的,两条鱼相遇大鱼会吃掉小鱼。从左到右给出每条鱼的大小和游动的方向(0表示向左,1表示向右)。问足够长的时间之后,能剩下多少条鱼?Input第1行:1个数N,表示鱼的数量(1 <= N <= 100000)。 第2 - N + 1行:每行两个数Aii, Bii,中间用空格分隔,分别表示鱼的大小...原创 2018-07-12 23:23:50 · 493 阅读 · 0 评论 -
【CF#801 A.】 Vicious Keyboard(字符串查找,水题)
题干:Tonio has a keyboard with only two letters, "V" and "K".One day, he has typed out a string s with only these two letters. He really likes it when the string "VK" appears, so he wishes to change at ...原创 2018-07-12 23:33:48 · 407 阅读 · 0 评论 -
【uva-673】 Parentheses Balance(括号匹配问题)
题干:You are given a string consisting of parentheses () and []. A string of this type is said to be correct:(a)if it is the empty string(b)if A and B are correct, AB is correct,(c)if A is correct, (A) ...原创 2018-07-12 23:46:55 · 468 阅读 · 0 评论 -
cf#401(Div. 2)B. Game of Credit Card(田忌赛马类贪心)
题干:After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.Rules of this...原创 2018-07-12 12:19:01 · 380 阅读 · 0 评论 -
【CF#757A】Gotta Catch Em' All!
题干:Bash wants to become a Pokemon master one day. Although he liked a lot of Pokemon, he has always been fascinated by Bulbasaur the most. Soon, things started getting serious and his fascination turn...原创 2018-07-12 23:53:41 · 292 阅读 · 0 评论 -
51nod 1091 重叠的线段(贪心)
题干:X轴上有N条线段,每条线段包括1个起点和终点。线段的重叠是这样来算的,[10 20]和[12 25]的重叠部分为[12 20]。给出N条线段的起点和终点,从中选出2条线段,这两条线段的重叠部分是最长的。输出这个最长的距离。如果没有重叠,输出0。Input第1行:线段的数量N(2 <= N <= 50000)。第2 - N + 1行:每行2个数,线段的起点和终点。(0 ...原创 2018-07-11 10:24:40 · 259 阅读 · 0 评论