线段树
文章平均质量分 77
以往不谏,来者可追
这个作者很懒,什么都没留下…
展开
-
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 · 389 阅读 · 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 · 215 阅读 · 0 评论 -
【JZOJ5618】华胥梦天
Description Input Output SampleInput:10 104 9 5 9 4 4 4 7 3 53 4 102 39 35 393 37 342 26 16 312 28 19 311 19 283 27 283 23 263 12 93 8 11Output:362518151212Data Constr...原创 2018-05-16 19:17:04 · 149 阅读 · 0 评论 -
【JZOJ5689】二进制
Description Pupil 发现对于一个十进制数,无论怎么将其的数字重新排列,均不影响其是不是3 的倍数。他想研究对于二进制,是否也有类似的性质。于是他生成了一个长为n的二进制串,希望你对于这个二进制串的一个子区间,能求出其有多少位置不同的连续子串,满足在重新排列后(可包含前导 0)是一个3的倍数。两个位置不同的子区间指开始位置不同或结束位置不同。由于他想尝试尽量多的情况,他有时会修改串...原创 2018-05-23 20:22:01 · 304 阅读 · 0 评论 -
【Codeforces960H】 Santa's Gift
time limit per test:4 seconds memory limit per test:512 megabytes standard input standard outputDescription Santa has an infinite number of candies for each of m flavours. You are given a rooted...原创 2018-07-01 22:09:04 · 345 阅读 · 0 评论 -
【Codeforces960F】Pathwalks
time limit per test:1 second memory limit per test:256 megabytes standard input standard outputDescription You are given a directed graph with n nodes and m edges, with all edges having a certai...原创 2018-07-02 07:56:27 · 269 阅读 · 0 评论 -
【codeforces986E】 Prince's Problem
time limit:per test 3 seconds memory limit:per test 512 megabytes standard input standard outputDescription Let the main characters of this problem be personages from some recent movie. New Aven...原创 2018-06-27 07:52:06 · 319 阅读 · 0 评论 -
【JZOJ5296】Sequence
Time Limits: 2000 ms Memory Limits: 524288 KB Detailed Limits Description Input Output Sample Input10 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 · 211 阅读 · 0 评论 -
历史行程
题意:给出串,多组询问,问区间[l,r]的两个数[i,j],ij不同,以i,j结尾的前缀最长公共后缀最大是多少。长度询问数1e5很容易想到弄个SA,求出height数组两个前缀的最长公共后缀对应着SA的位置之间height的最小值考虑一个height值对序列的贡献,也就是要弄出跨过每一个height的两点l,r,并且lr之间不存在更小的。就相当于在一个笛卡尔树上做子树合并,这个可以用...原创 2019-08-22 16:46:51 · 514 阅读 · 0 评论