原文:[Codeforces 1265E]Beautiful Mirrors

Description 题库链接 一共有 n 个关卡,你初始在第一个关卡。通过第 i 个关卡的概率为 p i 。每一轮你可以挑战一个关卡。若通过第 i 个关卡,则进入第 i 个关卡,否则重新回到第 个关卡。通过第 n 个关卡则算成功。问期望多少轮游戏才能成功。 leq n leq cdot Solution 设从第 i 个关卡通关的期望为 E i 。显然 E i p i E i p i E 特别地 ...

2019-12-06 22:42 0 255 推荐指数:

查看详情

Codeforces 1264C/1265E Beautiful Mirrors with queries (概率期望、DP)

题目链接 http://codeforces.com/contest/1264/problem/C 题解 首先显然断点把序列分成几部分,总答案就等于所有部分的答案之和。考虑如何求一部分内的答案。首先有个非常经典的dp是\(f_i\)表示期望多少次从\(i\)走到\(i+1\), 但是按此方法 ...

Sat Dec 07 00:49:00 CST 2019 0 309
CodeForces-1155D Beautiful Array

Description You are given an array \(a\) consisting of \(n\) integers. Beauty of array is the maxim ...

Tue Apr 23 15:58:00 CST 2019 0 514
[CodeForces-55D]Beautiful Numbers

题目大意:   问区间[l,r]内有多少正整数能被其各个数位上的所有数字整除。 思路:   数位DP。   能被所有数位整除相当于能被所有数位的LCM整除。   而1..9的LCM为2520。 ...

Fri Oct 20 22:02:00 CST 2017 0 1050
Codeforces 1270E

我们把所有点分成四类 $A_{0,0},A_{0,1},A_{1,0},A_{1,1}$ 发现如果$A_{0,0}+A_{1,1} > 0$并且$A_{0,1}+A_{1,0} > 0 ...

Mon Dec 30 23:40:00 CST 2019 4 143
codeforces 877e

E. Danil and a Part-time Job time limit per test 2 seconds memory limit per test 256 megabytes input ...

Mon Nov 06 01:31:00 CST 2017 0 1356
Codeforces 1220E. Tourism

传送门 这是一道英语题,首先要读懂题目: $\text{Alex believes that his trip will be interesting only if he will not us ...

Fri Sep 20 20:42:00 CST 2019 2 263
codeforces 1269 E K Integers

E. K Integers 题目连接:https://codeforces.com/contest/1269/problem/E 题意 给了一个排列p,你每次操作可以交换两个相邻的元素,现在问你最少操作多少次可以形成一个形如1,2,3,4..k 这样的子段 k从1~n 题解 ...

Tue Dec 24 11:42:00 CST 2019 0 260
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM