摘要: Liyuan lives in a old apartment. One day, he suddenly found that there was a wireless network in the building. Liyuan did not know the passwor... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(117) 评论(0) 推荐(0) 编辑
摘要: ob has a dictionary with N words in it. Now there is a list of words in which the middle part of the word has continuous letters disappeared.... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fi... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(256) 评论(0) 推荐(0) 编辑
摘要: You should process m queries over a set D of strings. Each query is one of three kinds:Add a string s to the set D. It is guaranteed that the ... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Fat brother and Maze are playing a kind of special (hentai) game with two integers. All the digits of these two integers are in the range from... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题意:给出一个字符串,求出第k小的子串,并求出字符串的起止位置,如果有多个重复的子串,求出位置最靠左的子串。 思路:比赛时,想到了要用后缀数组,但是没想到如何做。 其实,因为子串是后缀的前缀,后缀数组对后缀排序的同时,也对子串进行了排序。对于每一个sa[i],会产... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 很明显 主席树:是一个需要离散化的过程,一棵树就是整个所有序列的离散后的值, 然后从sum中开始找// 题意// 给出一个序列,m组查询,对每个查询(i, j, k)需要输出区间[i, j]中第k大的数。// 题解// 主席树的入门题。 // 主席树其实就是可持久化线段树,比如现有... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(78) 评论(0) 推荐(0) 编辑
摘要: Mr. Frog has an integer sequence of length n, which can be denoted as a1,a2,⋯,ana1,a2,⋯,anThere are m queries. In the i-th query, you are given two in... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 总算是把动态求区间第k个数的算法看明白了。 在主席树的基础上,如果有修改操作,则要通过套树状数组来实现任意区间求第k小的问题。 刚开始看不明白什么意思,现在有一点理解。树状数组的每个元素是一个线段树,来维护修改后的前后缀和,树状数组能在log时间内更整个数组,现在用相同的方式更新整个... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权。其中lastans是上一个询问的答案,初始为0,即第一个询问的u是明文。Input 第一行两个整数N,M。 第二行有N个整数,其中第i个整数表示点i的... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(86) 评论(0) 推荐(0) 编辑