概率/期望 DP
我是一位爱编程的蒟蒻
我是一位爱编程的蒟蒻
展开
-
CodeForces 176B
#include <bits/stdc++.h> using namespace std; int dp[5555][5555]; signed main() { int n__; cin >> n__; string s; cin >> s; string t = s; reverse (t.begin(), t.end()); int n = s.length(); for (int i = n;原创 2022-03-16 17:05:26 · 66 阅读 · 0 评论 -
Bzoj 2396. 神奇的矩阵
rand函数:生成随机数 srand(time(0)): 生成随机数种子 Miller_rabin思想 #include <stdio.h> #include <stdlib.h> #include <time.h> #include <stdbool.h> const int N = 1010; int a[N][N], b[N][N], c[N][N], d[N][N]; int e[N][N], f[N][N]; int g[N][N], h[N][N原创 2021-10-24 11:12:21 · 92 阅读 · 0 评论 -
Bzoj 2969 矩阵粉刷
思想:期望,概率 #include <bits/stdc++.h> using namespace std; double P[1010][1010]; const double eps = 1E-9; double quick_power(double a, int b) { if (b == 0) return 1; double ans = quick_power(a, b >> 1); ans = ans * ans; i.原创 2021-10-24 10:28:04 · 145 阅读 · 1 评论