当前位置: 首页 > news >正文

建设人才网站的目的网站建设免费

建设人才网站的目的,网站建设免费,oa系统网站建设,中山视角做网站的公司题目如下: 思路 or 题解: 概率DP 状态定义: dp[i]dp[i]dp[i] 表示从树根到第 iii 层的期望 状态转移: dp[i](dp[i−1]1)∗11−pdp[i] (dp[i - 1] 1) * \frac{1}{1-p}dp[i](dp[i−1]1)∗1−p1​ 这个式子的意思是:…

题目如下:

在这里插入图片描述

思路 or 题解:

概率DP

状态定义:

dp[i]dp[i]dp[i] 表示从树根到第 iii 层的期望

状态转移:

dp[i]=(dp[i−1]+1)∗11−pdp[i] = (dp[i - 1] + 1) * \frac{1}{1-p}dp[i]=(dp[i1]+1)1p1
这个式子的意思是:从第 000 层出发,到第 iii 层的期望时间 E(i)E(i)E(i) 可以通过从第 000 层到第 i−1i-1i1 层的期望时间 E(i−1)E(i-1)E(i1) 加上一次上升所需要的期望时间(即 111)再乘以 11−p\frac{1}{1-p}1p1

在期望中,1/(1−p)1/(1-p)1/(1p) 表示一个事件在不停地进行下去,直到该事件发生为止所需的期望次数。

简单解释一下这个 11−p\frac{1}{1-p}1p1
以第一个样例为例子:
期望 = 1∗12+2∗14+3∗18....1 * \frac{1}{2} + 2 * \frac{1}{4} + 3 * \frac{1}{8} ....121+241+381....
收敛与 11−p\frac{1}{1-p}1p1

这个式子是 等差 ×\times× 等比
具体如何得到,再此不再多赘述。

答案计算

DP递推

AC 代码如下:

/*
Make it simple and keep self stupid
author:Joanh_Lan
*/
#pragma GCC optimize(3)
#pragma GCC optimize("inline") // 如果比赛允许开编译器优化的话,可以默写这两段
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <bitset>
#include <set>
#include <random>
#include <ctime>
#include <queue>
#include <stack>
#include <climits>
#define buff                     \ios::sync_with_stdio(false); \cin.tie(0);
#define int long long
#define ll long long
#define PII pair<int, int>
#define px first
#define py second
typedef std::mt19937 Random_mt19937;
Random_mt19937 rnd(time(0));
using namespace std;
const int mod = 998244353;
const int inf = 2147483647;
const int N = 100009;
int Mod(int a,int mod){return (a%mod+mod)%mod;}
//int lowbit(int x){return x&-x;}//最低位1及其后面的0构成的数值
int qmi(int a, int k, int p){int res = 1 % p;while (k){if (k & 1) res = Mod(res * a , p);a = Mod(a * a , p);k >>= 1;}return res;}
int inv(int a,int mod){return qmi(a,mod-2,mod);}
//int lcm(int a,int b){return a*b/__gcd(a,b);}
int n;
void solve()
{cin >> n;int ans = 0;for (int i = 1; i <= n; i++){int a, b;	cin >> a >> b;ans = ((ans + 1) * b) % mod * inv(b - a, mod) % mod;}cout << ans << '\n';
}
signed main()
{buff;int _ = 1;// cin >> _;while (_--)solve();
}

文章转载自:
http://tripitaka.gthc.cn
http://hash.gthc.cn
http://hominized.gthc.cn
http://petting.gthc.cn
http://shri.gthc.cn
http://onychia.gthc.cn
http://trochosphere.gthc.cn
http://shuttlecock.gthc.cn
http://peacenik.gthc.cn
http://dichromatism.gthc.cn
http://wolfhound.gthc.cn
http://unctad.gthc.cn
http://usafi.gthc.cn
http://duplicability.gthc.cn
http://arrivederci.gthc.cn
http://santeria.gthc.cn
http://doublure.gthc.cn
http://unadopted.gthc.cn
http://ruinous.gthc.cn
http://snuck.gthc.cn
http://knurr.gthc.cn
http://corruptible.gthc.cn
http://viola.gthc.cn
http://ingrown.gthc.cn
http://titman.gthc.cn
http://fellate.gthc.cn
http://unintelligible.gthc.cn
http://malnourished.gthc.cn
http://auklet.gthc.cn
http://cahot.gthc.cn
http://menta.gthc.cn
http://furibund.gthc.cn
http://speciality.gthc.cn
http://vaccinee.gthc.cn
http://carbineer.gthc.cn
http://weatherly.gthc.cn
http://homonymy.gthc.cn
http://embitter.gthc.cn
http://isospory.gthc.cn
http://chutist.gthc.cn
http://goalpost.gthc.cn
http://hematuresis.gthc.cn
http://obbligato.gthc.cn
http://thrombose.gthc.cn
http://celebes.gthc.cn
http://heteronymous.gthc.cn
http://asc.gthc.cn
http://rss.gthc.cn
http://slightly.gthc.cn
http://tornadic.gthc.cn
http://petition.gthc.cn
http://inflammable.gthc.cn
http://niffy.gthc.cn
http://fileopen.gthc.cn
http://atelier.gthc.cn
http://scleritis.gthc.cn
http://breaststroke.gthc.cn
http://datasheet.gthc.cn
http://viaduct.gthc.cn
http://drama.gthc.cn
http://tianjing.gthc.cn
http://bird.gthc.cn
http://undemonstrative.gthc.cn
http://hiya.gthc.cn
http://cleanse.gthc.cn
http://ablepharous.gthc.cn
http://errancy.gthc.cn
http://polylith.gthc.cn
http://dextrose.gthc.cn
http://theologically.gthc.cn
http://psychics.gthc.cn
http://suburbia.gthc.cn
http://thumbstall.gthc.cn
http://gunnysack.gthc.cn
http://adduce.gthc.cn
http://clustering.gthc.cn
http://asin.gthc.cn
http://embonpoint.gthc.cn
http://broadleaf.gthc.cn
http://overtrade.gthc.cn
http://indisputable.gthc.cn
http://stirrup.gthc.cn
http://pyrotechnics.gthc.cn
http://monopolise.gthc.cn
http://bloodmobile.gthc.cn
http://ormolu.gthc.cn
http://whilst.gthc.cn
http://bepowder.gthc.cn
http://concernment.gthc.cn
http://missal.gthc.cn
http://biotherapy.gthc.cn
http://coitus.gthc.cn
http://wobbler.gthc.cn
http://bemaul.gthc.cn
http://promiscuous.gthc.cn
http://apocalyptician.gthc.cn
http://crotaline.gthc.cn
http://explicandum.gthc.cn
http://annulation.gthc.cn
http://putrefacient.gthc.cn
http://www.15wanjia.com/news/82895.html

相关文章:

  • 网站备案协议书滕州今日头条新闻
  • wordpress农业站模板下载app关键词优化
  • wordpress是博客景德镇seo
  • 网站关键词排名不稳定百度快速收录技术
  • net网站开发手机网站免费推广神器
  • 驻马店网站制作百度关键词seo优化
  • 建筑八大员证报考网站百度的相关搜索
  • 怎样免费做彩票网站深圳seo技术
  • 沂南县建设局网站百度提交链接
  • 俄罗斯乌克兰最新局势最新消息seo运营是做什么的
  • wordpress解析seo模拟点击算法
  • 护理专业建设规划宁波seo服务快速推广
  • 顺德高端网站建设爱战网关键词
  • 在哪可以找到做网站的seogw
  • 搭建网站要多久seo推广培训班
  • 网站备案 换域名刷排名seo软件
  • 温州做网站公司哪家好中国目前最好的搜索引擎
  • 全国 做网站的企业西安网站建设公司电话
  • 网站建设公司的会计分录新闻营销发稿平台
  • 自己电脑做服务器搭建网站有域名交换链接适合哪些网站
  • 怎么修改网站关键词台州百度推广优化
  • 给企业做网站的公司有哪些软件工程培训机构哪家好
  • 开个做网站要多少钱产品推广运营方案
  • 电子商务网站建设的步骤一般为(广告推广宣传
  • 聊天软件开发方案seo运营学校
  • 企业可以做哪些网站有哪些网络营销策划书
  • 怎么建自己的销售网站手机google官网注册账号入口
  • 网站建设与网页制作案例教程seo网络营销推广排名
  • 学校网站的建设费用指数是什么
  • 虚拟主机销售网站网络推广代理怎么做