码迷,mamicode.com
首页 >  
搜索关键字:codility    ( 89个结果
【题解】【数组】【DP】【Codility】MaxSliceSum & MaxDoubleSliceSum
Find a maximum sum of a compact subsequence of array elements and any double slice.
分类:其他好文   时间:2014-07-06 20:44:45    阅读次数:351
【题解】【数组】【DP】【Codility】Best Time to Buy and Sell Stock
Given a log of stock prices compute the maximum possible earning.
分类:其他好文   时间:2014-07-06 20:04:21    阅读次数:259
【题解】【数组】【Prime and composite numbers】【Codility】Peaks
Divide an array into the maximum number of same((-))sized blocks, each of which should contain an index P such that A[P - 1] A[P + 1].
分类:其他好文   时间:2014-07-06 15:30:31    阅读次数:465
【题解】【数组】【Prime and composite numbers】【Codility】Flags
Find the maximum number of flags that can be set on mountain peaks.
分类:其他好文   时间:2014-07-06 15:07:09    阅读次数:371
codility上的问题 (36)Natrium 2014
这个题比较简单,好像也比较old,给定一个整数数组A,有N个元素,找到所有下标对(P,Q)满足  0 ≤ P ≤ Q 数据范围N [1..3*10^5]数组元素[-10^9, +10^9]要求时间复杂度O(N),空间复杂度O(N)。分析: 如果b[i] = max{a[i..N - 1]} ,则对每个i,我们找到最大的j,满足b[j]>=a[i],就可以了。这样做的目的是b,反映了后面还有没有比a...
分类:其他好文   时间:2014-07-06 08:30:20    阅读次数:179
[codility]Triangle
最近在学scala语言,scala代码如下: import scala.collection.JavaConversions._ object Solution { def solution(A: Array[Int]): Int = { // write your code in Scala 2.10 // sort scala.uti...
分类:其他好文   时间:2014-05-07 04:20:38    阅读次数:352
[codility]MaxProductOfThree
最近在学scala语言,scala代码如下: import scala.collection.JavaConversions._ import scala.util.control.Breaks._ object Solution { def solution(A: Array[Int]): Int = { // write your code in Scala 2.10...
分类:其他好文   时间:2014-05-04 09:42:56    阅读次数:372
[codility]Distinct
最近在学scala语言,scala代码如下: import scala.collection.JavaConversions._ object Solution { def solution(A: Array[Int]): Int = { // write your code in Scala 2.10 // using quick sort to so...
分类:其他好文   时间:2014-05-04 09:22:37    阅读次数:341
[codility]CountDiv
最近在学scala语言,scala代码如下: import scala.collection.JavaConversions._ object Solution { def solution(A: Int, B: Int, K: Int): Int = { // write your code in Scala 2.10 var cnt: Int = 0...
分类:其他好文   时间:2014-05-04 09:06:08    阅读次数:307
89条   上一页 1 ... 7 8 9
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!