随笔分类 -  好题

经典题
摘要:Kochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread ... 阅读全文
posted @ 2014-04-09 17:59 chen2013 阅读(286) 评论(0) 推荐(0)
摘要:On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV. The rule is very simple. On the ground there are 100 labe... 阅读全文
posted @ 2014-03-23 19:29 chen2013 阅读(194) 评论(0) 推荐(0)
摘要:DescriptionGiven a series of n numbers a1, a2, ..., an, the partial sum of the numbers is defined as the sum of ai, ai+1, ..., aj.You are supposed to calculate how many partial sums of a given series of numbers could be divided evenly by a given number m.InputThere are multiple test, each contains 2 阅读全文
posted @ 2014-03-12 16:30 chen2013 阅读(242) 评论(0) 推荐(0)
摘要:Description There are n single boys and m single girls. Each of them may love none, one or several of other people unrequitedly and one-sidedly. For the coming q days, each night some of them will come together to hold a single party. In the party, if someone loves all the others, but is not loved b 阅读全文
posted @ 2014-03-11 13:33 chen2013 阅读(363) 评论(0) 推荐(0)
摘要:DescriptionGiven N stations, you want to carry goods from station 1 to station N. Among these stations, we use M tubes to connect some of them. Each t... 阅读全文
posted @ 2014-03-10 22:55 chen2013 阅读(247) 评论(0) 推荐(0)
摘要:DescriptionSeveral startup companies have decided to build a better Internet, called the "FiberNet". They have already installed many nodes that act as routers all around the world. Unfortunately, they started to quarrel about the connecting lines, and ended up with every company laying it 阅读全文
posted @ 2014-03-03 22:36 chen2013 阅读(179) 评论(0) 推荐(0)
摘要:DescriptionRunning a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick up the customers calling to get a cab as soon as possible,there is also a need to schedule all the taxi rides which have been booked in advance.Given a 阅读全文
posted @ 2014-03-03 21:56 chen2013 阅读(264) 评论(0) 推荐(0)
摘要:DescriptionAn arithmetic series consists of a sequence of terms such that each term minus its immediate predecessor gives the same result. For example, the sequence 3, 7, 11, 15 is the terms of the arithmetic series 3+7+11+15; each term minus its predecessor equals 4. (Of course there is no requirem 阅读全文
posted @ 2014-02-27 10:28 chen2013 阅读(309) 评论(0) 推荐(0)
摘要:Descriptiona program that, given a natural number N between 0 and 4999 (inclusively), and M distinct decimal digits X1,X2..XM (at least one), finds the smallest strictly positive multiple of N that has no other digits besides X1,X2..XM (if such a multiple exists). InputThe input has several data set 阅读全文
posted @ 2014-02-24 12:38 chen2013 阅读(266) 评论(0) 推荐(0)
摘要:DescriptionIt is always very nice to have little brothers or sisters. You can tease them, lock them in the bathroom or put red hot chili in their sandwiches. But there is also a time when all meanness comes back! As you know, in one month it is Christmas and this year you are honored to make the big 阅读全文
posted @ 2014-02-23 20:17 chen2013 阅读(311) 评论(0) 推荐(0)
摘要:DescriptionLet f(n) be the number of factors of integer n.Your task is to count the number of i(1 #define MAXN 1000001int f[MAXN]={0};int s[MAXN]={0};int c[MAXN]={0};int main(){ //先求出每个数的因子数 for(int i=1; i<MAXN; i++){ for(int j=1; i*j<MAXN; j++){ f[i*j]++; } } /... 阅读全文
posted @ 2014-02-23 10:52 chen2013 阅读(336) 评论(0) 推荐(0)
摘要:描述In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjac... 阅读全文
posted @ 2014-02-06 13:47 chen2013 阅读(375) 评论(0) 推荐(0)