03 2018 档案
摘要:Number SequenceTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 34658 Accep...
阅读全文
摘要:Power stringTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 54809 Accepted: 22806DescriptionGiven two strings a and b we def...
阅读全文
摘要:DescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names...
阅读全文
摘要:void GetFail(char *P,int *Next){ int len = strlen(P); Next[0]= 0,Next[1]=0; for(int i=1;i<len;i++) { int j=Next[i]; while(j && P[...
阅读全文
摘要:Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are ...
阅读全文
摘要:Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income...
阅读全文
摘要:Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某...
阅读全文
摘要:The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room
阅读全文
摘要:Background Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another s...
阅读全文
摘要:The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of
阅读全文
摘要:There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. F...
阅读全文
摘要:There are n men ,every man has an ID(1..n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are friends. These n men stand
阅读全文
摘要:给你一个长度为N的序列ai,1≤i≤N和q组询问,每组询问读入l1,r1,l2,r2,需输出get(l,r,x)表示计算区间[l,r]中,数字x出现了多少次。Input第一行,一个数字N,表示序列长度。第二行,N个数字,表示a1~aN第三行,一个数字Q,表示询问个数。...
阅读全文
摘要:Bob has a favorite number k and ai of length n. Now he asks you to answer m queries. Each query is given by a pair li and ri and asks ...
阅读全文
摘要:某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置设定初始弹力系数ki,当绵羊达到第i个装置时,它会往后弹ki步,达到第i+ki个装置,若不存...
阅读全文
摘要:我很弱,但是我要坚强!绝不让那些为我付出过的人失望图的存储结构之邻接表(详解)之前我们介绍过图的邻接矩阵存储法,它的空间和时间复杂度都是N2,现在我来介绍另外一种存储图的方法:邻接表,这样空间和时间复杂度就都是M。对于稀疏图来说,M要远远小于N2。先上数据,如下。12...
阅读全文
摘要:A New Year party is not a New Year party without lemonade! As usual, you are expecting a lot of guests, and buying lemonade has alread...
阅读全文
摘要:You are preparing for an exam on scheduling theory. The exam will last for exactly Tmilliseconds and will consist of n problems. You can either solve
阅读全文
摘要:There are n pearls in a row. Let's enumerate them with integers from 1 to n from the left to the right. The pearl number i has the typ...
阅读全文
摘要:You have a rooted tree consisting of n vertices. Each vertex of the tree has some color. We will assume that the tree vertices are numbered by integer
阅读全文
摘要:度度熊喜欢着喵哈哈村的大明星——星星小姐。 为什么度度熊会喜欢星星小姐呢? 首先星星小姐笑起来非常动人,其次星星小姐唱歌也非常好听。 但这都不是最重要的,最重要的是,星星小姐拍的一手好代码! 于是度度熊关注了星星小姐的贴吧。 一开始度度熊决定每天都在星星小姐的贴吧里面签到。 但是度度熊是一个非常健忘
阅读全文
摘要:我们将A省简化为由N个城市组成,某些城市之间存在双向道路,而且A省的交通有一个特点就是任意两个城市之间都能通过道路相互到达,且在不重复经过城市的情况下任意两个城市之间的到达方案都是唯一的。聪明的你一定已经发现,这些城市构成了树这样一个结构。 现在百度陆续开了许许多多的...
阅读全文
摘要:I hope you know the beautiful Union-Find structure. In this problem, you’re to implement somethingsimilar, but not identical.The data ...
阅读全文
摘要:度度熊是一个喜欢计算机的孩子,在计算机的世界中,所有事物实际上都只由0和1组成。 现在给你一个n*m的图像,你需要分辨他究竟是0,还是1,或者两者均不是。 图像0的定义:存在1字符且1字符只能是由一个连通块组成,存在且仅存在一个由0字符组成的连通块完全被1所包围。 图...
阅读全文
摘要:車是中国象棋中的一种棋子,它能攻击同一行或同一列中没有其他棋子阻隔的棋子。一天,小度在棋盘上摆起了许多車……他想知道,在一共N×M个点的矩形棋盘中摆最多个数的車使其互不攻击的方案数。他经过思考,得出了答案。但他仍不满足,想增加一个条件:对于任何一个車A,如果有其他一个...
阅读全文
摘要:The season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he ...
阅读全文
摘要:We have a 3×3 grid. A number ci,j is written in the square (i,j), where (i,j) denotes the square at the i-th row from the top and the ...
阅读全文
摘要:Find the maximum possible sum of the digits (in base 10) of a positive integer not greater than N.Constraints1≤N≤1016N is an integer.I...
阅读全文
摘要:An adult game master and N children are playing a game on an ice rink. The game consists of K rounds. In the i-th round, the game mast...
阅读全文