上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: 这道题目应该是hard 要掌握枚举一个字符串中长度小于等于len的所有子序列,需要使用位运算 使用legal来保存第i个字符串(不包括本身)以前所有的公共子序列,再用temp来存储包括第i个字符串的所有公共子序列, 然后用legal = temp来更新legal,并记得对temp清空 #includ 阅读全文
posted @ 2026-02-27 02:32 peter_shen 阅读(8) 评论(0) 推荐(0)
摘要: 这道题有2000个样例的话,N3的话会时间超限,需要想到用距离来判断外心。现在复杂度是n2 但想到上面这点,写的时候,会出现忘记考虑最后一次的ans+= k(k-1)(k-2)/6;比如 点a到最后4个点的距离都相等,但可能忘加了 #include <bits/stdc++.h> using nam 阅读全文
posted @ 2026-02-27 00:38 peter_shen 阅读(7) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; char c[20]; int a[20]; int b[20]; bool judge(int num){ if(num==0){ return b[0]; } while(num){ if(b[num%1 阅读全文
posted @ 2026-02-27 00:05 peter_shen 阅读(6) 评论(0) 推荐(0)
摘要: ![785af7970de806e25ec9d70b05193239_720](https://img2024.cnblogs.com/blog/3767772/202602/3767772-20260226161845493-826958047.png) ![image](https://img2024.cnblogs.com/blog/3767772/202602/3767772-202602 阅读全文
posted @ 2026-02-26 16:19 peter_shen 阅读(6) 评论(0) 推荐(0)
摘要: 使用单调栈 #include <bits/stdc++.h> using namespace std; const int N=1000000+10; int a[N]; int ans[N]; stack<int> s; int main(){ int n; scanf("%d",&n); for 阅读全文
posted @ 2026-02-26 03:25 peter_shen 阅读(8) 评论(0) 推荐(0)
摘要: 这道题目使用了单调队列,并且保证了队尾与队首总在m之间,这样队首永远都是队尾的前面m-1个元素中的最小值。单调队列存储的是前缀和数组的索引 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N= 阅读全文
posted @ 2026-02-26 03:03 peter_shen 阅读(13) 评论(0) 推荐(0)
摘要: 这道题使用了字符串哈希,模数为ull自然溢出 #include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; const int N=1e6+10, base=23333; ull hs1[N],hs2,pw 阅读全文
posted @ 2026-02-26 01:38 peter_shen 阅读(9) 评论(0) 推荐(0)
摘要: 重复子序列的时候,判断now是否回到起点,来确定重复了几次,使用了序列自动机 #include <bits/stdc++.h> using namespace std; const int N =100000+10; char a[N],b[N]; int next1[N][26]; int mai 阅读全文
posted @ 2026-02-26 01:03 peter_shen 阅读(7) 评论(0) 推荐(0)
摘要: 如果encoder提取出来的特征能够decoder出来的数据与原始数据非常相似,这意味着encoder提取数据很厉害 生成式自监督拿自己的数据,通过mask比如去掉图片的一部分像素,改成灰度图,或者文本mask掉一些字,来训练特征提取器的能力,这样训练出来的提取器直接加一个分类头就可以进行分类了。 阅读全文
posted @ 2026-02-26 00:01 peter_shen 阅读(10) 评论(0) 推荐(0)
摘要: 使用了序列自动机,next[i][j]表示主串第i个位置及其之后最近的字母j的索引 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; char s[N], t[N]; int next1[N][26]; int mai 阅读全文
posted @ 2026-02-25 01:47 peter_shen 阅读(11) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页