盐盐

可能是你能找到的最全的关于约瑟夫环的一切

可能是你能找到的最全的关于约瑟夫环的一切 Reference https://blog.csdn.net/u011500062/article/details/72855826 https://www.cnblogs.com

最小生成树

最小生成树 Reference https://oi.wiki/graph/mst 前置知识 生成树是连接无向图中所有点且边数最少的连通子图 最小生成树是边权和最小的生成树 且对于一棵边权互不相等的树,其最小生成数只有一棵 Kruskal (自写,求轻喷 #include<iostream> #in

动态规划 - 数位 DP

动态规划 - 数位 DP Reference https://www.luogu.com.cn/blog/virus2017/shuweidp

动态规划 - 基础

动态规划 - 基础 reference https://oi-wiki.org/dp/basic/ 最长不下降子序列 可求子序列 $ \Theta(n^2)$ // 注:数组 a 从 1 开始 // dp[i] 表示末尾为下标 i 的子序列的长度 int a[N],dp[N],ans=-1e6,an

动态规划 - 背包

动态规划 - 背包篇 reference https://www.luogu.com.cn/blog/RPdreamer/bei-bao-wen-ti https://blog.csdn.net/m0_37809890/article/details/79838077 引入(01背包) for(in

kmp

模板 #include<iostream> #include<cstring> using namespace std; char s[1000001],p[1000001]; int pmt[1000001]; void get_pmt(int len){ int j=0; f

二叉堆

二叉堆 模板(大根堆) void up(int x){ while(x>1 && tr[x]>tr[x/2]){ swap(tr[x],tr[x/2]); x/=2; } } void down(int x,int n){ int t;

树状数组

树状数组 模板 #include<cstdio> #define N 500001 using namespace std; inline int lowbit(int x){ return x&-x; } int n,m,a[N],c[N]; void update(int x,int

解决 WSL2 时钟不同步问题的办法(转载翻译)

翻译自 https://github.com/microsoft/WSL/issues/8204#issuecomment-1338334154 通过配置 systemd-timesyncd,我解决了这个问题。 需要注意的是,这个方法会修改父 WSL 进程,所以所有的 WSL 实例时间都会被同步,因