
高斯消元
chr1st0pher
Dancer on the keyboard
展开
-
LightOJ 1151 Snakes and Ladders (期望DP + 高斯消元)
Description‘Snakes and Ladders’ or ‘Shap-Ludu’ is a game commonly played in Bangladesh. The game is so common that it would be tough to find a person who hasn’t played it. But those who haven’t played it (unlucky of course!) the rules are as follows.1.Th原创 2020-07-12 10:49:31 · 271 阅读 · 0 评论 -
Codeforces 113D Museum (期望DP + 高斯消元)
题目链接题目大意:有NNN个房间,其中两个房间 AAA,BBB 里各有一个人。有MMM对房间通过双向边连通。每一个时刻,每个人有一定概率pip_ipi留在 iii 号房间,或者有1−pi1-p_i1−pi的概率离开,等概率前往相邻房间。两人一旦处于同一房间则立即停下来。求对于所有的房间 iii,两人在 iii 号房间相遇的概率是多少PS:1.在过道内相遇不算2.所有房间保证连通解法:考虑DP,设f[i][j]f[i][j]f[i][j] 为一个人在房间 iii ,同时另一个人在 房间 jj原创 2020-06-22 22:49:06 · 207 阅读 · 0 评论 -
高斯消元(模板)
模板题:洛谷P3389高斯消元法Code:int n;double a[MX][MX];double ans[MX];void guess(){ for(int i = 1;i <= n;++i){ int r = i; for(int j = i + 1;j <= n;++j){ if(fabs(a[r][i]) < fabs(a[j][i])) r = j; } if(fabs(a[r][i]) < eps){ printf("No S原创 2020-06-07 19:17:01 · 207 阅读 · 0 评论