
codelity
文章平均质量分 53
xyqzki
wahahahaahahahahah
展开
-
codelity--MaxProductOfThree
trick:if using python, we can swap two elements like \A[k], A[minimal] = A[minimal], A[k]problem:A non-empty zero-indexed array A consisting of N integers is given. The product of triplet (P, Q, R) equ原创 2015-11-26 19:41:53 · 1007 阅读 · 0 评论 -
GenomicRangeQuery
题目 A DNA sequence can be represented as a string consisting of the letters A, C, G and T, which correspond to the types of successive nucleotides in the sequence. Each nucleotide has an impact factor,原创 2015-11-26 18:32:51 · 986 阅读 · 0 评论 -
codelity刷题---MinAvgTwoSlice
https://codility.com/programmers/task/min_avg_two_slicehttp://codesays.com/2014/solution-to-min-avg-two-slice-by-codility/这里其实跟 codelity说要练习的prefix sum没关系。这里需要认识到两个hints,一个就是slice with the global MA mu原创 2015-11-26 16:30:41 · 1719 阅读 · 0 评论 -
NumberOfDiscIntersections--重点
Problem: We draw N discs on a plane. The discs are numbered from 0 to N − 1. A zero-indexed array A of N non-negative integers, specifying the radiuses of the discs, is given. The J-th disc is drawn w原创 2015-11-27 12:28:31 · 2893 阅读 · 0 评论 -
Codility K complementary pairs
codelity kcomplementary pairs A non-empty zero-indexed array A consisting of N integers is given. A pair of integers (P, Q) is called K-complementary in array A if 0 ≤ P,原创 2016-03-20 16:04:37 · 2765 阅读 · 0 评论 -
Triangle
A zero-indexed array A consisting of N integers is given. A triplet (P, Q, R) is triangular if 0 ≤ P < Q < R < N and:A[P] + A[Q] > A[R], A[Q] + A[R] > A[P], A[R] + A[P] > A[Q]. For example, consider原创 2015-11-26 20:45:42 · 577 阅读 · 0 评论