[LightOJ 1265] Island of Survival】的更多相关文章

题目链接:https://vjudge.net/problem/LightOJ-1265 1265 - Island of Survival    PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB You are in a reality show, and the show is way too real that they threw into an island. Only two kind…
Island of Survival You are in a reality show, and the show is way too real that they threw into an island. Only two kinds of animals are in the island, the tigers and the deer. Though unfortunate but the truth is that, each day exactly two animals me…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1265 题目大意:有一个生存游戏,里面t只老虎,d只鹿,还有一个人,每天都要有两个生物碰面,现在有以下规则 1.老虎和老虎碰面,两只老虎就会同归于尽 2.老虎和人碰面或者和鹿碰面,老虎都会吃掉对方 3.人和鹿碰面,人可以选择吃或者不吃该鹿 4.鹿和鹿碰面,相安无事 问人存活下来的概率 人生存下来的条件就是不被老虎吃掉,所以只要所有的老虎都同归于尽了,人就可以生存下来了  如果老虎的数量…
You are in a reality show, and the show is way too real that they threw into an island. Only two kinds of animals are in the island, the tigers and the deer. Though unfortunate but the truth is that, each day exactly two animals meet each other. So,…
题目链接...我找不着了 \(Description\) 岛上有t只老虎,1个人,d只鹿.每天随机有两个动物见面 1.老虎和老虎碰面,两只老虎就会同归于尽: 2.老虎和人碰面或者和鹿碰面,老虎都会吃掉对方: 3.人和鹿碰面,人可以选择吃或者不吃该鹿: 4.鹿和鹿碰面,相安无事: 求最后人活下来的最大期望概率. \(Solution\) 人要活下来,一定是所有的老虎都死亡,而老虎只能和老虎两两同归于尽. 所以如果老虎数量为奇数,那鹿总有一天会被吃完,人一定不能存活: 如果老虎数量为偶数,则考虑老虎…
题目大意:有一个生存游戏,里面t仅仅老虎,d仅仅鹿,另一个人,每天都要有两个生物碰面,如今有下面规则 1.老虎和老虎碰面.两仅仅老虎就会同归于尽 2.老虎和人碰面或者和鹿碰面,老虎都会吃掉对方 3.人和鹿碰面.人能够选择吃或者不吃该鹿 4.鹿和鹿碰面,相安无事 问人存活下来的概率 解题思路:自己想复杂了.用了二维的dp... 看了别人的,发现根本不用dp,人生存下来的条件就是不被老虎吃掉,所以仅仅要全部的老虎都同归于尽了,人就能够生存下来了 假设老虎的数量是奇数,那么人总有一天会被吃掉的 假设老…
题意:有 t 只老虎,d只鹿,还有一个人,每天都要有两个生物碰面,1.老虎和老虎碰面,两只老虎就会同归于尽 2.老虎和人碰面或者和鹿碰面,老虎都会吃掉对方 3.人和鹿碰面,人可以选择杀或者不杀该鹿4.鹿和鹿碰面,没事问人存活下来的概率 析:最后存活肯定是老虎没了,首先可以用概率dp来解决,dp[i][j] 表示 还剩下 i 考虑, j 只鹿存活的概率是多少. 然后每次分析这几种情况即可. 还有一种思路就是只要考虑老虎没了,只要老虎没了就能存活,只要计算老虎全死完的概率就好,首先如果老虎是奇数,是…
Island of Survival Time Limit: 2 second(s) Memory Limit: 32 MB Program Description You are in a reality show, and the show is way too real that they threw into an island. Only two kinds of animals are in the island, the tigers and the deer. Though un…
#include <cstdio> #include <iostream> #include <cstring> #include <algorithm> using namespace std; int t,n,d; int main() { scanf("%d",&t); int cas=1; while(t--) { scanf("%d%d",&n,&d); printf("Ca…
题目链接 题意: 在孤岛生存, 孤岛上有t头老虎,d头鹿, 每天会出现随机出现两只生物(包括你自己), 如果出现了一只老虎,那么你将被吃掉, 如果两只老虎, 则两只老虎会同归于尽,其他情况你都将生存下来. 当孤岛上没有老虎时, 就视为你生存成功. 问你生存成功的最大概率. 思路: 仔细想一想, 生存下来其实只和老虎有关, 因为你遇上其他情况, 你都会存活下来. 就相当于是一个0 - 1分布, 要么活下来, 要么被吃掉. 如果t只老虎是一个奇数, 那么必然存活失败, 因为老虎的消耗是成对的, 你要…