111qqz的小窝

老年咸鱼冲锋!

hdu 5036 Explosion||2014 北京区域赛网络赛 (概率+bitset优化的状态压缩+floyd传递闭包)

题目链接 题意:有n扇门,n种钥匙,一一对应。每扇门打开后可能得到k把钥匙(k可能为0)。一扇门还可以用一颗炸弹炸开。现在问要开所有门,使用炸

hdu 5645 DZY Loves Balls (古典概型)

题目链接 题意:n(n<=300)个球,每个球上标有一个标号(a[i]<=300),从中拿一个,不放回,再拿一个,问第一个球上的数

hdu 4336 Card Collector (2012多校 #4) (容斥原理模板题)

http://acm.hdu.edu.cn/showproblem.php?pid=4336 题意:有n种卡片,买一包干脆面得到第i种卡片的概率是p[i],每包干脆面最多有一张卡片,问收集齐所有卡片要买的干脆面的包数的数学期望。 思路

codeforces 148 D. Bag of mice

http://codeforces.com/problemset/problem/148/D 题意:盒子里有w只白老鼠,b只黑老鼠,公主和魔王轮流取(公主先),先取到白老鼠的人获胜。魔王每次取完以后,盒子中的老鼠会因为吓尿了跑掉一只

codeforces 107 B. Basketball Team

http://codeforces.com/problemset/problem/107/B 题意:有m个部门,每个部分s[i]个人,HW在第h部门,现在要从这m个部门中挑选包括HW在内的n个人去参加比赛,问被挑选的人中有HW的队友

codeforces 518 D. Ilya and Escalator

http://codeforces.com/problemset/problem/518/D 题意:有n个人排队上一个电梯。。。在某一秒内,队首的人有p的概率上电梯,1-p的概率不动。每个人只有在队首的位置才可以上电梯(也就是每一秒

codeforces 312 B. Archer

http://codeforces.com/problemset/problem/312/B 题意:两个人比赛射箭,先射的人射中的概率是a/b,后射的人射中的概率是c/d,问先射的人赢的概率。 思路:应该叫条件概率。。。? 不过我们可以

codeforces 453 A. Little Pony and Expected Maximum

http://codeforces.com/problemset/problem/453/A 题意:m面筛子,每面点数出现的概率相同,连续投掷n次,问出现的最大值的数学期望。 思路:手写样例。。。发现答案为。。。记得把(1/m)^n放

codeforces 476 B. Dreamoon and WiFi

http://codeforces.com/problemset/problem/476/B 题意:给出两个长度相等-且不超过10的字符串,串1只包含‘-’,‘+‘。按照‘+’为1,‘-’为-1累加可以得到一个值。串2还

codeforces #341 div2 C. Wet Shark and Flowers

http://codeforces.com/contest/621/problem/C C. Wet Shark and Flowers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n sharks who grow flowers for Wet Shark. They are all sitting around the table, such that sharks i and i + 1 are neighbours for all i from 1 to n - 1. Sharks n and 1 are neighbours too. Each shark will

codeforces 30 C. Shooting Gallery

http://codeforces.com/contest/30/problem/C 题意:给出n个target在一个二维平面上。给出每个target的坐标,出现的时间,以及击中的概率。target出现之后就会瞬间消失,枪移

hdu 5481||bestcoder #57 div 2 C Desiderium (概率)

Desiderium **Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 427 Accepted Submission(s): 167 ** Problem Description There is a set of intervals, the size of this set is n. If we select a subset of this set with equal probability, how many the expected length of intervals’ union of this subset is? We assume that the length of empty set’s union is 0, and we want

cf 442B Andrey and Problem

B. Andrey and Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Andrey needs one more problem to conduct a programming contest. He has n friends who are always willing to help. He can ask some of them to come up with a contest problem. Andrey knows one value for each of his fiends – the probability that this friend