Codility
文章平均质量分 78
小小小小小胖子
Learn different
展开
-
Codility-StoneWall
You are going to build a stone wall. The wall should be straight and N meters long, and its thickness should be constant; however, it should have different heights in different places. The height of t原创 2014-07-21 16:10:23 · 1005 阅读 · 0 评论 -
Codility-FigFrog
The Fibonacci sequence is defined using the following recursive formula: F(0) = 0 F(1) = 1 F(M) = F(M - 1) + F(M - 2) if M >= 2 A small frog wants to get to the other side of a river.原创 2014-09-24 15:57:32 · 664 阅读 · 0 评论 -
Codility-FibFrog
The Fibonacci sequence is defined using the following recursive formula: F(0) = 0 F(1) = 1 F(M) = F(M - 1) + F(M - 2) if M >= 2 A small frog wants to get to the other side of a river.原创 2014-09-24 15:45:58 · 2473 阅读 · 0 评论 -
Codility-ChocolatesByNumbers
Task description Two positive integers N and M are given. Integer N represents the number of chocolates arranged in a circle, numbered from 0 to N − 1. You start to eat the chocolates. After eat原创 2014-08-29 21:21:46 · 1465 阅读 · 0 评论 -
Codility-CountNonDivisible
Task description You are given a non-empty zero-indexed array A consisting of N integers. For each number A[i] such that 0 ≤ i For example, consider integer N = 5 and array A such that:原创 2014-07-30 16:35:21 · 1121 阅读 · 0 评论 -
Codility-Flags
Task description A non-empty zero-indexed array A consisting of N integers is given. Apeak is an array element which is larger than its neighbours. More precisely, it is an index P such that 0 A原创 2014-07-29 16:08:10 · 1573 阅读 · 0 评论 -
Codility-Peak
Task description A non-empty zero-indexed array A consisting of N integers is given. A peak is an array element which is larger than its neighbors. More precisely, it is an index P such that 0原创 2014-07-27 15:33:39 · 844 阅读 · 0 评论 -
Codility-MinPerimeterRectangle
Task description An integer N is given, representing the area of some rectangle. The area of a rectangle whose sides are of length A and B is A * B, and the perimeter is 2 * (A + B). The goal i原创 2014-07-26 10:15:30 · 759 阅读 · 0 评论 -
Codility-MaxSliceSum&MaxDoubleSlice
Task description A non-empty zero-indexed array A consisting of N integers is given. A triplet (X, Y, Z), such that 0 ≤ X double slice. The sum of double slice (X, Y, Z) is the total of A[X + 1原创 2014-07-25 10:49:39 · 928 阅读 · 0 评论 -
Codility-MaxProfit
Task description A zero-indexed array A consisting of N integers is given. It contains daily prices of a stock share for a period of N consecutive days. If a single share was bought on day P and原创 2014-07-24 11:05:38 · 886 阅读 · 0 评论 -
Codility-EquiLeader
Task description A non-empty zero-indexed array A consisting of N integers is given. The leader of this array is the value that occurs in more than half of the elements of A. An equi leader is原创 2014-07-23 15:45:08 · 1469 阅读 · 0 评论 -
Codility-Fish
Task description You are given two non-empty zero-indexed arrays A and B consisting of N integers. Arrays A and B represent N voracious fish in a river, ordered downstream along the flow of the r原创 2014-07-22 10:37:46 · 748 阅读 · 0 评论