跳到正文

Aurelia_Veil

1717150

&Yore_Snow |给时间时间,让过去过去|phigros rks15.57课题金40,前红45|QQ3884279860

在洛谷打开
资料、奖项与版本

见证历史,hardme小妹妹申诉成功了:https://www.luogu.com.cn/ticket/VWJQ473087

image.png



再不看数据范围把头掀了!!!

WZC=Weights-Zero-shot Learning-Classification=Weight Decay-Zeta-Dropout-Convex Optimization

YYZ=Yokeframe Terminology-Yield Efficiency-Zipped Glossary=Yaw Correction-Yield Consistency-Zero-delay Post-editing

ZYL=Zestless-Yummy Snack-Leisure Break=Zoned-out-Yawn-triggered-Low-key Relax

LYL=Lots of Youthful Liaisons=Lengthy Years of Love connections=Layers of Young Love affairs=Legions of Yummy Liaisons

TYH=Taking Your Hydrating Break=Trivially Yawning through Hydro - Leisure


打比赛电脑不死机那算什么比赛\large \color{blue} 打比赛电脑不死机那算什么比赛 修电脑明明才是OI最有乐趣的一环\large \color{blue} 修电脑明明才是 OI 最有乐趣的一环 为将来的刻板印象以及就业打下坚固的基础\large \color{blue} 为将来的刻板印象以及就业打下坚固的基础
不存在,便是最好的存在\large \color{3498DB}不存在,便是最好的存在 存在过,然后永远沉默,比从未存在更深刻\large \color{3498DB}存在过,然后永远沉默,比从未存在更深刻 当万物沉寂,那无声的轰鸣,便是存在的回响\large \color{3498DB}当万物沉寂,那无声的轰鸣,便是存在的回响 让该走的随风,不存在于当下,便是最好的安排\large \color{3498DB}让该走的随风,不存在于当下,便是最好的安排 有些答案,不求甚解;有些人,不如相忘于江湖\large\color{3498DB}有些答案,不求甚解;有些人,不如相忘于江湖
「海天交际处泛起一抹橘红时」 \color{orange} \large \textup{「海天交际处泛起一抹橘红时」} 「When a touch of orange red appears at the intersection of the sea and sky」 \color{orange} \footnotesize\textup{「When a touch of orange red appears at the intersection of the sea and sky」} 「浪尖最先染上金箔般的光泽」 \color{orange} \large \textup{「浪尖最先染上金箔般的光泽」} 「The wave crest first dyed with a golden foil like luster」 \color{orange} \footnotesize\textup{「The wave crest first dyed with a golden foil like luster」} 「云层像被撕开的棉絮」 \color{orange} \large \textup{「云层像被撕开的棉絮」} 「The clouds are like torn cotton fluff」 \color{orange} \footnotesize\textup{「The clouds are like torn cotton fluff」} 「慵懒地悬浮在穹顶」 \color{orange} \large \textup{「慵懒地悬浮在穹顶」} 「Lazily suspended in the dome」 \color{orange} \footnotesize\textup{「Lazily suspended in the dome」} 「此刻却成了最精巧的调色盘——先是浅金在云隙间流淌」 \color{orange} \large \textup{「此刻却成了最精巧的调色盘——先是浅金在云隙间流淌」} 「At this moment, it has become the most exquisite color palette - first, light gold flows through the gaps between the clouds」 \color{orange} \footnotesize\textup{「At this moment, it has become the most exquisite color palette - first, light gold flows through the gaps between the clouds」} 「继而玫瑰色顺着云絮的褶皱渗透」 \color{orange} \large \textup{「继而玫瑰色顺着云絮的褶皱渗透」} 「Then the rose color seeped through the folds of the cloud fluff」 \color{orange} \footnotesize\textup{「Then the rose color seeped through the folds of the cloud fluff」} 「最后整片天空都燃烧起液态的琥珀光」 \color{orange} \large \textup{「最后整片天空都燃烧起液态的琥珀光」} 「In the end, the entire sky was ablaze with liquid amber light」 \color{orange} \footnotesize\textup{「In the end, the entire sky was ablaze with liquid amber light」} 「夕阳沉坠的姿态优雅而决绝」 \color{orange} \large \textup{「夕阳沉坠的姿态优雅而决绝」} 「The graceful and resolute posture of the sunset sinking」 \color{orange} \footnotesize\footnotesize\textup{「The graceful and resolute posture of the sunset sinking」} 「球体每下移一寸」 \color{orange} \large \textup{「球体每下移一寸」} 「Every inch the sphere moves down」 \color{orange} \footnotesize\textup{「Every inch the sphere moves down」} 「海面就多铺开十里碎金」 \color{orange} \large \textup{「海面就多铺开十里碎金」} 「Spread out ten miles of broken gold on the sea surface」 \color{orange} \footnotesize\textup{「Spread out ten miles of broken gold on the sea surface」} 「波峰与波谷交替编织光的经纬」 \color{orange} \large \textup{「波峰与波谷交替编织光的经纬」} 「Alternating peaks and valleys weave the latitude and longitude of light」 \color{orange} \footnotesize\textup{「Alternating peaks and valleys weave the latitude and longitude of light」} 「浪涌将落日切割成千万枚跳动的鳞片」 \color{orange} \large \textup{「浪涌将落日切割成千万枚跳动的鳞片」} 「The surge cuts the sunset into millions of jumping scales」 \color{orange} \footnotesize\textup{「The surge cuts the sunset into millions of jumping scales」} 「又在破碎的瞬间重新聚合」 \color{orange} \large \textup{「又在破碎的瞬间重新聚合」} 「At the moment of shattering, they reassembled」 \color{orange} \footnotesize\textup{「At the moment of shattering, they reassembled」} 「远处归港的渔船剪影被镀上暗金轮廓」 \color{orange} \large \textup{「远处归港的渔船剪影被镀上暗金轮廓」} 「The silhouette of a fishing boat returning to port in the distance is coated with dark gold outline」 \color{orange} \footnotesize\textup{「The silhouette of a fishing boat returning to port in the distance is coated with dark gold outline」} 「桅杆刺破暮色」 \color{orange} \large \textup{「桅杆刺破暮色」} 「The mast pierces through the twilight」 \color{orange} \footnotesize\textup{「The mast pierces through the twilight」} 「拖曳出细长的光影绸带」 \color{orange} \large \textup{「拖曳出细长的光影绸带」} 「Drag out the slender light and shadow ribbon」 \color{orange} \footnotesize\textup{「Drag out the slender light and shadow ribbon」} 「当夕阳触及海平线时」 \color{orange} \large \textup{「当夕阳触及海平线时」} 「When the sunset touches the horizon」 \color{orange} \footnotesize\textup{「When the sunset touches the horizon」} 「奇迹发生了」 \color{orange} \large \textup{「奇迹发生了」} 「A miracle has occurred」 \color{orange} \footnotesize\textup{「A miracle has occurred」} 「咸涩的海水突然变得温柔」 \color{orange} \large \textup{「咸涩的海水突然变得温柔」} 「The salty seawater suddenly becomes gentle」 \color{orange} \footnotesize\textup{「The salty seawater suddenly becomes gentle」} 「托住那颗燃烧的玛瑙缓缓沉降」 \color{orange} \large \textup{「托住那颗燃烧的玛瑙缓缓沉降」} 「Support the burning agate and slowly settle it」 \color{orange} \footnotesize\textup{「Support the burning agate and slowly settle it」} 「天际线熔化成液态黄金」 \color{orange} \large \textup{「天际线熔化成液态黄金」} 「The skyline melts into liquid gold」 \color{orange} \footnotesize\textup{「The skyline melts into liquid gold」} 「云霞褪去矜持」 \color{orange} \large \textup{「云霞褪去矜持」} 「Clouds fade away from reserve」 \color{orange} \footnotesize\textup{「Clouds fade away from reserve」} 「翻涌成紫红色的浪涛」 \color{orange} \large \textup{「翻涌成紫红色的浪涛」} 「Flipped into purple red waves」 \color{orange} \footnotesize\textup{「Flipped into purple red waves」} 「此刻的海水仿佛获得了呼吸」 \color{orange} \large \textup{「此刻的海水仿佛获得了呼吸」} 「At this moment, the seawater seems to have taken a breath」 \color{orange} \footnotesize\textup{「At this moment, the seawater seems to have taken a breath」} 「随着光晕的涨落起伏」 \color{orange} \large \textup{「随着光晕的涨落起伏」} 「With the fluctuation of the halo」 \color{orange} \footnotesize\textup{「With the fluctuation of the halo」} 「连溅起的浪花都裹着薄暮的胭脂」 \color{orange} \large \textup{「连溅起的浪花都裹着薄暮的胭脂」} 「Even the splashing waves are wrapped in twilight rouge」 \color{orange} \footnotesize\textup{「Even the splashing waves are wrapped in twilight rouge」} 「最后一缕光线消失的刹那」 \color{orange} \large \textup{「最后一缕光线消失的刹那」} 「The moment when the last ray of light disappears」 \color{orange} \footnotesize\textup{「The moment when the last ray of light disappears」} 「整片海洋突然屏住呼吸」 \color{orange} \large \textup{「整片海洋突然屏住呼吸」} 「The entire ocean suddenly held its breath」 \color{orange} \footnotesize\textup{「The entire ocean suddenly held its breath」} 「深蓝像墨水般自东方洇染过来」 \color{orange} \large \textup{「深蓝像墨水般自东方洇染过来」} 「Deep blue flowed from the east like ink」 \color{orange} \footnotesize\textup{「Deep blue flowed from the east like ink」} 「却在天际残留着不肯熄灭的暗红余烬」 \color{orange} \large \textup{「却在天际残留着不肯熄灭的暗红余烬」} 「But there are still dark red embers in the sky that refuse to extinguish」 \color{orange} \footnotesize\textup{「But there are still dark red embers in the sky that refuse to extinguish」} 「海鸟化作疾驰的墨点掠过暮空」 \color{orange} \large \textup{「海鸟化作疾驰的墨点掠过暮空」} 「Seabirds transform into fast-moving ink dots and sweep across the twilight sky」 \color{orange} \footnotesize\textup{「Seabirds transform into fast-moving ink dots and sweep across the twilight sky」} 「翅膀拍碎最后几片暮光」 \color{orange} \large \textup{「翅膀拍碎最后几片暮光」} 「Wings shatter, last few pieces of twilight」 \color{orange} \footnotesize\textup{「Wings shatter, last few pieces of twilight」} 「碎成星星点点的磷火坠入水中」 \color{orange} \large \textup{「碎成星星点点的磷火坠入水中」} 「Scattered into scattered phosphorus flames, they fell into the water」 \color{orange} \footnotesize\textup{「Scattered into scattered phosphorus flames, they fell into the water」} 「咸湿的空气里漂浮着光粒子」 \color{orange} \large \textup{「咸湿的空气里漂浮着光粒子」} 「Light particles float in the salty and humid air」 \color{orange} \footnotesize\textup{「Light particles float in the salty and humid air」} 「像无数微小星辰在睫毛上栖息」 \color{orange} \large \textup{「像无数微小星辰在睫毛上栖息」} 「Like countless tiny stars perched on eyelashes」 \color{orange} \footnotesize\textup{「Like countless tiny stars perched on eyelashes」} 「暮色终于合拢时」 \color{orange} \large \textup{「暮色终于合拢时」} 「When the twilight finally closes」 \color{orange} \footnotesize\textup{「When the twilight finally closes」} 「西天仍留着道淡金色的创口」 \color{orange} \large \textup{「西天仍留着道淡金色的创口」} 「The Western Heaven still has a faint golden wound」 \color{orange} \footnotesize\textup{「The Western Heaven still has a faint golden wound」} 「潮声忽然变得清晰」 \color{orange} \large \textup{「潮声忽然变得清晰」} 「The sound of the tide suddenly became clear」 \color{orange} \footnotesize\textup{「The sound of the tide suddenly became clear」} 「褪去金缕衣的海浪恢复墨蓝本色」 \color{orange} \large \textup{「褪去金缕衣的海浪恢复墨蓝本色」} 「The waves that shed their golden silk robes return to their original ink blue color」 \color{orange} \footnotesize\textup{「The waves that shed their golden silk robes return to their original ink blue color」} 「却仍固执地搬运着残存的微光」 \color{orange} \large \textup{「却仍固执地搬运着残存的微光」} 「But still stubbornly carrying the remaining faint light」 \color{orange} \footnotesize\textup{「But still stubbornly carrying the remaining faint light」} 「当第一颗星子刺破靛蓝天幕」 \color{orange} \large \textup{「当第一颗星子刺破靛蓝天幕」} 「When the first star pierces the indigo blue sky curtain」 \color{orange} \footnotesize\textup{「When the first star pierces the indigo blue sky curtain」} 「海平面已沉入幽蓝梦境」 \color{orange} \large \textup{「海平面已沉入幽蓝梦境」} 「The sea level has sunk into the Blue Dream」 \color{orange} \footnotesize\textup{「The sea level has sunk into the Blue Dream」} 「只有隐约的粼光证明某个辉煌时刻曾真实存在过」 \color{orange} \large \textup{「只有隐约的粼光证明某个辉煌时刻曾真实存在过」} 「Only a faint glimmer proves that a glorious moment truly existed」 \color{orange} \footnotesize\textup{「Only a faint glimmer proves that a glorious moment truly existed」}

网站:

共 53 篇
  1. 生活·游记

    算了还是写个游记吧-CSP2026

    本次 CSP 教你探究出题人的心理。 游记写得有些草。 经历重点加粗处理。 你好。 Day -360 我靠我在考什么。 Day -1 没关系我复习模版,哎,Floyd 的好题,哎我有点忘了,复习一下。 不是为啥是 kij 啊,哦我理解了,但是感觉不会考。(你猜) Day 0 下午…

  2. 生活·游记

    CSP2026游记

    用户表示尚未乘坐过高铁和地铁,计划明年继续尝试。

  3. 题解

    题解:P17723 [SCP-S 2026] 函数 / func

    这道题要求计算所有区间按位或的和以及MEX的特殊贡献。核心思路分为两部分: 按位或总和计算: 对每一位二进制位独立处理。对于第k位,总共有n(n+1)/2个区间,减去该位全为0的区间数(通过统计连续0段长度计算),剩余区间数乘以2^k即为该位的贡献。 MEX贡献统计: 只有当MEX(S)为2的幂时,才会产生额外贡献。对每个k,需统计满足以下条件的区间数量: 区间内所有数的第k位均为0; 区间包含0到2^k-1的所有数。 通过分割数组(以第k位为1的位置为分界),维护队列记录必要值的最后出现位置,确保队首为最小合法左端点,从而计算符合条件的区间数,并乘以2^k累加。 最终答案为两部分的总和,即所有区间的按位或总和加上MEX的特殊贡献。

  4. 题解

    题解:P13391 [GCJ 2010 #1A] Make it Smooth

    该题解针对Google Code Jam 2010第一轮A组题目"Make it Smooth"提出了一种优化动态规划的解法。核心思路是通过将暴力DP的O(nV²)复杂度优化至O(nV logV)。具体方法包括: 状态定义:dp[i][j]表示处理前i个像素时,最后一个保留像素值为j的最小代价 双优化策略: 对删除操作使用ST表实现区间最小值查询,降低时间复杂度 对插入操作采用二进制拆分法,通过2^k步长跳跃处理非整数倍范围的转移 关键技巧:将插入代价预付到删除操作中,简化状态转移方程 最终复杂度:通过上述优化,使算法在256个像素值范围内高效运行,显著提升速度(提交记录显示运行效率很高) 该方法巧妙结合了ST表和二进制拆分技术,在保证正确性的前提下大幅优化了原始DP解法的性能。

    1 赞
  5. 题解

    题解:CF1107D Compression

    本题解针对Codeforces 1107D Compression问题,核心思路是通过最大公约数(GCD)判断矩阵能否被x×x的全同色块划分。关键点如下: 必要条件:若某行或列存在连续相同颜色的段长度无法被x整除,则无法满足x-压缩要求。因分割线需严格位于x的倍数位置,否则会导致块内颜色混杂。 充分条件:当所有行和列的连续段长度均可被x整除时,每个x×x的块内颜色必然一致。行方向无变化确保每行同色,列方向无变化确保每列同色,二者结合可推出整个块同色。 解题方法:计算每行和每列连续段长度的GCD,最终答案为所有行、列GCD的最小值。代码通过遍历矩阵,统计行和列的连续段长度,并逐行逐列计算GCD,最终输出最小的GCD值作为最大可行压缩尺寸。

    1 赞
  6. 个人记录

    个人变量数组名称库

    以下是对代码变量命名和结构体分类的中文总结: 基本变量组 输入变量:n, m, k 通常用于表示输入规模或参数。 数组变量:a, b, c 作为数组主变量,常用于存储数据。 循环变量:i, j, k(若重复则省略)、h, l 用于遍历或索引。 计数与答案:cnt 用于计数,ans 作为答案变量或全局统计量。 指针与标记:top 表示指针、底数或标记点;topl, topr 为双指针左右端点。 编号与索引:tot 用于编号(如DFS序),timer 为时间戳(多用于匈牙利算法)。 子树相关:dfn(DFS序)、low(最小可达DFS序)、siz(子树大小)、dep(深度)、fa(父节点)、son(重儿子)。 图论变量:u, v 表示枚举点及其邻接点;ed 为边数组(如pair结构)。 分块处理:bl, br 为块左右端点下标;bid 表示点所属块。 临时变量:x, y, z 作为输入变量或临时存储;kl 用于循环中的临时变量。 边相关:g, _g 为边数组(正向/反向边);g2 为重建边数组(多用于缩点)。 边界与范围:len 表示输入长度或扫描线线段树的区间长度;maxx, minn 表示最大最小值,maxn, minx 表示次大次小值。 标记数组:f, fv, ff 用于标记;ba 为布尔标记数组。 哈希相关:baser 为哈希底数数组;base 为快速幂变量;mod 为模数。 结构体组 通用结构体:pai 表示二元组(如坐标、状态);sec 表示区间。 线段树相关:tree 为线段树结构;SLStree 为扫描线线段树;Splay, FHQtreap, treap 表示平衡树结构。 边结构体:edge 表示边;coor 表示坐标(如扫描线问题中的点坐标)。 树链剖分:qrylist 查询树链;modilist, modist 修改树链;qrytree, moditree 查询/修改子树。 常量组 空间限制:N, M, K 表示最大空间;SQN, SQM, SQK 为平方根。 空节点:EMP 用于初始化空节点(如树根)。 哈希参数:base 为哈希底数;mod 为哈希模数。 算法专用常量:如 dij, SPFA, floyd 表示最短路算法;topu 表示拓扑排序。 函数名组 通用操作:dfs, bfs 表示深度优先/广度优先搜索;build 用于构建数据结构(如线段树);qry 为查询操作;modify 为修改操作。 标记处理:pushdown 下传标记(线段树);pushup 上传标记(扫描线线段树);merge 合并操作(并查集或线段树)。 初始化函数:_init 全局初始化(如并查集清空);init 局部初始化(如动态开点线段树)。 特定算法:find 用于并查集查找;hasher 计算区间哈希值;getbound 获取上下界;point 格式输出(如

  7. 题解

    题解:CF193C Hamming Distance

    本题解针对Codeforces 193C Hamming Distance问题,通过分析四个字符串的汉明距离约束,采用切片处理策略将问题转化为数学方程组求解。核心思路如下: 变量设定:将字符串转换为0(a)和1(b)的二进制表示,定义七个切片变量t0-t7,分别对应不同字符组合的切片情况。 方程建立:根据汉明距离贡献关系,建立六个方程,通过消元法将t7设为自由变量,推导出其他变量的表达式。 约束条件: 验证a+b-d、a+c-e、b+c-f是否为非负偶数; 检查e+f-a-b、d+f-a-c、d+e-b-c是否为偶数; 确定t7的取值范围:下限为max{0, (a+b-e-f)/2, (a+c-d-f)/2, (b+c-d-e)/2},上限为min{(a+b-d)/2, (a+c-e)/2, (b+c-f)/2}。 解的存在性判断:若下限大于上限则无解,否则取t7的最小值以保证字符串总长度最短。 字符串构造:根据各切片变量的值,按规则生成四个字符串,其中a全为a,其他字符串通过组合不同字符段实现。 代码通过输入六个参数计算各切片变量,若条件不满足则输出-1,否则构造满足约束的最短字符串组合。

    19 赞
  8. 题解

    题解:P2675 《瞿葩的数字游戏》T3-三角圣地

    题解:P2675 《瞿葩的数字游戏》T3 - 三角圣地 不错的题目,代码与题目相互呼应,声光交融,指尖灵动,即使是我,也感到心潮澎湃。 这道题手玩样例或者有经验的人是可以看出来初始的每一个数对“基”的贡献次数。 例如样例,我们通过模拟: 变为: 再变为: 最后变为: 得出贡献次数…

  9. 算法·理论

    个人代码基础模板

    以下是提供的代码内容的中文总结: 欧拉回路:代码实现了一个欧拉回路的判断与构造,通过深度优先搜索(DFS)来寻找起点,并在满足条件时输出路径。代码中处理了入度与出度的差值,确保图中存在欧拉回路。 快读快写:代码展示了多种快速读取和输出的方法,包括使用inline函数和cin.tie(0)等优化手段,以提高输入输出效率。 LCA(最近公共祖先):提供了两种实现方式,一种是倍增法,另一种是树链剖分法。倍增法通过预处理每个节点的2^k级祖先,快速求解LCA;树链剖分法则通过将树划分成链,利用DFS和树的结构特性来实现LCA。 线段树:代码展示了线段树的基本结构和操作,包括构建、查询和更新。线段树用于处理区间查询和更新问题。 树状数组:代码实现了一个树状数组,用于高效处理前缀和与区间更新操作,适用于离散化后的数组。 ST表:用于处理区间最值查询,通过预处理每个区间的最小值,实现快速查询。 动态开点线段树:代码实现了一个动态开点的线段树,用于处理大规模数据,支持动态扩展节点。 可持久化线段树:代码展示了可持久化线段树的实现,支持版本控制,可以查询历史版本的数据。 线段树合并:代码实现线段树的合并操作,用于处理多个线段树的合并问题。 线段树分裂:代码展示了线段树的分裂操作,用于将一个线段树拆分成两个。 多合一快读:代码实现了一个通用的快速读取类,支持多种数据类型的读取,包括整数、浮点数、字符串等。 树链剖分:代码实现树链剖分算法,用于高效处理树上的路径查询与更新操作。 Treap/Splay/FHQ-Treap:代码展示了平衡树的实现,包括Treap、Splay和FHQ-Treap,用于处理动态数据结构中的插入、删除、查找等操作。 斜率优化:代码用于解决动态规划问题,通过斜率优化减少时间复杂度。 四边形不等式优化:代码用于优化动态规划问题,利用四边形不等式性质减少计算量。 高斯消元:代码实现高斯消元法,用于解线性方程组。 矩阵快速幂:代码展示了矩阵快速幂的实现,用于高效计算矩阵的幂次。 扩展中国剩余定理(EXCRT):代码实现扩展中国剩余定理,用于求解同余方程组。 多矩形小工具:代码用于绘制多个矩形的字符画,包括计算画布边界、绘制矩形边框、坐标轴、刻度等。 双哈希:代码实现双哈希算法,用于字符串的快速哈希处理,提高哈希碰撞的概率。

    2 赞
  10. 生活·游记

    【2025 CSP-J/S游记】

    【2025 CSP-J/S游记】 省流:全在发疯。 ::cute-table{tuack} 诅咒祝 CSP-J/S 别考 DP/精度类大模拟/可爱的图/RMQ !!!(不然我会爆掉的) ::cute-table{tuack} 上午 CSP-J T1,第一眼什么鬼?贪心!第二眼秒了…

  11. 题解

    题解:P13141 [GCJ 2018 #1B] Transmutation

    这道题要求通过材料合成获取最多铅的重量,采用二分答案法求解。核心思路是:通过二分查找可能的铅重量,利用深度优先搜索(DFS)递归判断是否能通过材料合成达到目标。具体实现中,每个材料若当前重量不足,则用剩余部分换取所需材料,并递归处理两个子材料。为防止循环依赖导致的无限递归,引入标记数组记录每个材料的使用次数,若超过n次则判定无法合成。代码中通过复制数组状态确保每次判断独立,最终输出最大可行铅重量。

    10 赞
  12. 算法·理论

    浅谈详解莫队算法

    本文详细介绍了莫队算法及其两种主要扩展版本,内容涵盖算法思想、时间复杂度分析及代码实现: 普通莫队:利用分块思想对查询区间进行排序(第一关键字为左端点所在块编号,第二关键字为右端点位置),减少区间移动次数。时间复杂度为 O(N√N),适用于答案更新为 O(1) 的静态区间问题。 带修莫队:引入时间戳维度以处理修改操作。块长调整为 N^2/3,排序增加时间戳关键字。时间复杂度约为 O(N^5/3)。 回滚莫队:针对难以 O(1) 删除元素的情况,采用“只扩不删”策略,在查询结束后回滚左端点状态。时间复杂度为 O(N√M)。 文中各部分均提供了对应的洛谷例题链接及 C++ 参考代码。

    19 赞
  13. 题解

    题解:CF2109C2 Hacking Numbers (Medium Version)

    本文简述了 CF2109C2 的解题策略:利用 9 的倍数特征,先将 x 乘 9,随后进行两次 digit 操作使其变为 9,最后加上 n-9 即可得到目标值。具体操作序列为 mul 9, digit, digit, add n-9。

  14. 题解

    题解:CF2104C Card Game

    本文是 Codeforces 2104C 卡牌游戏的题解。核心思路为分类讨论:若 Alice 持有首尾卡牌、仅 Bob 持有末位卡牌、或 Alice 持有末尾两张卡牌,则 Alice 必胜;其余情况 Bob 必胜。文中包含了具体的 C++ 代码实现。

    1 赞
  15. 题解

    题解:P11777 [COTS 2013] 集合求解 / BOMBONI

    这道题是结论题,答案形式为 2^k - 1(k 为元素分组后的块数)。核心思路是通过集合运算性质证明,将元素按所属集合合并为不可拆分的块,最终答案由块的数量决定。代码中使用位掩码存储每个元素的集合归属,通过排序和去重统计块数,再利用快速幂计算 2^k -1 的值并取模。关键在于将相同集合归属的元素归为一类,块数即为不同归属类别的数量。

    1 赞
  16. 题解

    题解:CF2094D Tung Tung Sahur

    该题解针对Codeforces 2094D题“Tung Tung Sahur”提出以下判断逻辑: 若首个声音不匹配,直接返回NO; 检查声音段数是否一致,顺序相同则段数必须相等; 验证每段长度是否在目标长度的1倍至2倍范围内,否则视为不匹配。 整体思路通过模拟上述条件即可实现,无需提供具体代码。

    4 赞
  17. 题解

    题解:P1001 A+B Problem

    题解:P1001 A+B Problem 正文: 我们一眼可以看出,这是要我们求出一个大小为 114 × 514 的矩阵的和,于是可以使用二维树状数组快速求出答案。 记住这是一个模板题! 我们来讲解一些二维树状数组的写法: 1. 创建树状数组: 直接创建一个大小为 114 × 5…

    19 赞
  18. 题解

    题解:AT_abc193_e [ABC193E] Oversleeping

    本文是针对 AtCoder 题目 ABC193E (Oversleeping) 的题解。 核心思路: 问题建模:将火车停靠城市 B 和人的清醒状态分别转化为关于时间 t 的同余区间条件。 算法策略:利用数据范围中区间长度 Y, Q ≤ 500 的特点,枚举两个区间内的所有可能余数。 求解方法:对每一对余数使用扩展中国剩余定理(EXCRT)求解满足条件的最小非负整数 t。 结果判定:在所有可行解中取最小值,若无解则输出 infinity。 文中最后提供了基于 __int128 类型的 C++ 参考代码。

  19. 题解

    题解:P5499 [LnOI2019] Abbi 并不想研学

    题解:P5499 \[LnOI2019] Abbi 并不想研学 简单题,但是不好调这代码可调四我了。 分析 这公式有点难懂,具体意思是每一个节点的权值为轻儿子重链的权值的和或积,于是我们得知这个节点只会被轻儿子的重链影响,与自身的重儿子重链无直接关联。 1. 操作三 为什么先看操…

  20. 题解

    题解:P13095 炒股高手

    题解:P13095 炒股高手 这道题猜难度出算法,非常简单。 首先别看是指数,但是因为底数相同,因此忽略底数,变为加减问题。 其次我们可以看见,基本上是以小换大,因此,我们可以将问题变为对于每一个 a_i,我们是否将目前的金额 e_x 除以 a_i 再乘 a_i+1,很简单,就是…