摘要:
Ice Cream Shop 题目描述 On a beach there are n huts in a perfect line, hut 1 being at the left and hut i+1 being 100 meters to the right o 阅读全文
摘要:
多维数组声明 // 含有 2 个【含有 3 个 int 元素的数组】元素的数组 int a[2][3] = {{1, 2, 3}, {4, 5, 6}}; // 可视作 2 × 3 矩阵,布局以行为主 int b[2][3][4] = {{{1, 2, 3},{4, 5, 6},{7, 8, 9}} 阅读全文
摘要:
题目描述 An identity permutation of length n is an array [1,2,3,⋯,n]. We performed the following operations to an identity permutation of len 阅读全文
摘要:
题目描述 首先村落里的一共有 n 座房屋,并形成一个树状结构。然后救济粮分 m 次发放,每次选择两个房屋 (x, y),然后对于 x 到 y的路径上(含 x 和 y)每座房子里发放一袋 z 类型的救济粮。 然后深绘里想知道,当所有的救济粮发 阅读全文
摘要:
Simpson 公式 ∫rlf(x)dx≈r−l6[f(l)+4f(l+r2)+f(r)] Simpson 公式将 (l,f(l)),(r,f(r)),(l+r2,f(l+r2)) 看作一 阅读全文
摘要:
题目描述 You have an array a consisting of n distinct positive integers, numbered from 1 to n . Define pk as \(p_k = \sum_{1 \le i, j 阅读全文
摘要:
for (int i = 1;i <= n;i++) for (int j = 1;j <= n/i;j++) ... 是调和级数级别的复杂度,可以由调和级数近似求和公式得到 T(n)=n∑ni=11n=O(nlnn) 具体过程如下 $$\begin{ 阅读全文
摘要:
题目描述 小 C 正在玩一个移球游戏,他面前有 n+1 根柱子,柱子从 1∼n+1 编号,其中 1 号柱子、2 号柱子、……、n 号柱子上各有 m 个球,它们自底向上放置在柱子上,n+1 号柱子上初始时没有球。这 \(n \t 阅读全文
摘要:
题目描述 LiLand is a country, consisting of n cities. The cities are numbered from 1 to n . The country is well known because it has a very st 阅读全文