2023.11.14 闲话
晚上吃晚饭回来,看到眼前光影节。
等到天气暑热郁郁枯寂,都仿照媒拾成功,我说不出,仿照怜悯的行为,也同逍遥快乐。
早就不带初心。这就是“初心”是什么?
当我在水上社,我的朋友说我变了,然而,人每天都在变化,应该有所准备,拿着这足以找到的。
以初心不一定容易。改变他的心为“初心”。
然而现在的魏天老师不改,这有当初的志向,我先为大家后面了。
然而,虽然有变化,一定要回头光辉,重感受所遇。
也许是化不可脱离,每相转折,尚能回忆。
不转,在坡吗?
Owo Song
{intro}
This song is for everybody who
Loves somebody (my mom doesn't love me)
Yeah, that works (or my father)
{chorus}
Owo what is this?
I think i found love within
Deep inside your heart and soul
Owo (ay, yuh) (what does owo mean? again, i have no idea)
Owo what is this?
I think i found love within3333
Deep inside your heart and soul
Owo, yeah, yeah (owo, baby) (seriously! what does owo mean?!)
Owo what is this?
I think i found love within
Deep inside your heart and soul
Owo, oh (owo, baby) (my mom just grounded me from soccer practice please help)
{verse 1}
Tell me, do you want me, baby? (yeah, yeah)
Tell me, do i drive you crazy? (yeah, yeah)
Tell me, do i make you go 'owo'? (owo, yeah, girl) (somebody please help, my mom won't give me back my x-box)
Tell me, do you want me, baby? (owo, owo, owo, yeah, yeah)
Tell me, do i drive you crazy? (owo, owo, owo)
Tell me, do i make you go 'owo'? (yeah) (yeah, yeah)
{chorus}
(my mom has yet to give me back my)
Owo what is this? (x-box360, i am going to)
I think i found love within (call the cops on her or-)
Deep inside your heart and soul (*laughs*)
Owo (yeah, ay)
Owo what is this?
I think i found love within
Deep inside your heart and soul
Owo (uwo, girl) (i am abused at home, oh)
Owo what is this?
I think i found love within
Deep inside your heart and soul
Owo (uwo, darling)
{outro}
(owo, o-owo!
I have burn marks on me from my fathers cigarettes *giggles*
Owo! *laughs*)
问题:
给一个长度为 \(n\) 的整数序列,\(q\) 次操作每次区间 checkmax,最后输出整个序列 .
\(n\le 10^5\),\(q\le2\times 10^7\),值域 \([0,2^{32}]\) . 数据随机 .
模拟赛的题,做法比较逆天,记录一下:
Solution 1 二区间合并,\(O(n\log n+q)\) .
Solution 2 每次把区间拆成两个长为 \(2^k\) 区间的并打标记最后 pushdown,\(\Theta(n\log n+q)\) .
Solution 3 离线下来排序就变成区间覆盖,时间倒流并查集维护即可,时间复杂度 \(\Theta(\operatorname{sort}(q)+q\alpha(n))\) .
Solution 4 分块,\(B\) 是块长 . 对于整块的记 \(t_{l,r}\) 表示块 \(l\dots r\) 的标记,最后 pushdown . 对于散块前后缀直接打标记,否则暴力扫 . 因为数据随机所以只有 \(\frac Bn\) 的概率两端点在同一块需要暴力扫,所以这部分的期望时间复杂度是 \(O(B^2)\) 的 . 取 \(B=\sqrt n\) 问题被期望 \(O(n+q)\) 解决 .
仔细思考一下其实只要运算有交换律结合律 Solution 4 就都能跑,哈哈 .
upd. 由乃救爷爷 .
感谢 APJifengc 和一些人 .
一个有趣的事实是,原题的数据生成器质量不高所以直接把 \(q\) 和 \(2\times10^5\) 取 min 即可通过 .
以下是博客签名,正文无关
本文来自博客园,作者:Jijidawang,转载请注明原文链接:https://www.cnblogs.com/CDOI-24374/p/17829981.html
版权声明:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议(CC BY-NC-SA 4.0)进行许可。看完如果觉得有用请点个赞吧 QwQ