
线段树
文章平均质量分 78
以往不谏,来者可追
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Window
Window (Standard IO)Time Limits: 1000 ms Memory Limits: 65536 KBDescription 给你一个长度为N的数组,一个长为K的滑动的窗体从最左移至最右端,你只能见到窗口的K个数,每次窗体向右移动一位,如下表: 你的任务是找出窗口在各位置时的max value,min value.Input 第1行n,k,第2行为长原创 2016-07-08 07:18:51 · 461 阅读 · 0 评论 -
Trip
TripTime Limits: 1500 ms Memory Limits: 262144 KB题目大意 给定一个数列a[1..n]|a[i]|≤109|a[i]|\leq10^9,数列中的数两两不同,给定m个询问,每个询问l,r,求存在多少个i∈[l,r]i\in [l,r]满足∀j∈[l,i)a[j]<a[i]\forall_{j\in[l,i)}a[j]\lt a[i]或者∀j∈(j,r原创 2017-08-08 20:45:36 · 320 阅读 · 0 评论 -
【JZOJ5618】华胥梦天
Description Input Output Sample Input: 10 10 4 9 5 9 4 4 4 7 3 5 3 4 10 2 39 35 39 3 37 34 2 26 16 31 2 28 19 31 1 19 28 3 27 28 3 23 26 3 12 9 3 8 11 Output: 36 25 18 15 12 12 Data Constr...原创 2018-05-16 19:17:04 · 201 阅读 · 0 评论 -
【JZOJ5689】二进制
Description Pupil 发现对于一个十进制数,无论怎么将其的数字重新排列,均不影响其是不是3 的倍数。他想研究对于二进制,是否也有类似的性质。于是他生成了一个长为n的二进制串,希望你对于这个二进制串的一个子区间,能求出其有多少位置不同的连续子串,满足在重新排列后(可包含前导 0)是一个3的倍数。两个位置不同的子区间指开始位置不同或结束位置不同。由于他想尝试尽量多的情况,他有时会修改串...原创 2018-05-23 20:22:01 · 362 阅读 · 0 评论 -
【Codeforces960H】 Santa's Gift
time limit per test:4 seconds memory limit per test:512 megabytes standard input standard output Description Santa has an infinite number of candies for each of m flavours. You are given a rooted...原创 2018-07-01 22:09:04 · 427 阅读 · 0 评论 -
【Codeforces960F】Pathwalks
time limit per test:1 second memory limit per test:256 megabytes standard input standard output Description You are given a directed graph with n nodes and m edges, with all edges having a certai...原创 2018-07-02 07:56:27 · 329 阅读 · 0 评论 -
【codeforces986E】 Prince's Problem
time limit:per test 3 seconds memory limit:per test 512 megabytes standard input standard output Description Let the main characters of this problem be personages from some recent movie. New Aven...原创 2018-06-27 07:52:06 · 389 阅读 · 0 评论 -
【JZOJ5296】Sequence
Time Limits: 2000 ms Memory Limits: 524288 KB Detailed Limits Description Input Output Sample Input 10 5 4 8 9 1 6 3 2 7 10 5 6 3 4 1 2 10 7 8 9 5 3 7 2 4 1 3 10 3 7 4 6 8 1 3 1 ...原创 2018-07-02 21:53:20 · 277 阅读 · 0 评论 -
历史行程
题意: 给出串,多组询问,问区间[l,r]的两个数[i,j],ij不同,以i,j结尾的前缀最长公共后缀最大是多少。 长度询问数1e5 很容易想到弄个SA,求出height数组 两个前缀的最长公共后缀对应着SA的位置之间height的最小值 考虑一个height值对序列的贡献,也就是要弄出跨过每一个height的两点l,r,并且lr之间不存在更小的。 就相当于在一个笛卡尔树上做子树合并,这个可以用...原创 2019-08-22 16:46:51 · 576 阅读 · 0 评论