摘要:
上课睡觉 有 $N$ 堆石子,每堆的石子数量分别为 $a_1,a_2, \ldots, a_N$。 你可以对石子堆进行合并操作,将两个相邻的石子堆合并为一个石子堆,例如,如果 $a=[1,2,3,4,5]$,合并第 $2,3$ 堆石子,则石子堆集合变为 $a=[1,5,4,5]$。 我们希望通过尽可 阅读全文
摘要:
Add Edges to Make Degrees of All Nodes Even There is an undirected graph consisting of $n$ nodes numbered from $1$ to $n$. You are given the integer $ 阅读全文
摘要:
打地鼠 欢迎各位勇者来到力扣城,本次试炼主题为「打地鼠」。 勇者面前有一个大小为 3*3 的打地鼠游戏机,地鼠将随机出现在各个位置,moles[i] = [t,x,y] 表示在第 t 秒会有地鼠出现在 (x,y) 位置上,并于第 t+1 秒该地鼠消失。 勇者有一把可敲打地鼠的锤子,初始时刻(即第 0 阅读全文
摘要:
D. Range = √Sum You are given an integer $n$. Find a sequence of $n$ distinct integers $a_1, a_2, \dots, a_n$ such that $1 \leq a_i \leq 10^9$ for all 阅读全文
摘要:
Count Subarrays With Median K You are given an array nums of size $n$ consisting of distinct integers from $1$ to $n$ and a positive integer $k$. Retu 阅读全文
摘要:
C. Almost All Multiples Given two integers $n$ and $x$, a permutation$^{\dagger}$ $p$ of length $n$ is called funny if $p_i$ is a multiple of $i$ for 阅读全文
摘要:
E. Binary Inversions You are given a binary array$^{\dagger}$ of length $n$. You are allowed to perform one operation on it at most once. In an operat 阅读全文
摘要:
B. Elimination of a Ring Define a cyclic sequence of size $n$ as an array $s$ of length $n$, in which $s_n$ is adjacent to $s_1$. Muxii has a ring rep 阅读全文
摘要:
G. Restore the Permutation A sequence of $n$ numbers is called permutation if it contains all numbers from $1$ to $n$ exactly once. For example, the s 阅读全文
摘要:
Number of Beautiful Partitions You are given a string s that consists of the digits '1' to '9' and two integers k and minLength. A partition of s is c 阅读全文