UVA - 11346 Probability(概率)(连续概率)
题意:在[-a, a]*[-b, b]区域内随机取一个点P,求以(0, 0)和P为对角线的长方形面积大于S的概率(a,b>0, S>=0)。
分析:
1、若长方形面积>S,则选取的P(x,y)满足xy>S,xy=S是双曲线,P取双曲线上方,[-a, a]*[-b, b]区域内的某点则满足条件。
2、(双曲线上方,[-a, a]*[-b, b]区域内)这块区域的面积w/(a*b)则为答案。
3、面积w求法:ab - 双曲线下方面积(S + S*ln(a*b/S))。
#pragma comment(linker, "/STACK:102400000, 102400000")
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<sstream>
#include<iterator>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<queue>
#include<list>
#define Min(a, b) ((a < b) ? a : b)
#define Max(a, b) ((a < b) ? b : a)
const double eps = 1e-8;
inline int dcmp(double a, double b){
if(fabs(a - b) < eps) return 0;
return a > b ? 1 : -1;
}
typedef long long LL;
typedef unsigned long long ULL;
const int INT_INF = 0x3f3f3f3f;
const int INT_M_INF = 0x7f7f7f7f;
const LL LL_INF = 0x3f3f3f3f3f3f3f3f;
const LL LL_M_INF = 0x7f7f7f7f7f7f7f7f;
const int dr[] = {0, 0, -1, 1, -1, -1, 1, 1};
const int dc[] = {-1, 1, 0, 0, -1, 1, -1, 1};
const int MOD = 1e9 + 7;
const double pi = acos(-1.0);
const int MAXN = 10000 + 10;
const int MAXT = 10000 + 10;
using namespace std;
int main(){
int T;
scanf("%d", &T);
while(T--){
double a, b, S;
scanf("%lf%lf%lf", &a, &b, &S);
double m = a * b;
if(S >= a * b){
printf("0.000000%%\n");
continue;
}
if(fabs(S) < eps){
printf("100.000000%%\n");
continue;
}
double ans = (m - S - S * log(m / S)) * 100 / m;
printf("%.6lf%%\n", ans);
}
return 0;
}
UVA - 11346 Probability(概率)(连续概率)的更多相关文章
- UVa 11346 Probability (转化+积分+概率)
题意:给定a,b,s,在[-a, a]*[-b, b]区域内任取一点p,求以原点(0,0)和p为对角线的长方形面积大于s的概率. 析:应该明白,这个和高中数学的东西差不多,基本就是一个求概率的题,只不 ...
- uva 11346 - Probability(概率)
option=com_onlinejudge&Itemid=8&page=show_problem&problem=2321">题目链接:uva 11346 - ...
- uva 11346 - Probability(可能性)
题目链接:uva 11346 - Probability 题目大意:给定x,y的范围.以及s,问说在该范围内选取一点,和x,y轴形成图形的面积大于s的概率. 解题思路:首先达到方程xy ≥ s.即y ...
- ●UVa 11346 Probability
题链: https://vjudge.net/problem/UVA-11346题解: 连续概率,积分 由于对称性,我们只用考虑第一象限即可. 如果要使得面积大于S,即xy>S, 那么可以选取的 ...
- UVA 11346 Probability 概率 (连续概率)
题意:给出a和b,表示在直角坐标系上的x=[-a,a] 和 y=[-b,b]的这样一块矩形区域.给出一个数s,问在矩形内随机选择一个点p=(x,y),则(0.0)和p点组成的矩形面积大于s的概率是多少 ...
- UVA - 11346 Probability (概率)
Description Probability Time Limit: 1 sec Memory Limit: 16MB Consider rectangular coordinate system ...
- UVA 11181 Probability|Given (离散概率)
题意:有n个人去商场,其中每个人都有一个打算买东西的概率P[i].问你最后r个人买了东西的情况下每个人买东西的概率 题解:一脸蒙蔽的题,之前的概率与之后的概率不一样??? 看了白书上的题解才知道了,其 ...
- UVa 11346 - Probability(几何概型)
链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- UVA 11346 - Probability 数学积分
Consider rectangular coordinate system and point L(X, Y ) which is randomly chosen among all pointsi ...
随机推荐
- json序列化(重要)
(1)同(2)public JsonResult JsonUserGet() { DataSet ds = Web_User.P_LG_User_Get(nUserId); return Json(J ...
- ELK/EFK——日志收集分析平台
ELK——日志收集分析平台 ELK简介:在开源的日志管理方案之中,最出名的莫过于ELK了,ELK由ElasticSearch.Logstash和Kiabana三个开源工具组成.1)ElasticSea ...
- 启动nginx出错:open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
[emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory) 解决:mkdir / ...
- android EditText中inputType的属性列表
android 1.5以后添加了软件虚拟键盘的功能,所以在输入提示中将会有对应的软键盘模式 android中inputType属性在EditText输入值时启动的虚拟键盘的风格有着重要的作用.这也大大 ...
- 【rabbitmq】Queueingconsumer被废止后老代码如何做的解决方案
amqp-client 3.x之前的rabbitmq版本有个消费者的写法是借助于Queueingconsumer的: QueueingConsumer consumer = new QueueingC ...
- MAC电脑如何播放.SWF文件
很简单,不需要专门的播放器,只需要将.swf文件直接拖拽到浏览器页面就可以播放了. 亲测safari , 谷歌chrome浏览器,火狐浏览器 ,都是可以的 下面是图示 step1 电脑上找到swf文件 ...
- 0. GC 前置知识
阅读<垃圾回收的算法与实现>时记录的一些笔记. 对象 在GC的世界中,对象表示的是"通过应用程序利用的数据的集合" 头 我们将对象中保存对象本身信息的部分称为头.头主要 ...
- C#中的扩展类的理解
扩展类是一种静态的一种类的调用方法,通过实例化进行调用.利用this进行指正该类,有参数的时候直接在后面追加参数. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
- leetcode844 Backspace String Compare
""" Given two strings S and T, return if they are equal when both are typed into empt ...
- arm linux 支持 wifi (wpa_supplicant)
背景: 公司用的产品主板支持wifi接口,为了加强产品的功能,做wifi的底层支持. 有关知识点:浅谈 Linux 内核无线子系统 概览 主要的流程如下: 内核配置 + 有关驱动的移植 + 软件的移植 ...