随笔分类 - 传统算法
摘要:The regime of a small but wealthy dictatorship has been abruptly overthrown by an unexpected rebel-lion. Because of the enormous disturbances this is
阅读全文
摘要:You, the head of Department of Security, recently received a top-secret information that a group of terrorists is planning to transport some WMD 1 fro
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/881/A来源:牛客网 Two arrays u and v each with m distinct elements are called equivalent if and only if RMQ(u,l,r)=RM
阅读全文
摘要:As two icons of the Great Depression, Bonnie and Clyde represent the ultimate criminal couple. Stories were written, headlines captured, and films wer
阅读全文
摘要:Suppose that G is an undirected graph, and the value of stab is defined as follows: Among the expression,G -i, -j is the remainder after removing node
阅读全文
摘要:Given a sequence, {A1, A2, ..., An} which is guaranteed A1 > A2, ..., An, you are to cut it into three sub-sequences and reverse them separately to fo
阅读全文
摘要:Your task is, given an integer N, to make a palidrome (word that reads the same when you reverse it) of length at least N. Any palindrome will do. Eas
阅读全文
摘要:You are the King of Byteland. Your agents have just intercepted a batch of encrypted enemy messages concerning the date of the planned attack on your
阅读全文
摘要:A substring of a string T is defined as: T( i, k)= TiTi +1... Ti+k -1, 1≤ i≤ i+k-1≤| T|. Given two strings A, B and one integer K, we define S, a set
阅读全文
摘要:The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For e
阅读全文
摘要:A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, the string s = aba
阅读全文
摘要:Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20;Each test case consists of one strin
阅读全文
摘要:Vus the Cossack has two binary strings, that is, strings that consist only of "0" and "1". We call these strings aa and bb. It is known that |b|≤|a||b
阅读全文
摘要:You are given a tree (an undirected connected acyclic graph) consisting of nn vertices. You are playing a game on this tree. Initially all vertices ar
阅读全文
摘要:You are given a prime number pp, nn integers a1,a2,…,ana1,a2,…,an, and an integer kk. Find the number of pairs of indexes (i,j)(i,j) (1≤i<j≤n1≤i<j≤n)
阅读全文
摘要:Note that this is the first problem of the two similar problems. You can hack this problem only if you solve both problems. You are given a tree with
阅读全文
摘要:Problem Description There are n lights in a circle numbered from 1 to n. The left of light 1 is light n, and the left of light k (1< k<= n) is the lig
阅读全文
摘要:神秘群岛 Description 小J继续着周游世界的旅程,这次他来到了一个神奇的群岛。这片群岛有n个岛屿,同时这些岛屿被标上了1-n的编号。 每个岛屿上面都有神奇的传送门,传送门可以把小J从当前的岛屿u传送到指定的岛屿v上面,同时在对应的岛屿v上也有一个与之相对应的传送门,可以使用这个传送门从岛屿
阅读全文
摘要:Katu Puzzle Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11429 Accepted: 4233 Description Katu Puzzle is presented as a directed graph G
阅读全文
摘要:Ikki's Story IV - Panda's Trick Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 11405 Accepted: 4168 Description liympanda, one of Ikki’s
阅读全文

浙公网安备 33010602011771号