摘要: 博客搬至 http://blog.csdn.net/littlewhite520 阅读全文
posted @ 2017-09-30 18:07 黑码的博客 阅读(114) 评论(0) 推荐(0) 编辑
摘要: sd0061, the legend of Beihang University ACM-ICPC Team, retired last year leaving a group of noobs. Noobs have no idea how to deal with mm com... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(134) 评论(0) 推荐(0) 编辑
摘要: There is a tree with nn nodes, each of which has a type of color represented by an integer, where the color of node ii is cici. The path betwe... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 转自:http://blog.csdn.net/cysjiang/article/details/76090902题意: 给你一个a序列,代表0到n-1的排列;一个b序列代表0到m-1的排列。问你可以找出多少种函数关系,满足f(i)=b[f(a[i])]; 分析:这个主要是找循环... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(97) 评论(0) 推荐(0) 编辑
摘要: On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cav... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Background To The Moon is a independent game released in November 2011, it is a role-playing adventure game powered by RPG Maker. The premis... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(127) 评论(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) 编辑
摘要: 总算是把动态求区间第k个数的算法看明白了。 在主席树的基础上,如果有修改操作,则要通过套树状数组来实现任意区间求第k小的问题。 刚开始看不明白什么意思,现在有一点理解。树状数组的每个元素是一个线段树,来维护修改后的前后缀和,树状数组能在log时间内更整个数组,现在用相同的方式更新整个... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(114) 评论(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) 编辑
摘要: 很明显 主席树:是一个需要离散化的过程,一棵树就是整个所有序列的离散后的值, 然后从sum中开始找// 题意// 给出一个序列,m组查询,对每个查询(i, j, k)需要输出区间[i, j]中第k大的数。// 题解// 主席树的入门题。 // 主席树其实就是可持久化线段树,比如现有... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(78) 评论(0) 推荐(0) 编辑