随笔分类 - 其他 二分
摘要:区间计数 基准时间限制:1.5 秒 空间限制:262144 KB 分值: 80 两个数列 {An} , {Bn} ,请求出Ans, Ans定义如下: Ans:=Σni=1Σnj=i[max{Ai,Ai+1,...,Aj}=max{Bi,Bi+1,...,Bj}] 注:[ ]内表达式为真,则为1,否则
阅读全文
摘要:Fleet of the Eternal Throne Problem Description > The Eternal Fleet was built many centuries ago before the time of Valkorion by an unknown race on th
阅读全文
摘要:Kanade's sum Problem Description Give you an array A[1..n]of length n. Let f(l,r,k) be the k-th largest element of A[l..r].Specially , f(l,r,k)=0 if r
阅读全文
摘要:题目链接:传送门 题解: 枚举每一行,每一行当中连续的y个我们hash 出来 那么一行就是 m - y + 1个hash值,形成的一个新 矩阵 大小是 n*(m - y + 1), 我们要找到x*y这个矩阵的 话 是不是就是 在每一列跑kmp就行了?
阅读全文
摘要:题目链接:传送门 题意: 给你n个串 问你任意两个串的最大公共前缀长度是多少 题解: 二分+hash 思路很明显,我最近用来写hash 很鸡肋
阅读全文
摘要:E. Prairie Partition It can be shown that any positive integer x can be uniquely represented as x = 1 + 2 + 4 + ... + 2k - 1 + r, where k and r are in
阅读全文
摘要:E. Product Sum Blake is the boss of Kris, however, this doesn't spoil their friendship. They often gather at the bar to talk about intriguing problems
阅读全文
摘要:1305: [CQOI2009]dance跳舞 Description 一次舞会有n个男孩和n个女孩。每首曲子开始时,所有男孩和女孩恰好配成n对跳交谊舞。每个男孩都不会和同一个女孩跳两首(或更多)舞曲。有一些男孩女孩相互喜欢,而其他相互不喜欢(不会“单向喜欢”)。每个男孩最多只愿意和k个不喜欢的女孩
阅读全文
摘要:1001题意:n个人,给m对敌对关系,X个好人,Y个坏人。现在问你是否每个人都是要么是好人,要么是坏人。 先看看与X,Y个人有联通的人是否有矛盾,没有矛盾的话咋就继续遍历那些不确定的人关系,随便取一个数3,与其相连的就是4,间隔就要相同,dfs搜过去就可以判断了 #include<bits/stdc
阅读全文
摘要:1001: 传递要求 a->b->c && a->c 我的做法就是利用bitset预处理出x点可达点集,与可达到x点的点集 那么如何检验这个图是否传递;枚举完b和,枚举可达b点集中的点x,那么点x可达点集要包含c点集,这个利用bieset可以快速判断 整个做法就是(n^2) #include<cst
阅读全文
摘要:Milk Patterns Description Farmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he disc
阅读全文
摘要:Life Forms Description You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, col
阅读全文
摘要:Musical Theme Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representin
阅读全文
摘要:E. Sign on Fence Bizon the Champion has recently finished painting his wood fence. The fence consists of a sequence of n panels of 1 meter width and o
阅读全文
摘要:Function Problem Description The shorter, the simpler. With this problem, you should be convinced of this truth. You are given an array A of N postive
阅读全文
摘要:Information Disturbing Problem Description In the battlefield , an effective way to defeat enemies is to break their communication system.The informat
阅读全文
摘要:Description You are given an array A consisting of N positive integers. You have to answer Q queries on it of following type: l r k : Let S denote the
阅读全文
摘要:题目描述: 定义一个长度为奇数的区间的值为其所包含的的元素的中位数。 现给出n个数,求将所有长度为奇数的区间的值排序后,第K大的值为多少。 样例解释: [l,r]表示区间的值 [1]:3 [2]:1 [3]:2 [4]:4 [1,3]:2 [2,4]:2 第三大是2 输入: 第一行两个数n和k(1<
阅读全文
摘要:Description One-dimensional country has n cities, the i-th of which is located at the point xi and has population pi, and all xi, as well as all pi, a
阅读全文
摘要:XOR 游戏 Problem Description 众所周知,度度熊喜欢XOR运算[(XOR百科)](http://baike.baidu.com/view/674171.htm)。今天,它发明了一种XOR新游戏,最开始,它有一个长度为N的数组,度度熊可以任意添加分割线,将数组划分为M段,且每段长
阅读全文

浙公网安备 33010602011771号