摘要: 分层图的板子题 代码 #include <bits/stdc++.h> #define R(x) x=read() #define fi first #define se second using namespace std; typedef pair<int,int> PII; const int 阅读全文
posted @ 2024-04-12 16:31 Gold_stein 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 概率dp,关键是要走出思维定势: 一般来讲,都会把dp[i]定义为从0爬到高度i的概率,但是因为任何时刻都有掉下去的可能,这样子不好推(也有大佬这样做出来的) 我们把dp[i]定义为从i爬到n的概率,公式就好推了 而且,我们可以根据定义很自然地得到: dp[n]=0 #include <bits/s 阅读全文
posted @ 2024-04-12 12:15 Gold_stein 阅读(2) 评论(0) 推荐(0) 编辑