摘要:
C. Remove the Bracket RSJ has a sequence $a$ of $n$ integers $a_1,a_2, \ldots, a_n$ and an integer $s$. For each of $a_2,a_3, \ldots, a_{n-1}$, he cho 阅读全文
摘要:
F. Timofey and Black-White Tree Timofey came to a famous summer school and found a tree on $n$ vertices. A tree is a connected undirected graph withou 阅读全文
摘要:
斐波那契前 n 项和 大家都知道 Fibonacci 数列吧,$f_1=1,f_2=1,f_3=2,f_4=3, \ldots ,f_n=f_{n−1}+f_{n−2}$。 现在问题很简单,输入 $n$ 和 $m$,求 $f_n$ 的前 $n$ 项和 $S_n \bmod m$。 输入格式 共一行, 阅读全文
摘要:
最幸运的数字 $8$ 是中国的幸运数字,如果一个数字的每一位都由 $8$ 构成则该数字被称作是幸运数字。 现在给定一个正整数 $L$,请问至少多少个 $8$ 连在一起组成的正整数(即最小幸运数字)是 $L$ 的倍数。 输入格式 输入包含多组测试用例。 每组测试用例占一行,包含一个整数 $L$。 当输 阅读全文
摘要:
B. GCD Partition While at Kira's house, Josuke saw a piece of paper on the table with a task written on it. The task sounded as follows. There is an a 阅读全文
摘要:
D. Fixed Prefix Permutations You are given $n$ permutations $a_1, a_2, \dots, a_n$, each of length $m$. Recall that a permutation of length $m$ is a s 阅读全文
摘要:
Rank Transform of a Matrix Given an m x n matrix , return a new matrix answer where answer[row][col] is the rank of matrix[row][col] . The rank is an 阅读全文
摘要:
Minimum Cost to Split an Array You are given an integer array nums and an integer $k$. Split the array into some number of non-empty subarrays. The co 阅读全文
摘要:
B. Emordnilap A permutation of length $n$ is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary order. For example, $[2,3,1,5,4 阅读全文
摘要:
C. Quiz Master A school has to decide on its team for an international quiz. There are $n$ students in the school. We can describe the students using 阅读全文