上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: 占位符不要用%#*^之类的,测试点5和7会被卡 #include <bits/stdc++.h> using namespace std; void print(string s) { for(auto si : s) if(si == '{') cout << "<censored>"; else 阅读全文
posted @ 2024-09-04 19:20 Frodnx 阅读(134) 评论(0) 推荐(0)
摘要: #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- 阅读全文
posted @ 2024-09-03 15:30 Frodnx 阅读(28) 评论(0) 推荐(0)
摘要: 测试点5是混过去的,已知测试点5只涉及大小写转换,n=3,第一个句子长度为奇数 #include <bits/stdc++.h> using namespace std; bool is_biaodian(char c) { if(c >= 'a' && c <= 'z' || c >= 'A' & 阅读全文
posted @ 2024-09-03 14:06 Frodnx 阅读(32) 评论(0) 推荐(0)
摘要: 代码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) { 阅读全文
posted @ 2024-09-03 11:08 Frodnx 阅读(128) 评论(0) 推荐(0)
摘要: #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 阅读全文
posted @ 2024-09-02 15:18 Frodnx 阅读(14) 评论(0) 推荐(0)
摘要: 模拟过程走一遍即可 #include <bits/stdc++.h> using namespace std; const int N = 110; int M[N]; #define x first #define y second int main() { int n; cin >> n; in 阅读全文
posted @ 2024-08-31 20:26 Frodnx 阅读(19) 评论(0) 推荐(0)
摘要: 硬写的 // 我也不知道多长时间了,估计有40min #include <bits/stdc++.h> using namespace std; const int N = 50; int hou[N], zhong[N]; class Node { public: int val; int wei 阅读全文
posted @ 2024-08-31 19:15 Frodnx 阅读(13) 评论(0) 推荐(0)
摘要: 并查集 int p[N]; // 储存祖宗节点 int cnt[N]; // 用于统计集合元素个数 bool flag[N]; // 储存节点是否出现 init函数 void init() { for(int i = 1; i <= N; ++ i) { p[i] = i; cnt[i] = 1; 阅读全文
posted @ 2024-08-31 16:49 Frodnx 阅读(15) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; // 分别为祖宗节点,人数,房子数,总面积 int p[N], cnt[N], fangzi[N], totalarea[N], minnum[N]; // 编 阅读全文
posted @ 2024-08-30 22:16 Frodnx 阅读(11) 评论(0) 推荐(0)
摘要: 基础款并查集练习题 // 13'11" #include <bits/stdc++.h> using namespace std; const int N = 1e4 + 10; int p[N], f[N]; void init() { for(int i = 1; i <= N; ++ i) p 阅读全文
posted @ 2024-08-29 22:22 Frodnx 阅读(10) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 13 下一页