会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
ganking
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
···
15
下一页
2024年1月17日
Codeforces Round 861 (Div. 2)
摘要: Codeforces Round 861 (Div. 2) C题直接数位dp即可 #include<cstdio> #include<algorithm> #include<cstring> #include<map> #include<queue> #include<bitset> #includ
阅读全文
posted @ 2024-01-17 08:47 gan_coder
阅读(16)
评论(0)
推荐(0)
2024年1月16日
abc132F - Small Products
摘要: abc132F - Small Products 容易想到暴力dp,f[i][j]表示到第i个位置,且i位置上填的是j的方案数。 虽然N非常大,但是如果我们考虑按\(\frac{n}{k}\)的值分块,那么就只有根号级别的数量 \(f[i][j]\)表示在到第i个位置,且第i个位置选了第j个块中的数
阅读全文
posted @ 2024-01-16 09:48 gan_coder
阅读(28)
评论(0)
推荐(0)
2024年1月15日
HDU - 4565So Easy!
摘要: 知道这个套路才比较easy \(a_n=(a+\sqrt{b})^n ,b_n=(a-\sqrt{b})^n\)且\(0<b_n<1\) 令\(c_n=a_n+b_n\),所以 \(c_n=\lceil a_n \rceil\) 联系递推方程 \(F_n=pF_{n-1}+qF_{n-2}\) \(
阅读全文
posted @ 2024-01-15 15:44 gan_coder
阅读(8)
评论(0)
推荐(0)
hdu 4990 Reading comprehension(矩阵乘法)
摘要: Read the program below carefully then answer the question. pragma comment(linker, "/STACK:1024000000,1024000000") include include include include incl
阅读全文
posted @ 2024-01-15 15:22 gan_coder
阅读(15)
评论(0)
推荐(0)
HDU 4686 Arc of Dream(构造矩阵)
摘要: 设\(t_n=a_n*b_n\) 把\(a_n 和b_n\)拆出来 \(t_n=(a_{n-1}*ax+ay)(b_{n-1}*bx+by)\) \(t_n=ax*bx*t_{n-1}+ax*by*a_{n}+ay*bx*b_{n-1}+ay*by\) 那么同时维护\(s_n, t_n, a_n,
阅读全文
posted @ 2024-01-15 15:04 gan_coder
阅读(12)
评论(0)
推荐(0)
2024年1月14日
4576. 素数独立集
摘要: 4576. 素数独立集 首先很明显是一个最大独立集问题 然后可以发现这是一张二分图 因为如果存在奇环的话就和根据唯一分解定理矛盾 二分图中 最大独立集=n-最大匹配
阅读全文
posted @ 2024-01-14 23:06 gan_coder
阅读(17)
评论(0)
推荐(0)
2024年1月12日
abc333F - Bomb Game 2
摘要: abc333F - Bomb Game 2 设\(f_{i,j}\)表示在有i个人的队列中,第j个人成为第一个的概率。 \(f_{n,1}=\frac{1}{2}f_{n,n}\) \(f_{n,2}=\frac{1}{2}f_{n-1,1}+\frac{1}{2}f_{n,1}\) ... \(f
阅读全文
posted @ 2024-01-12 15:07 gan_coder
阅读(28)
评论(0)
推荐(0)
abc335F - Hop Sugoroku
摘要: abc335F - Hop Sugoroku 首先容易想到\(O(n^2)\)的dp 考虑优化,对于一个i,只会对满足\(i+a[i]*x=j\)的j有贡献。 也就是j%a[i]=i%a[i] 那么我们可以延迟转移,用cnt[a[i]][i%a[i]],来记录贡献, 然后我们数组不可能开那么大,所以
阅读全文
posted @ 2024-01-12 10:56 gan_coder
阅读(17)
评论(0)
推荐(1)
2023年12月6日
F. Trees and XOR Queries Again
摘要: 首先容易想到lca+线性基,\(O(nlognB^2+qlognB^2)\),显然T飞了。 #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #include<map> #include<vector> #i
阅读全文
posted @ 2023-12-06 13:19 gan_coder
阅读(32)
评论(0)
推荐(0)
2023年11月29日
Codeforces Round 910 (Div. 2)
摘要: https://codeforces.com/contest/1898 C题可以造一个大小为4的环,然后再造一个来回,这样就解决了%4=0,%4=2的情况,而奇数的情况显然无解。 #include<cstdio> #include<algorithm> #include<cstring> #incl
阅读全文
posted @ 2023-11-29 20:38 gan_coder
阅读(23)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
···
15
下一页
公告