上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 63 下一页
摘要: Minimum Cost to Make Array Equal You are given two 0-indexed arrays nums and cost consisting each of $n$ positive integers. You can do the following o 阅读全文
posted @ 2023-02-02 23:12 onlyblues 阅读(96) 评论(0) 推荐(0)
摘要: Count Increasing Quadruplets Given a 0-indexed integer array nums of size $n$ containing all numbers from $1$ to $n$, return the number of increasing 阅读全文
posted @ 2023-02-02 19:36 onlyblues 阅读(56) 评论(0) 推荐(0)
摘要: 方程的解 佳佳碰到了一个难题,请你来帮忙解决。 对于不定方程 $a_1 + a_2+ \ldots + a_{k−1} + a_k = g(x)$,其中 $k \geq 1$ 且 $k \in N^{*}$,$x$ 是正整数,$g(x) = x^{x} \bmod 1000$(即 $x^{x}$ 除 阅读全文
posted @ 2023-02-02 12:22 onlyblues 阅读(80) 评论(0) 推荐(0)
摘要: Put Marbles in Bags You have k bags. You are given a 0-indexed integer array weights where weights[i] is the weight of the ith marble. You are also gi 阅读全文
posted @ 2023-02-01 18:00 onlyblues 阅读(94) 评论(0) 推荐(0)
摘要: 牡牛和牝牛 约翰要带 $N$ 只牛去参加集会里的展示活动,这些牛可以是牡牛,也可以是牝牛。 牛们要站成一排,但是牡牛是好斗的,为了避免牡牛闹出乱子,约翰决定任意两只牡牛之间至少要有 $K$ 只牝牛。 请计算一共有多少种排队的方法,所有牡牛可以看成是相同的,所有牝牛也一样,答案对 $5000011$ 阅读全文
posted @ 2023-02-01 12:20 onlyblues 阅读(161) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2023-01-31 16:31 onlyblues 阅读(85) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2023-01-30 19:01 onlyblues 阅读(125) 评论(0) 推荐(0)
摘要: 斐波那契前 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$。 输入格式 共一行, 阅读全文
posted @ 2023-01-28 17:04 onlyblues 阅读(192) 评论(0) 推荐(0)
摘要: 最幸运的数字 $8$ 是中国的幸运数字,如果一个数字的每一位都由 $8$ 构成则该数字被称作是幸运数字。 现在给定一个正整数 $L$,请问至少多少个 $8$ 连在一起组成的正整数(即最小幸运数字)是 $L$ 的倍数。 输入格式 输入包含多组测试用例。 每组测试用例占一行,包含一个整数 $L$。 当输 阅读全文
posted @ 2023-01-28 11:45 onlyblues 阅读(144) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2023-01-27 17:16 onlyblues 阅读(123) 评论(0) 推荐(0)
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 63 下一页
Web Analytics