09 2024 档案
摘要:The 2024 CCPC Online Contest 补题连接:https://codeforces.com/gym/105336 D. 编码器-解码器 考虑dp, 表示 的子串 (下标 到下标 )在 \(S_{i}
阅读全文
摘要:The 2024 Shanghai Collegiate Programming Contest 补题连接:https://codeforces.com/gym/105229 M. 不共戴天 观察样例2,注意到6个荷叶两两分成一组,共分为3组 (1,2)(3,4)(5,6) 其中对于青蛙的策略是组内
阅读全文
摘要:计算机网络 总分100 = 期中20 + 期末50 + 实验20 + 平时10 (期中考前三章,期末考后三章) 第一章 概述 1.1 互联网两个重要基本特点:连通性、共享 连通性:上网用户交换各种信息 共享:指资源共享,可以是信息共享、软件共享、硬件共享 1.2 网络把许多计算机连接在一起,互连网把
阅读全文
摘要:数学知识:https://blog.sengxian.com/algorithms/linear-basis 题单:https://www.luogu.com.cn/training/11251#information 线性基用于解决最大异或和问题等 题目: J:https://codeforces
阅读全文
摘要:题目: AcWing 830. 单调栈:https://www.acwing.com/problem/content/832/ 单调栈 + 并查集: AcWing 1275. 最大数:https://www.acwing.com/problem/content/1277/ B:https://cod
阅读全文
摘要:The 8th Hebei Collegiate Programming Contest 补题连接:https://codeforces.com/gym/105184 A. Update #include <bits/stdc++.h> using namespace std; int main()
阅读全文
摘要:思路题,set有序,lower_bound(a)可以二分寻找set中最接近的大于等于它的数 #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; set<int> s; for(int i = 1; i
阅读全文
摘要:使用 set_intersection() 判断两个集合之间重复元素,时间复杂度最坏O(nlogn),最好O(n) #include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<s
阅读全文
摘要:占位符不要用%#*^之类的,测试点5和7会被卡 #include <bits/stdc++.h> using namespace std; void print(string s) { for(auto si : s) if(si == '{') cout << "<censored>"; else
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; string func(string s, int x, int y, string s1, string s2) { x--,y--; string mid(s,x,y-x+1); s.erase(x,y-
阅读全文
摘要:测试点5是混过去的,已知测试点5只涉及大小写转换,n=3,第一个句子长度为奇数 #include <bits/stdc++.h> using namespace std; bool is_biaodian(char c) { if(c >= 'a' && c <= 'z' || c >= 'A' &
阅读全文
摘要:代码1:剪枝,非打表 #include <bits/stdc++.h> using namespace std; int l, n; const int N = 5; int arr[N * N]; int H[N], L[N]; int dfs(int x) { if(x >= n * n) {
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; string s; bool is_hui(int x, int y) { while(x < y) { if(s[x] != s[y]) return false; ++ x, -- y; } return
阅读全文