上一页 1 2 3 4 5 6 ··· 8 下一页
该文被密码保护。 阅读全文
posted @ 2025-11-11 10:05 ricky_lin 阅读(30) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2025-11-02 16:28 ricky_lin 阅读(9) 评论(0) 推荐(0)
摘要: B. Queue Sorting tag: Dilworth DP 我们可以发现,我们将原序列建图,让小的在前面的数连向大的在后面的数,那么我们就可以将问题转化为:求图中的最小链覆盖是否 \(\leq 2\) 然后我们接着使用 Dilworth 定理,就变成了判断最长反链是否 \(\leq 2\) 阅读全文
posted @ 2025-10-28 14:07 ricky_lin 阅读(41) 评论(0) 推荐(0)
摘要: A. An Easy Geometry Problem tag: 二分Hash 我们令 \(A_i' = A_i - i\times \frac k 2\) 那么我们可以发现: \( \begin{aligned}A_{i+r}' - A_{i-r}' &= A_{i+r} - (i+r)\time 阅读全文
posted @ 2025-10-21 11:33 ricky_lin 阅读(94) 评论(0) 推荐(0)
摘要: B. Basic Graph Algorithm 如果说一个点的相邻节点都走完了,就返回 如果没走完,并且排列中下一个位置和它相邻,就走;如果不相邻,就加边 需要注意的是,对于每一个点的相邻点用 \(vector\) 存储,并且需要按出点在给出排列中的顺序排序,以保证时间复杂度 code #incl 阅读全文
posted @ 2025-10-14 17:29 ricky_lin 阅读(255) 评论(0) 推荐(1)
摘要: A Circle of Apple Trees 即求有多少种大小不同的数 code #include<bits/stdc++.h> using namespace std; const int NN = 108; int t,n; int a[NN]; void solve(){ memset(a, 阅读全文
posted @ 2025-10-11 16:17 ricky_lin 阅读(38) 评论(0) 推荐(0)
摘要: A. OS Versions code #include<bits/stdc++.h> using namespace std; string s; int x,y; int main(){ cin >> s; if(s[0] == 'O') x = 0; else if(s[0] == 'S') 阅读全文
posted @ 2025-10-05 07:48 ricky_lin 阅读(178) 评论(0) 推荐(0)
摘要: A. Be Positive code #include<bits/stdc++.h> using namespace std; const int NN = 1e4; int T; int n,a[NN]; int cnt1,cnt2; void solve(){ cnt1 = cnt2 = 0; 阅读全文
posted @ 2025-10-05 07:40 ricky_lin 阅读(36) 评论(0) 推荐(0)
摘要: A. Sigma Cubes code #include<bits/stdc++.h> using namespace std; int n; int main(){ cin >> n; int ans = 0; for(int i = 1; i <= n; ++i){ ans += ((i&1)? 阅读全文
posted @ 2025-09-28 16:04 ricky_lin 阅读(41) 评论(0) 推荐(0)
摘要: 通常的,我们被给到一个函数在一些点上的值,我们可以用高斯消元在 \(O(n^3)\) 的时间复杂度内求出对应的多项式 当我们只被要求求出其中的的一个点时,我们可以使用插值这个工具在 \(O(n^2)\) 的时间复杂度之内求解。 一、拉格朗日插值 1. 算法原理 我们现在的目标是构造一个多项式,使得带 阅读全文
posted @ 2025-09-21 11:00 ricky_lin 阅读(13) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 8 下一页