随笔分类 -  考试总结

摘要:T1 观察大样例,发现只有两个点被同样的集合包含这两个点一定不能成为单独的集合。 直接哈希,差分即可。 #include<iostream> #include<random> #include<map> #include<algorithm> using namespace std; inline 阅读全文
posted @ 2024-11-04 19:45 bryce_yyds 阅读(24) 评论(0) 推荐(0)
摘要:dream 首先朴素的 \(dp\) 很好想,前缀和优化也很简单,接下来考虑如何继续优化。 我们发现反转操作相当于把一个序列变成环反转后再移动几格,于是我们只需要知道 \(1\) 位置的变换就能知道其它位置数的变换。 #include<iostream> #define int long long 阅读全文
posted @ 2024-11-01 21:44 bryce_yyds 阅读(13) 评论(0) 推荐(0)
摘要:T1 我们发现 \(1\) 其实根本没有用,只和一个连通块里的 \(0\) 的个数有关,直接 \(dfs\),判断即可。 #include<iostream> #include<cstring> using namespace std; inline int read(){register int 阅读全文
posted @ 2024-11-01 21:37 bryce_yyds 阅读(22) 评论(0) 推荐(0)
摘要:T1 状压 \(dp\),两两之间有相同的位,那一位就为 \(1\),否则就为 \(0\),考虑哪些选法不合法,要在 \(0\) 的位上为 \(1\),即只在 \(1\) 上选和不选都是不可以的,于是状压 \(dp\) 即可。 #include<iostream> #define int long 阅读全文
posted @ 2024-11-01 21:27 bryce_yyds 阅读(15) 评论(0) 推荐(0)
摘要:T1 考虑从后往前去做,随机化字母权值,考虑两个字符,一个设为正的权值,一个设为负的权值,两两就可以抵消,若有一个后缀权值等于另一个后缀权值且长度为偶数,就肯定有一个回文串,若有一个后缀权值等于另一个后缀权值加减一个字母的权值且长度为奇数,就也肯定有一个回文串,存下来,离散化即可。 #include 阅读全文
posted @ 2024-11-01 20:49 bryce_yyds 阅读(41) 评论(0) 推荐(0)
摘要:T1 建边,发现要找偶环,但两个奇环也可以拼在一起,于是按照上面的思路模拟即可。 但是挂了一个点,不知道为啥。 #include<iostream> #include<vector> #include<cstring> using namespace std; inline int read(){r 阅读全文
posted @ 2024-11-01 20:27 bryce_yyds 阅读(39) 评论(0) 推荐(0)
摘要:true 40pts 设 \(dp_{i, j, k}\) 表示第 \(i\) 个左端点为 \(j\),右端点为 \(k\) 的方案数,转移很好想,暴力枚举合法的 \(l, r\) 转移,由于空间开不下,选择用滚动数组优化一维,时间复杂度 \(O(nm^4)\)。 70pts 考虑在什么条件下才能够 阅读全文
posted @ 2024-10-15 21:37 bryce_yyds 阅读(13) 评论(0) 推荐(0)
摘要:126 带权平均数之和 枚举区间长度然后拆贡献简单计算。 #include<iostream> #define int long long using namespace std; inline int read(){ register int x = 0, f = 1; register char 阅读全文
posted @ 2024-10-15 20:07 bryce_yyds 阅读(14) 评论(0) 推荐(0)
摘要:number 从考虑使用多少个加和减入手,简单计算。 #include<iostream> #define int long long using namespace std; inline int read(){register int x = 0, f = 1;register char c = 阅读全文
posted @ 2024-10-15 19:39 bryce_yyds 阅读(11) 评论(0) 推荐(0)
摘要:总分 \(400 pts\),得分为 \(40 pts\),鉴定为史上最菜的 Oier。 card 每次修改相当于添加一个数和删除一个数,考虑添加一个数,如果覆盖的区间没有其他的,则自己不用修改,如果有,就需要修改,如果覆盖区间超过了自己数值,则超出的部分都需要修改。 #include<iostre 阅读全文
posted @ 2024-08-20 17:31 bryce_yyds 阅读(27) 评论(1) 推荐(0)
摘要:这次考试太烂了,又没考过 Diavolo。 T1 简单的入门题,先热身。 #include<iostream> #define int long long #define N 5001 using namespace std; int n, ans; double a[N]; int t[N]; s 阅读全文
posted @ 2022-08-19 20:20 bryce_yyds 阅读(61) 评论(0) 推荐(0)