算法&&数学: 拥有最小平均数的切片

问题Problem 在codility看到的题目, 题目内容如下 题目内容 英文题目 A non-empty array A consisting of N integers is given. A pair of integers $(P, Q)$, such that $0 ≤ P < Q < N$, is called a slice of array A (notice that the slice contains at least two elements). The average of a slice $(P, Q)$ is the sum of $A[P] + A[P + 1] + … + A[Q]$ divided by the length of the slice. To be precise, the average equals $(A[P] + A[P + 1] + … + A[Q]) / (Q − P + 1)$. ...

2024-10-12 · Moo

算法: 寻找最大良田正方形区域

Question A farmer wants to farm their land with the maximum area where good land is present. The “land” is represented as a matrix with 1s and 0s, where 1s mean good land and 0s mean bad land. The farmer only want to farm in a square of good land with the maximum area. Please help the farmer to find the maximum area of the land they can farm in good land. Example: ...

2021-03-11 · Moo