会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
msjing
hzoi2025_sbmqwm
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
16
下一页
2026年6月19日
计算一个数的2进制数中1的个数
摘要: woclowbit太好用了你们知道吗 int lowbit(int x) {return x&(-x);} int count(int x) { int cnt=0; while (x) x-=lowbit(x),cnt++; return cnt; }
阅读全文
posted @ 2026-06-19 10:24 msjing
阅读(7)
评论(0)
推荐(0)
2026年6月16日
loj #10222. 「一本通 6.5 例 4」佳佳的 Fibonacci 题解
摘要: 达飞舞被n拿下了 题之跳转 我不会告诉你这是链接 solve 非常神奇的题,huge讲了所以写题解加深记忆 Fibonacci都会,Fibonacci的矩阵求法可以看我之前写的板子 考虑一下怎么解决题目要求 观察到\(T(n)\)呈现阶梯式,正难则反,考虑用整体减局部 —— huge 所以我们尝试把
阅读全文
posted @ 2026-06-16 22:12 msjing
阅读(26)
评论(0)
推荐(0)
2026年6月6日
P3979 遥远的国度 题解
摘要: 我不会告诉你我把min写成max然后到处求助的 solve 观察题目,行了终于不是边权了 树剖区间改查最小+换根 一有换根就很费劲诶 开始考虑换根 如何简化呢,每次换显然不行,我们可以假定一个点为根剖树然后根据输入来做决策 考虑三种情况 现在的根正好是查的根,直接输cout << query(1,1
阅读全文
posted @ 2026-06-06 16:58 msjing
阅读(15)
评论(0)
推荐(0)
[国家集训队] 旅游 题解
摘要: 从上午打到下午,甚至直接重构了一遍 solve 有如下需要做的 单点修 区间取反(?) 区间求最大&&最小&&和 发现涉及带修区间问题,考虑线段树 在一棵树上处理显然很费劲,直接祭出top tree树剖 然后就没了 0为根,那么直接给点都++ 应该没有唐必把要修的值++并把边的输入顺序++的吧 应该
阅读全文
posted @ 2026-06-06 13:49 msjing
阅读(16)
评论(0)
推荐(0)
2026年6月5日
神秘缺省源
摘要: #include<bits/stdc++.h> using namespace std; constexpr int maxn=; int read() { int x=0,f=1; char ch=getchar(); while (ch<'0' || ch>'9') { if (ch == '-
阅读全文
posted @ 2026-06-05 11:37 msjing
阅读(13)
评论(0)
推荐(0)
文件比较
摘要: #include <bits/stdc++.h> using namespace std; int main() { if (system("fc xx.out xxx.out")) return 0; return 0; }
阅读全文
posted @ 2026-06-05 10:58 msjing
阅读(13)
评论(0)
推荐(0)
2026年6月4日
矩阵乘&矩阵快速幂
摘要: 乘 #include<bits/stdc++.h> #define Honkai ios::sync_with_stdio(0); #define StarRail cin.tie(0);cout.tie(0); #define endl '\n' using namespace std; cons
阅读全文
posted @ 2026-06-04 21:54 msjing
阅读(12)
评论(0)
推荐(0)
2026年6月2日
Garsia–Wachs算法解决石子合并
摘要: 前排提示: 本文并非题解,仅放在题解夹里,若想了解Garsia–Wachs算法原理请跳转:oi_wiki 关于题库有道四边形不等式的题但是无法通过四边形不等式解决 P5569 我们先写\(n^2\) #include<bits/stdc++.h> #define endl '\n' using na
阅读全文
posted @ 2026-06-02 11:34 msjing
阅读(10)
评论(0)
推荐(0)
2026年5月31日
重链剖分
摘要: 码量浅压170行,线段树码量大 点击查看代码 #include<bits/stdc++.h> #define endl '\n' #define lson (rt<<1) #define rson (rt<<1|1) using namespace std; constexpr int maxn=1
阅读全文
posted @ 2026-05-31 18:13 msjing
阅读(7)
评论(0)
推荐(0)
随笔密码
摘要: msjing的真实姓名首拼
阅读全文
posted @ 2026-05-31 10:23 msjing
阅读(13)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
11
12
···
16
下一页
公告