摘要: #include<bits/stdc++.h> using namespace std; vector<string> v; bool cmp(string a,string b) { return a + b > b + a; } int main() { int n; cin>>n; for ( 阅读全文
posted @ 2025-06-19 22:54 Guaninf 阅读(3) 评论(0) 推荐(0)
摘要: 题意 多次查询在字符串中是否存在某子序列 思路 子序列自动机的模板题 代码 #include<bits/stdc++.h> using namespace std; inline int read() { int ans = 0, f = 1; char ch = getchar(); while 阅读全文
posted @ 2025-06-19 17:31 Guaninf 阅读(9) 评论(0) 推荐(0)
摘要: 题意 n个同学 , 学号为1-n 今天来了n-1/n-2个同学 , 问哪些同学没来 思路 对于n-1个同学 , 异或即可 对于n-2个同学 , 异或后结果中 , 为1的地方特殊 , 意味着两个人的学号在此处不同 那么可以将1-n分为两类 , 从而再次使用第一种方法求解 如何找到某个为1的地方呢 ? 阅读全文
posted @ 2025-06-19 17:20 Guaninf 阅读(5) 评论(0) 推荐(0)
摘要: 学习使用bitset , 记录所有和点相连的点 代码 #include<bits/stdc++.h> using namespace std; inline int read() { int ans = 0, f = 1; char ch = getchar(); while (ch < '0' | 阅读全文
posted @ 2025-06-19 17:09 Guaninf 阅读(3) 评论(0) 推荐(0)
摘要: 题意 给定一个矩形 , 每次点击一个方块会反转周围5个方块 , 求能否经过反转达到给出的情况 思路 调试了很久很久... 第一个wa : 在for循环嵌套时 , 把一个外部的写到内部了 第二个wa : 忘记v中存储的是char类型了 , 直接做了异或运算 第三个wa : 忘记更新pre的值了 第四个 阅读全文
posted @ 2025-06-19 14:27 Guaninf 阅读(10) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int mp[39]; int main() { string s; cin>>s; int cnt = 0; int ans = 0x3f3f3f3f; int n = s.length(); for (in 阅读全文
posted @ 2025-06-19 10:28 Guaninf 阅读(34) 评论(0) 推荐(0)
摘要: 代码 #include<bits/stdc++.h> using namespace std; int mp[39]; int main() { string s; cin>>s; int cnt = 0; int ans = 0x3f3f3f3f; int n = s.length(); for 阅读全文
posted @ 2025-06-19 10:25 Guaninf 阅读(9) 评论(0) 推荐(0)
摘要: 思路 针对边界问题还是容易错 以后如果能维护闭区间就维护闭区间 , 对于到达下一个状态才能知道当前状态最优的情况也更好考虑 代码 #include<bits/stdc++.h> using namespace std; #define int long long int inline int rea 阅读全文
posted @ 2025-06-19 10:02 Guaninf 阅读(7) 评论(0) 推荐(0)
摘要: 6月16日-6月22日 周五6-20 牛客练习赛141 周六6-21 22:30-0:00 第159场leetcode周赛 周六6-21 22:35-1:05 Codeforces Round 1033 Div.1 + Div.2 周日6-22 10:30-12:00 第455场leetcode周赛 阅读全文
posted @ 2025-06-19 09:55 Guaninf 阅读(7) 评论(0) 推荐(0)