上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: A. o-padding code #include<bits/stdc++.h> using namespace std; int main(){ int n; string s,pre = ""; cin >> n >> s; for(int i = s.size()+1; i <= n; ++ 阅读全文
posted @ 2025-12-23 10:46 ricky_lin 阅读(33) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
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 阅读(55) 评论(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 阅读(135) 评论(0) 推荐(0)
摘要: B. Basic Graph Algorithm 如果说一个点的相邻节点都走完了,就返回 如果没走完,并且排列中下一个位置和它相邻,就走;如果不相邻,就加边 需要注意的是,对于每一个点的相邻点用 \(vector\) 存储,并且需要按出点在给出排列中的顺序排序,以保证时间复杂度 code #incl 阅读全文
posted @ 2025-10-14 17:29 ricky_lin 阅读(341) 评论(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 阅读(56) 评论(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 阅读(188) 评论(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 阅读(51) 评论(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 阅读(58) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页