hzau 1200 Choosy in Food
1200: Choosy in Food
Time Limit: 1 Sec Memory Limit: 1280 MB
Submit: 32 Solved: 5
[Submit][Status][Web Board]
Description
Xiao Ming find n trees (labeled 0...n-1) which join a circle in a magical land. Each tree
is covered with ripe berries. Xiao Ming wants to find the tree whose berries are most delicious. He starts from the tree X, walks clockwise to find the target. Each time the probability of him walking k trees is Pk% . P1+P2+..+Pk = 100
Now we know the target of Xiao Ming is the tree Y. Require to know expectation of the number of the trees which Xiao Ming walk through
Input
The first parameter is T, indicates the case number.
In each case, there are four integers at the first line, N, M, X , Y (Tree labels from 0 to N-1, N < 100, M < N).
Output
The expectation of the number of trees Xiao Ming walk through. It will be reserved two decimal places. If Xiao Ming will never arrive the tree, output -1.
Sample Input
2
4 2 0 1
50 50
4 1 0 2
100
Sample Output
4.20
2.00
HINT
hzau 1200 Choosy in Food的更多相关文章
- C语言 · 打印1-200之间的素数
素数定义:除了1和本身再无其他整数可被其本身整除的数称为素数,也称质数. 举一例子打印出1-200之间所有的素数: #include<stdio.h> #include<math.h ...
- POJ 1200 字符串HASH
题目链接:http://poj.org/problem?id=1200 题意:给定一个字符串,字符串只有NC个不同的字符,问这个字符串所有长度为N的子串有多少个不相同. 思路:字符串HASH,因为只有 ...
- (hzau)华中农业大学第四届程序设计大赛网络同步赛 G: Array C
题目链接:http://acm.hzau.edu.cn/problem.php?id=18 题意是给你两个长度为n的数组,a数组相当于1到n的物品的数量,b数组相当于物品价值,而真正的价值表示是b[i ...
- sicily 1200欢迎提出优化方案
水题来的……我的做法是用a[10]数组表示每个数字出现的次数. 1200. Stick 限制条件 时间限制: 1 秒, 内存限制: 32 兆 题目描述 Anthony has collected a ...
- bzoj 1200: [HNOI2005]木梳 DP
1200: [HNOI2005]木梳 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 266 Solved: 125[Submit][Status] ...
- BZOJ 1200 木梳
Description Input 第一行为整数L,其中4≤L≤100000,且有50%的数据满足L≤104,表示木板下侧直线段的长.第二行为L个正整数A1,A2,…,AL,其中Ai≤108 Outp ...
- Stitch Fix 融资1200万美元,又一个时尚创业的哈佛女MBA |华丽志
Stitch Fix 融资1200万美元,又一个时尚创业的哈佛女MBA |华丽志 Stitch Fix 融资1200万美元,又一个时尚创业的哈佛女MBA
- [NOIP2012提高组] CODEVS 1200 同余方程(扩展欧几里德算法)
数论题..所有数论对我来说都很恶心..不想再说什么了.. ------------------------------------------------ #include<iostream&g ...
- poj 1200 Crazy Search(hash)
题目链接:http://poj.org/problem?id=1200 思路分析:从数据来看,该题目使用线性时间算法,可见子串的比较是不可能的:使用hash可以在常数时间内查找,可以常数时间内判重, ...
随机推荐
- Linux中的history命令
history -c 清空历史命令 -w 把缓存中的历史命令写入历史命令保存文件说明: a.在用户登录的时候执行的命令会先存在缓存里 b.当用户退出的时候会把缓存里的命令写到文件里 c.用会执行命令 ...
- selenium 下载文件设置下载路径
Chrome 文件下载 Chrome浏览器类似,设置其options: download.default_directory:设置下载路径 profile.default_content_settin ...
- 打开一个vue项目
1.cmd打开命令行工具 2.cd定位到目录 3.(sudo) cnpm install安装((sudo)npm install -g cnpm --registry=http://registry. ...
- 每天一个Linux命令(45)lsof命令
lsof命令用于查看你进程打开的文件,端口(TCP.UDP),找回/恢复删除的文件,打开文件的进程. (1)用法: 用法: lsof [参数] [文件] (2)功 ...
- ubuntu 12.04.2 基于 L3.0.35_1.1.0_121218_source LTIB 问题汇总
1)解压L3.0.35_1.1.0_121218_source.tar.gz 2)cd L3.0.35_1.1.0_121218_source ,执行./install 3) 复制 patch-l ...
- JavaScript笔记01——数据存储(包括.js文件的引用)
While, generally speaking, HTML is for content and CSS is for presentation, JavaScript is for intera ...
- 【FAQ系列】Relay log 导致复制启动失败
今天在使用冷备份文件重做从库时遇到一个报错,值得研究一下. 版本:MySQL5.6.27 一.报错现象 dba:(none)> start slave; ERROR (HY000): Slave ...
- 离乡与理想 Demo
离乡与理想---理想不分黑白 踏上了火车,离开家乡背着幻梦,站累了有人叫我幸福,叫我快乐而我是没有名字的流浪的日子,已数不清有多少带着理想,一路飞翔路上遇见困难,一定要坚强因为理想已离乡 我为理想而离 ...
- node中session存储与销毁,及session的生命周期
1.首先在使用session之前需要先配置session的过期时间等,在入口文件app.js中 app.use(express.session({ cookie: { maxAge: config.g ...
- Go HelloWorld 网络版和并发版
网络版 package main import ( "net/http" "fmt" ) func main() { http.HandleFunc(" ...