
水题
console.log( )
吾日三省吾身:这事能不能不干、这事能不能推给别人干、这事能不能明天干。
展开
-
LightOJ 1006 :Hex-a-bonacci
DescriptionGiven a code (not optimized), and necessary inputs, you have to find the output of the code for the inputs. The code is as follows:int a, b, c, d, e, f;int fn( int n ) { if( n原创 2016-08-25 17:43:19 · 503 阅读 · 0 评论 -
Co-prime Array
DescriptionYou are given an array of n elements, you must make it a co-prime array in as few moves as possible.In each move you can insert any positive integral number you want not greater than原创 2016-08-22 19:57:58 · 299 阅读 · 0 评论 -
Alice, Bob, Two Teams
DescriptionAlice and Bob are playing a game. The game involves splitting up game pieces into two teams. There are n pieces, and the i-th piece has a strength pi.The way to split up game pieces原创 2016-08-22 18:40:43 · 486 阅读 · 0 评论 -
<poj1985>Cow Marathon
DescriptionAfter hearing about the epidemic of obesity in the USA, Farmer John wants his cows to get more exercise, so he has committed to create a bovine marathon for his cows to run. The maratho原创 2016-08-02 21:32:18 · 314 阅读 · 0 评论 -
<poj2631>Roads in the North
DescriptionBuilding and maintaining roads among communities in the far North is an expensive business. With this in mind, the roads are build such that there is only one route from a village to a原创 2016-08-02 21:34:14 · 297 阅读 · 0 评论 -
二分
DescriptionVasiliy likes to rest after a hard work, so you may often meet him in some bar nearby. As all programmers do, he loves the famous drink "Beecola", which can be bought in n different s原创 2016-08-18 17:22:20 · 394 阅读 · 0 评论 -
Farthest Nodes in a Tree
DescriptionGiven a tree (a connected graph with no cycles), you have to find the farthest nodes in the tree. The edges of the tree are weighted and undirected. That means you have to find two node原创 2016-08-02 21:53:14 · 347 阅读 · 0 评论 -
How Many Tables<hdoj1213>
Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the fri原创 2016-08-02 08:39:14 · 313 阅读 · 0 评论 -
HDD is Outdated Technology
DescriptionHDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitr原创 2016-07-21 21:46:15 · 456 阅读 · 0 评论 -
Bear and Three Balls
DescriptionLimak is a little polar bear. He has n balls, the i-th ball has size ti.Limak wants to give one ball to each of his three friends. Giving gifts isn't easy — there are two rules Limak原创 2016-08-22 20:07:09 · 405 阅读 · 0 评论 -
Bear and Reverse Radewoosh
DescriptionLimak and Radewoosh are going to compete against each other in the upcoming algorithmic contest. They are equally skilled but they won't solve problems in the same order.There will be原创 2016-08-22 20:08:38 · 316 阅读 · 0 评论 -
Ohana Cleans Up
DescriptionOhana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of原创 2016-08-22 20:12:14 · 329 阅读 · 0 评论 -
LightOJ 1331:求面积
DescriptionAgent J is preparing to steal an antique diamond piece from a museum. As it is fully guarded and they are guarding it using high technologies, it's not easy to steal the piece. There ar原创 2016-08-25 17:40:52 · 412 阅读 · 0 评论 -
LightOJ 1136 规律
DescriptionThere is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Now you are given two integers A and B, you have to find the number of integers fromAth number to Bth (inclusive) number, w原创 2016-08-25 17:38:05 · 595 阅读 · 0 评论 -
LightOJ 1305Area of a Parallelogram
DescriptionA parallelogram is a quadrilateral with two pairs of parallel sides. See the picture below:Fig: a parallelogramNow you are given the co ordinates of A, B and C, you have to find t原创 2016-08-25 17:34:13 · 419 阅读 · 0 评论 -
CodeForces 597A
DescriptionFind the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x thata ≤ x ≤ b and x is divisible by k.Input原创 2016-08-23 21:32:22 · 431 阅读 · 0 评论 -
Lightoj1008
DescriptionSee the picture below.You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to find the value ofAD.InputInp原创 2016-08-23 21:28:52 · 439 阅读 · 0 评论 -
Lightoj 1008 - Fibsieve`s Fantabulous Birthday
DescriptionFibsieve had a fantabulous (yes, it's an actual word) birthday party this year. He had so many gifts that he was actually thinking of not having a party next year.Among these gifts th原创 2016-08-23 21:23:08 · 576 阅读 · 0 评论 -
Wolf and Rabbit<hdoj1222>
Wolf and RabbitTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7338 Accepted Submission(s): 3672Problem DescriptionThere is a原创 2016-07-20 17:51:54 · 407 阅读 · 0 评论 -
Dima and Guards
DescriptionNothing has changed since the last round. Dima and Inna still love each other and want to be together. They've made a deal with Seryozha and now they need to make a deal with the dorm g原创 2016-08-22 20:24:06 · 329 阅读 · 0 评论 -
Restaurant
DescriptionA restaurant received n orders for the rental. Each rental order reserve the restaurant for a continuous period of time, the i-th order is characterized by two time values — the start原创 2016-07-21 21:45:18 · 451 阅读 · 0 评论 -
Bulbs
DescriptionVasya wants to turn on Christmas lights consisting of m bulbs. Initially, all bulbs are turned off. There are n buttons, each of them is connected to some set of bulbs. Vasya can pres原创 2016-07-21 21:44:25 · 559 阅读 · 0 评论 -
New Year and Days
DescriptionToday is Wednesday, the third day of the week. What's more interesting is that tomorrow is the last day of the year 2015.Limak is a little polar bear. He enjoyed this year a lot. Now,原创 2016-07-21 21:43:38 · 304 阅读 · 0 评论 -
人见人爱A^B<>hdoj2035
Problem Description求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方” Input输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1 Output对于每个测试实例,请输出A^B的最后三位表示的整数,每个输出占一行。 Sample Input2原创 2016-07-23 12:13:27 · 310 阅读 · 0 评论 -
Positive Negative Sign<大水题>
DescriptionGiven two integers: n and m and n is divisible by 2m, you have to write down the first n natural numbers in the following form. At first take first mintegers and make their sign negat原创 2016-07-23 21:20:13 · 447 阅读 · 0 评论 -
Ekka Dokka
DescriptionEkka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd num原创 2016-07-23 20:36:01 · 657 阅读 · 0 评论 -
又见GCD<>
又见GCDTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15673 Accepted Submission(s): 6610Problem Description有三个正整数a,b,c(0原创 2016-07-20 18:05:47 · 711 阅读 · 0 评论 -
最小公倍数
最小公倍数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 47736 Accepted Submission(s): 26775Problem Description给定两个正整数,计算这两个数的最小公原创 2016-07-20 18:07:59 · 410 阅读 · 0 评论 -
Petya and Countryside<水题>
DescriptionLittle Petya often travels to his grandmother in the countryside. The grandmother has a large garden, which can be represented as a rectangle1 × n in size, when viewed from above. Thi原创 2016-05-17 21:48:24 · 384 阅读 · 0 评论 -
Toy Army<水题>
DescriptionThe hero of our story, Valera, and his best friend Arcady are still in school, and therefore they spend all the free time playing turn-based strategy "GAGA: Go And Go Again". The gamepl原创 2016-05-17 18:07:00 · 405 阅读 · 0 评论 -
Flea travel<水题>
DescriptionCan you imagine our life if we removed all zeros from it? For sure we will have many problems.In this problem we will have a simple example if we removed all zeros from our life, it's原创 2016-05-17 17:49:51 · 495 阅读 · 0 评论 -
分拆素数和<hdoj2098>
Problem Description把一个偶数拆成两个不同素数的和,有几种拆法呢? Input输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束。 Output对应每个偶数,输出其拆成不同素数的个数,每个结果占一行。 Sample Input30260原创 2016-07-20 18:12:49 · 457 阅读 · 0 评论 -
素数判定<hdoj2012>
Problem Description对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39 Input输入数据有多组,每组占一行,由两个整数x,y组成,当x=0,y=0时,表示输入结束,该行不做处理。 Output对于每个给定范围内的取值,如果表达式的值都为素数,则输出"OK",否则请输出“Sorry”,原创 2016-07-20 18:10:10 · 444 阅读 · 0 评论 -
Cake<hdoj1722>
CakeTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3519 Accepted Submission(s): 1829Problem Description一次生日Party可能有p人或者q人参加,原创 2016-07-20 18:01:45 · 381 阅读 · 0 评论 -
Pasha and Stick
DescriptionPasha has a wooden stick of some positive integer length n. He wants to perform exactly three cuts to get four parts of the stick. Each part must have some positive integer length and t原创 2016-07-21 21:42:34 · 310 阅读 · 0 评论 -
Uncowed Forces
DescriptionKevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maximum point values of 500, 1000, 1500, 2000, and 2500, r原创 2016-07-21 21:38:16 · 361 阅读 · 0 评论 -
Patrick and Shopping
DescriptionToday Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long r原创 2016-07-21 21:32:45 · 320 阅读 · 0 评论 -
Tricky Sum
Description求和是一种最常见的运算,我们经常做的就是1加到n的和。例如,1加到100的和是5050。但是现在,我们稍微变动一下求和方法,对于属于2的幂次的数,我们做的是减法,其余仍旧做加法。例如,当n=4的时候,最后的结果应该是-1-2+3-4=-4,因为1、2、4分别是2的0次方、2的1次方、2的2次方。现在请你来计算t次这样的运算。Input输入第原创 2016-07-21 21:31:45 · 416 阅读 · 0 评论 -
Divisibility
DescriptionFind the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x that a ≤ x ≤ b and x is divisible by k.Inpu原创 2016-07-21 21:31:02 · 347 阅读 · 0 评论 -
LightOJ 1275:Internet Service Providers
DescriptionA group of N Internet Service Provider companies (ISPs) use a private communication channel that has a maximum capacity of C traffic units per second. Each company transfers T traffic u原创 2016-08-15 20:47:13 · 392 阅读 · 0 评论