随笔分类 - 数学---数学期望,概率
摘要:pro:给定N*M的矩阵,以及初始玩家位置。 规定玩家每次会等概率的向左走,向右走,向下走,原地不动,问走到最后一行的期望。保留4位小数。 sol:可以列出方程,高斯消元即可,发现是三角矩阵,O(N*M) 元素个数。 也可以用反复逼近答案。 反复做,dp[i][j]=(dp[i][j+1]+dp[i
阅读全文
摘要:Valera is a coder. Recently he wrote a funny program. The pseudo code for this program is given below: Now Valera wonders: given the values x, k and p
阅读全文
摘要:A .Assignments 题意:给定距离D,以及N个飞机的速度Vi,单位时间耗油量Fi,总油量Ci。问有多少飞机可以到达目的地。 思路:即问多少飞机满足(Ci/Fi)*Vi>=D > Ci*Vi>=Fi*D; #include<bits/stdc++.h> #define ll long lon
阅读全文
摘要:5091: [Lydsy1711月赛]摘苹果 Description 小Q的工作是采摘花园里的苹果。在花园中有n棵苹果树以及m条双向道路,苹果树编号依次为1到n,每条道路的两 端连接着两棵不同的苹果树。假设第i棵苹果树连接着d_i条道路。小Q将会按照以下方式去采摘苹果: 1.小Q随机移动到一棵苹果树
阅读全文
摘要:Description 小Q同学现在沉迷炉石传说不能自拔。他发现一张名为克苏恩的牌很不公平。如果你不玩炉石传说,不必担心,小Q 同学会告诉你所有相关的细节。炉石传说是这样的一个游戏,每个玩家拥有一个 30 点血量的英雄,并且可以用牌 召唤至多 7 个随从帮助玩家攻击对手,其中每个随从也拥有自己的血量
阅读全文
摘要:In your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if you collect all the 108 people in th
阅读全文
摘要:Description osu 是一款群众喜闻乐见的休闲软件。 我们可以把osu的规则简化与改编成以下的样子: 一共有n次操作,每次操作只有成功与失败之分,成功对应1,失败对应0,n次操作对应为1个长度为n的01串。在这个串中连续的 X个1可以贡献X^3 的分数,这x个1不能被其他连续的1所包含(也
阅读全文
摘要:Allen and Bessie are playing a simple number game. They both know a function f:{0,1}n→Rf:{0,1}n→R, i. e. the function takes nn binary arguments and re
阅读全文
摘要:There is a robot on the 2D plane. Robot initially standing on the position (0, 0). Robot can make a 4 different moves: After moving N times Robot gets
阅读全文
摘要:Given an array of N integers A1, A2, A3…AN. If you randomly choose two indexes i ,j such that 1 ≤ i < j ≤ N, what is the expected value of Ai | Aj? In
阅读全文
摘要:描述 一日,崔克茜来到小马镇表演魔法。 其中有一个节目是开锁咒:舞台上有 n 个盒子,每个盒子中有一把钥匙,对于每个盒子而言有且仅有一把钥匙能打开它。初始时,崔克茜将会随机地选择 k 个盒子用魔法将它们打开。崔克茜想知道最后所有盒子都被打开的概率,你能帮助她回答这个问题吗? 输入 第一行一个整数 T
阅读全文
摘要:数学期望 P=Σ每一种状态*对应的概率。 因为不可能枚举完所有的状态,有时也不可能枚举完,比如抛硬币,有可能一直是正面,etc。在没有接触数学期望时看到数学期望的题可能会觉得很阔怕(因为我高中就是这么认为的,对不起何老板了QwQ),避之不及。 但是现在发现大多数题就是手动找公式或者DP推出即可,只要
阅读全文
摘要:Organizing a programming contest is not an easy job. To avoid making the problems too difficult, the organizer usually expect the contest result satis
阅读全文
摘要:King Arthur is an narcissist who intends to spare no coins to celebrate his coming K-th birthday. The luxurious celebration will start on his birthday
阅读全文
摘要:495. Kids and Prizes Time limit per test: 0.25 second(s) Memory limit: 262144 kilobytes input: standard output: standard ICPC (International Cardboard
阅读全文
摘要:The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains to watch fairies dancing i
阅读全文
摘要:BuggyD loves to carry his favorite die around. Perhaps you wonder why it's his favorite? Well, his die is magical and can be transformed into an N-sid
阅读全文
摘要:There is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 has K1 faces. Die2 has K2 faces. Die3 has K3
阅读全文
摘要:In 0th day, there are n-1 people and 1 bloodsucker. Every day, two and only two of them meet. Nothing will happen if they are of the same species, tha
阅读全文
摘要:Akemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl). Homura wants to help her friend Madoka save the world. But because of the plot of the Boss
阅读全文