随笔分类 - 题库—比赛/重现赛
摘要:A. K-skip Permutation 链接:https://ac.nowcoder.com/acm/contest/31453/A 来源:牛客网 题目描述 For a permutation P=p1,p2,⋯ ,pnP=p1,p2,⋯,pn of nn, let f(P,k)f(P,k) b
阅读全文
摘要:A. R 链接:https://ac.nowcoder.com/acm/contest/23479/A 来源:牛客网 题目描述 小红拿到了一个长度为 nn 的字符串,该字符串仅由大写字母组成。 小红很喜欢红色(用'R'字母表示),但她非常讨厌紫色(用'P'字母表示)。 她想取一个连续子串,该子串包含
阅读全文
摘要:Bob has given Alice a necklace as her birthday gift. That necklace has 𝑁N crystals, 𝑀M of which catches her fancy. Formally, crystals with labels of
阅读全文
摘要:Grammy is playing a game with her roommate Alice on a sequence 𝐴A with 𝑛n non-negative integers 𝐴1,𝐴2,…,𝐴𝑛A1,A2,…,An. The rules of the game are
阅读全文
摘要:After the last network breakdown, you've been assigned to redesign the signal transmission network of ICPC (Internet Clogging Prevention Corporation)!
阅读全文
摘要:Problem Description 给定一张 n×nn×n 的网格图,有些格子能走,有些格子不能走,左上角的格子坐标为 (1,1)(1,1),右下角的格子坐标为 (n,n)(n,n)。 问最多可以找到多少条从 (1,1)(1,1) 到 (n,n)(n,n) 的不相交路径,使得每条路径经过的每个格
阅读全文
摘要:Problem Description 有一个环,环上有 nn 个位置,它们的编号为 1...n1...n。 位置 i(1<i<n)i(1<i<n) 左右两边分别是位置 i−1i−1 和位置 i+1i+1,位置 1 左右两边分别是位置 nn 和位置 2,位置 nn 左右两边分别是位置 n−1n−1
阅读全文
摘要:Kobolds are rat-like, candle-loving cave folk, digging deep beneath the surface for millennia. Today, they gather together in a queue to explore yet a
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/10662/A 来源:牛客网 We call a matrix "01 Square" if and only if it's a N×NN×N matrix and its elements are all 00 or
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11211/A 来源:牛客网 A. 题目描述 大科学家dddd最近在研究转基因白菜,白菜的基因序列由一串大写英文字母构成,dddd经过严谨的推理证明发现,只有当白菜的基因序列呈按位非递减形式时,这株白菜的高附加值将达到最高
阅读全文
摘要:Prof. Pang plays chess against his rival Prof. Shou. They are the only two players in the game. The chessboard is very large and can be viewed as a 2D
阅读全文
摘要:With the rapid development of society, the demand for high-precision clocks is constantly rising. Recently, the China Clock Production Company is deve
阅读全文
摘要:While we enjoy chatting with friends on the internet, it is always annoying that we are overwhelmed by lots of messages in various chat groups. A grea
阅读全文
摘要:It's a sunny day with good scenery, and you come to the park for a walk. You feel curious that there are many old guys gathering by a bridge, and want
阅读全文
摘要:Yen-Jen loves cat very much. Now, there are 10^{18}1018 cats standing in a line, the i^ith cat's cost value c_ic**i is equal to ii, the i^ith cat's in
阅读全文
摘要:ABC Conjecture Time limit: 3 seconds Figure 1: Shinichi Mochizuki The ABC conjecture (also known as the Oesterle–Masser conjec- ´ ture) is a famous co
阅读全文
摘要:As we already know, base64 is a common binary-to-text encoding scheme. Here we define a special series of positional systems that represent numbers us
阅读全文
摘要:https://ac.nowcoder.com/acm/contest/11746 好久没写过代码了,思维能力下降,爬了 A. 切蛋糕 待补 B. 小宝的幸运数组 套路题,初始化tmp为0,从头遍历一遍数组,用tmp加上当前a[i]再对k取模,如果有两个位置得到的模数一样,说明这一段的和就是k的倍数
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/9977/B 来源:牛客网 题目描述 牛牛有一个长和高都为为nn的网格三角形,牛牛想从从左下角点走到右上角点,但是牛牛只能向上或者向右沿着网格的边走,牛牛想知道从左下角点走到右上角点的方案数的奇偶性。牛牛现在给你nn,请你
阅读全文
摘要:In computer science, a binary tree is a rooted tree in which each node has at most two children. In this problem, let's denote 𝑛n as the number of no
阅读全文