摘要: 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 阅读(51) 评论(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 阅读(38) 评论(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 阅读(20) 评论(0) 推荐(0)
摘要: P13680 [IAMOI R2] 未送出的花 发现一定是大根堆,这个题解讲的好 考虑使用调整法,假设现在有一个儿子的盛开度大于父亲的盛开度,现在尝试交换儿子和父亲的盛开度: 对于儿子的子树中的节点,根到它们的路径的盛开度序列不变,美丽值不发生变化。 对于父亲子树中且非儿子子树中的节点,根到它们的路 阅读全文
posted @ 2025-08-17 16:59 arin876 阅读(20) 评论(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)
摘要: 补给 可以O(n^2)做,枚举豁免量 #include<bits/stdc++.h> #define int long long using namespace std; const int N=1010; struct Node{ int p,s; }node[N]; bool cmp(Node 阅读全文
posted @ 2025-08-10 11:56 arin876 阅读(11) 评论(0) 推荐(0)
摘要: Matiji 每个都可以选或不选(丢给小号),直接dp #include<bits/stdc++.h> using namespace std; const int N=200010; int f[N][2]; int n,s; int p[N]; int main( ) { std::ios::s 阅读全文
posted @ 2025-08-10 11:22 arin876 阅读(112) 评论(0) 推荐(0)
摘要: 星际航行 经典结论,距离之和sum(|xi-t|)到中位数最小 至于要排成等差,i要到的位置为t+i,要求sum(|xi-(t+i)|)=sum(|xi-i-t|)减掉i之后就又是中位数了 或者三分也可以 #include<bits/stdc++.h> #define int long long u 阅读全文
posted @ 2025-08-08 19:45 arin876 阅读(17) 评论(0) 推荐(0)
摘要: 第五维度 枚举ban掉的人,可以二分得到此时人们理解第五维度的时间 ans选最久的时间即可 #include<bits/stdc++.h> using namespace std; #define int long long #define ll long long const int N=1000 阅读全文
posted @ 2025-08-07 16:52 arin876 阅读(12) 评论(0) 推荐(0)
摘要: cat学乘法 #include<bits/stdc++.h> using namespace std; #define int long long int n; int a[200010]; /* 10 5 -1 -2 -3 0 1 */ signed main( ) { std::ios::syn 阅读全文
posted @ 2025-08-06 18:02 arin876 阅读(26) 评论(0) 推荐(0)