摘要: #include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 998244353; struct Node { int l, r; // 区间左右端点 ll sum; // 区间和 ll laz 阅读全文
posted @ 2026-04-07 17:20 majikko 阅读(1) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, int> pli; // {距离, 节点} const ll INF = 1e18; // 邻接表: graph[u] = {{v 阅读全文
posted @ 2026-03-04 15:04 majikko 阅读(6) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; typedef long long ll; const int MOD=1e9+7; struct mat{ll a[2][2];}; ll n; mat mat_mul(mat x,mat y)//矩阵乘法 阅读全文
posted @ 2025-08-14 11:28 majikko 阅读(11) 评论(0) 推荐(0)
摘要: #include <iostream> #include <vector> using namespace std; const int N = 1e5 + 10; int n, q; vector<int> tree[N]; vector<pair<int, int>> queries[N]; / 阅读全文
posted @ 2025-08-13 15:42 majikko 阅读(10) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 10005; int n,m; vector e (N,vector<int>()); vector ne (N,vector<int>()); vector<int>dfn(N) 阅读全文
posted @ 2025-08-10 09:02 majikko 阅读(19) 评论(0) 推荐(0)
摘要: 模板来自https://www.cnblogs.com/pangyou3s/p/18148655#04a 懒标记线段树lazysegmenttree-基础区间修改 注释来自KIMI2 #include <bits/stdc++.h> using namespace std; using i64 = 阅读全文
posted @ 2025-08-09 13:31 majikko 阅读(20) 评论(0) 推荐(0)
摘要: 题面来自牛客:https://ac.nowcoder.com/acm/problem/23482” #include<bits/stdc++.h> using namespace std; const int N = 5e5+10; int n,m,s,a,b; vector<int> e[N]; 阅读全文
posted @ 2025-07-26 18:15 majikko 阅读(7) 评论(0) 推荐(0)
摘要: 题面:https://codeforces.com/problemset/problem/2072/F 求某个数的组合数次幂的异或 由于异或性质,只跟组合数的奇偶有关。 前置知识 杨辉三角形的第i行第j个元素为\(C_i^j\) 卢卡斯定理 (Lucas' Theorem) 对于素数 \(p\) 和 阅读全文
posted @ 2025-07-19 14:48 majikko 阅读(50) 评论(0) 推荐(0)
摘要: 题面来自:https://codeforces.com/problemset/problem/2089/A 知识前提 素数筛(欧拉筛),最小质因数 模板(from jiangly): void sieve(int n) { minp.assign(n + 1, 0); primes.clear(); 阅读全文
posted @ 2025-07-19 10:18 majikko 阅读(21) 评论(0) 推荐(0)