摘要:
It's known to all that ZYB is godlike, so obviously he has a large number of titles, such as jskingjsking, bijingzybbijingzyb and nbazybnbazyb. ZYB li 阅读全文
摘要:
Alice and Bob play a game. Initially they have a string s1,s2,…,sns1,s2,…,sn, consisting of only characters . and X. They take alternating turns, and 阅读全文
摘要:
Escape Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 16 Accepted Submission(s): 12 Problem De 阅读全文
摘要:
Decimal Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 103 Accepted Submission(s): 49 Problem 阅读全文
摘要:
Invoker Time Limit: 15000/12000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 117 Accepted Submission(s): 35 Proble 阅读全文
摘要:
队友过的:https://blog.csdn.net/liufengwei1/article/details/101632506 Forest Program Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K ( 阅读全文
摘要:
MUV LUV EXTRA Time Limit: 2000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 134 Accepted Submission(s): 49 Pr 阅读全文
摘要:
MUV LUV UNLIMITED Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 143 Accepted Submission(s): 1 阅读全文
摘要:
链接:https://ac.nowcoder.com/acm/contest/204/H来源:牛客网 题目描述 给定一棵 n 个点的树,其中 1 号结点是根,每个结点要么是黑色要么是白色 现在小 Bo 和小 Biao 要进行博弈,他们两轮流操作,每次选择一个黑色的结点将它变白,之后可以选择任意多个( 阅读全文
摘要:
Nim or not Nim? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3759 Accepted Submission(s): 1937 阅读全文
摘要:
Georgia and Bob Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 14312 Accepted: 4840 Description Georgia and Bob decide to play a self-inve 阅读全文
摘要:
A country named Berland has n cities. They are numbered with integers from 1 to n. City with index 1 is the capital of the country. Some pairs of citi 阅读全文
摘要:
题意: 给了一个母串S, 每次循环给了一个模板串,问模板串在母 串中“匹配”了多少次?“匹配”的意思就是首字母和尾字母一样, 中间字母顺序可以换。 题解: 字符串hash.我们将询问字符串的首尾特殊hash,然后将询问串的长度存入到vector里面。 然后遍历一遍原串,将所有是询问串长度的子串的哈希 阅读全文
摘要:
题目: 给定一棵树, 带边权。 现在有2种操作: 1.修改第i条边的权值。 2.询问u到其他一个任意点的最大距离是多少。 题解: 树的直径可以通过两次 dfs() 的方法求得。换句话说,到任意点最远的点,一定是直径的某个端点(反证法)。 • 因此原问题转化为动态维护直径,然后再支持询问两个点的距离, 阅读全文
摘要:
After a long lasting war on words, a war on arms finally breaks out between littleken’s and KnuthOcean’s kingdoms. A sudden and violent assault by Knu 阅读全文
摘要:
bobo has a tree, whose vertices are conveniently labeled by 1,2,…,n. At the very begining, the i-th vertex is assigned with weight w i.There are q ope 阅读全文
摘要:
What-The-Fatherland is a strange country! All phone numbers there are strings consisting of lowercase English letters. What is double strange that a p 阅读全文
摘要:
Typewriter Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 720 Accepted Submission(s): 225 Prob 阅读全文
摘要:
Battle over Cities Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 467 Accepted Submission(s): 1 阅读全文
摘要:
题解:题意不再说了,题目很清楚的。 思路:因为N<=10,所以考虑状态压缩 AC自动机中 val[1<<i]: 表示第i个字符串。AC自动机中fail指针是指当前后缀在其他串里面所能匹配的最长前缀的长度,然后我们在这里统计一下以该点结束所能包含的字符串的数量(就是在fail树中该点到根节点所经过的所 阅读全文
摘要:
Recently George is preparing for the Graduate Record Examinations (GRE for short). Obviously the most important thing is reciting the words. Now Georg 阅读全文
摘要:
题解:n个集合,你要进行m个操作。总共有3种操作。第一种,合并两个集合x和y。第二张,把特定的集合里面所有的数字加一。第三种,询问在某个集合里面,对于所有数字对2的k次方取模后,有多少个数字等于x。 思路:我们可以对于每一个节点保存一个lazy标记,这个标记类似于线段树中的lazy标记。每次整个集合 阅读全文
摘要:
E. e-Government time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The best programmers of E 阅读全文
摘要:
All submissions for this problem are available. Chef likes numbers and number theory, we all know that. There are N digit strings that he particularly 阅读全文
摘要:
Problem Description MZL's Circle Zhou is good at solving some counting problems. One day, he comes up with a counting problem:You are given two string 阅读全文