摘要: L.龙之研习 积累多闰年 #include<bits/stdc++.h> using namespace std; #define int long long int k; bool check(__int128 x){ __int128 s=0; for(__int128 i=4;i<=x;i*= 阅读全文
posted @ 2025-08-29 18:44 arin876 阅读(30) 评论(0) 推荐(0)
摘要: L. Stella 简单比较 D. Distributed System 学习积累了差分有头尾两截的情况 #include<bits/stdc++.h> using namespace std; #define ll long long #define int long long const int 阅读全文
posted @ 2025-08-28 00:00 arin876 阅读(2) 评论(0) 推荐(0)
摘要: I. Essentially Different Suffixes 字符串hash或者tire树 #include<bits/stdc++.h> using namespace std; int tr[300010][30];int cnt[300010]; int idx=0;int ans=0; 阅读全文
posted @ 2025-08-26 20:54 arin876 阅读(81) 评论(0) 推荐(0)
摘要: D.Two Divisors #include<bits/stdc++.h> using namespace std; const int N=500010; int n; int a[N]; int b[N];int c[N]; const int V=10000010; int lp[V];in 阅读全文
posted @ 2025-08-25 00:48 arin876 阅读(15) 评论(0) 推荐(0)
摘要: D.Lucky Chains gcd=差分gcd gcd(x+k,y+k)=gcd(x+k,y-x) 也就要找最小的k,使a=gcd(x+k,y-x)!=1 这个里面y-x是固定的,枚举y-x的约数a,求min{a-x%a}。只需要枚举y-x的质因数a,因为%b0必然有%b的约数0 #include 阅读全文
posted @ 2025-08-24 09:04 arin876 阅读(14) 评论(0) 推荐(0)
摘要: D.2025 M.川陀航空学院 J.Ring Trick H.树论函数 结论题,所有点连通 G.直径与最大独立集 F.幻形之路 起点能到达的点b设为1,终点能到达的点b设为2 现在整个图最多有三块,按顺序一块1一块0一块2,走的时候分别判断 #include<bits/stdc++.h> using 阅读全文
posted @ 2025-08-23 15:46 arin876 阅读(62) 评论(0) 推荐(0)
摘要: P13556 【MX-X15-T3】画圈圈 太赤石了 \(k=2\)时,比较典的是白色方格和黑色方格的数量是\(\lfloor \frac{mn}{2} \rfloor\)和\(\lceil \frac{mn}{2} \rceil\) 连通块的个数=白色格子的个数=\(\lfloor \frac{m 阅读全文
posted @ 2025-08-19 21:45 arin876 阅读(44) 评论(0) 推荐(0)
摘要: P13594 『GTOI - 1A』Bath 贪心,维护当前区间,当不能合法时就调整一次 #include<bits/stdc++.h> #define ft first #define se second using namespace std; #define int long long con 阅读全文
posted @ 2025-08-17 19:30 arin876 阅读(23) 评论(0) 推荐(0)
摘要: P13680 [IAMOI R2] 未送出的花 发现一定是大根堆,这个题解讲的好 考虑使用调整法,假设现在有一个儿子的盛开度大于父亲的盛开度,现在尝试交换儿子和父亲的盛开度: 对于儿子的子树中的节点,根到它们的路径的盛开度序列不变,美丽值不发生变化。 对于父亲子树中且非儿子子树中的节点,根到它们的路 阅读全文
posted @ 2025-08-17 16:59 arin876 阅读(23) 评论(0) 推荐(0)
摘要: 叠砖块 差分 #include<bits/stdc++.h> using namespace std; const int N=1000010; int b[N];int a[N]; int n,k; int main(){ std::ios::sync_with_stdio(false);cin. 阅读全文
posted @ 2025-08-10 12:17 arin876 阅读(27) 评论(0) 推荐(0)