10491 - Cows and Cars Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=1432 In television contests, participants are often asked to choose one from a set…
题目连接:uva 11722 - Joining with Friend 题目大意:你和朋友乘火车,而且都会路过A市.给定两人可能到达A市的时段,火车会停w.问说两人能够见面的概率. 解题思路:y = x + w 和y = x - w在给定时间内围成的面积除以时间的总面积,就是求面积的时候要分情况处理. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int t…
Some mathematical background. This problem asks you to compute the expected value of a random variable. If you haven't seen those before, the simple denitions are as follows. A random variable is a variable that can have one of several values, each w…