会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
gbrrain
博客园
首页
新随笔
联系
订阅
管理
2025年10月12日
2025国庆dp
摘要: 经典例题 摆渡车 设fi表示i这个时刻发车最小答案,枚举上一次发车的时间j,容易转移 但这是O(t^2) 考虑优化 1.斜率优化 2.发现n,m<t,设计fi这种状态很浪费 优化1:若两次发车间隔>2m,完全可以再发一辆车,于是复杂度O(tm) 优化2:若某次发车之前的m个时刻内都没有人,这个点是废
阅读全文
posted @ 2025-10-12 12:20 gbrrain
阅读(6)
评论(0)
推荐(0)
2025年10月8日
2025国庆Day7
摘要: 模拟赛 T1 将所有ai=bi的数取出来 这些数的mex即为答案 然后对于每个i,判定ai,bi是否等于答案 相当于固定某些位置 答案就是2^cnt cnt是没被固定的位置的数量 #include<iostream> #include<cstdio> #include<cstdlib> #inclu
阅读全文
posted @ 2025-10-08 16:04 gbrrain
阅读(5)
评论(0)
推荐(0)
2025年10月7日
2025国庆Day6
摘要: 模拟赛 T1 枚举每个点 直接对每个ai%r 再考虑区间减 判断是否有剩余即可 #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #i
阅读全文
posted @ 2025-10-07 18:52 gbrrain
阅读(10)
评论(0)
推荐(0)
2025年10月6日
2025国庆Day5
摘要: 模拟赛 T1 枚举b3 n^2 处理出a_b1^a_b2=x的所有情况(满足b2<i) 然后枚举b4,计算答案 #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #inclu
阅读全文
posted @ 2025-10-06 20:15 gbrrain
阅读(21)
评论(0)
推荐(0)
2025年10月5日
2025国庆Day4
摘要: 模拟赛 T1 简单做法: 发现本题所有运算全是加法 直接记录c,s之和 转移即可 #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #
阅读全文
posted @ 2025-10-05 17:13 gbrrain
阅读(14)
评论(0)
推荐(0)
2025年10月4日
2025国庆Day3
摘要: 模拟赛 T1 对每个ai开个桶分别算答案即可 注意long long #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #includ
阅读全文
posted @ 2025-10-04 17:18 gbrrain
阅读(23)
评论(0)
推荐(0)
2025年10月3日
2025国庆Day2
摘要: 模拟赛 T1 简单题 离散化+差分即可 或者直接贪心 对可能成为答案的点计算删的区间并取min #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algor
阅读全文
posted @ 2025-10-03 14:50 gbrrain
阅读(7)
评论(0)
推荐(0)
2025年10月2日
2025国庆Day1
摘要: 模拟赛 T1 对h离散化,枚举x,分类讨论某些位置淹没后段的个数的变化情况即可 可恶的毒瘤出题人竟然造了一个高度全0的hack 注意特判此时答案为0 #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #in
阅读全文
posted @ 2025-10-02 19:01 gbrrain
阅读(4)
评论(0)
推荐(0)
2025年8月23日
pyyzDay18
摘要: 模拟赛(掉大分) T1 [KOI 2022 Round 1] 鹅卵石 大炮预处理 T2 [POI 2018 R2] 自行车道 Bike paths 缩点板子+树形DP #include<bits/stdc++.h> using namespace std; #define int long long
阅读全文
posted @ 2025-08-23 17:23 gbrrain
阅读(5)
评论(0)
推荐(0)
2025年8月22日
pyyzDay17
摘要: [NOIP2022] 建造军营 从部分分入手 缩点+超级大炮 [ZJOI2004] 嗅探器 将割点条件改一改即可 #include<bits/stdc++.h> using namespace std; #define int long long struct Node{ int nex,to; }
阅读全文
posted @ 2025-08-22 10:28 gbrrain
阅读(3)
评论(0)
推荐(0)
下一页
公告