https://nanti.jisuanke.com/t/34142

上午可能是供氧不足,推的式子死活不对,晚上莫名其妙又来了一次就过了。

分两种情况讨论,如果能够完全进入弯道答案就是固定的就是: sqrt(b^2 + (a+r)^2)

否则的话考虑过左后方那个点做垂直y的直线,答案就是圆心到这条直线最短距离,利用已知角度d可以计算得到。

红线就是答案。

 #include <bits/stdc++.h>
using namespace std;
const double PI=acos(-1.0);
int main(){
int a,b,r,d;
int t;
cin>>t;
while(t--){
cin>>a>>b>>r>>d;
if(atan(1.0*b/(a+r))/PI*<d){
printf("%.12f\n",sqrt(1.0*(b*b)+(a+r)*(a+r))-r);
}
else{
double agl=d/180.0*PI;
printf("%.12f\n",-r+1.0*(a+r)*cos(agl)+sin(agl)*b);
}
}
return ;
}

icpc2018-焦作-D-几何模拟的更多相关文章

  1. icpc2018焦作-I. Distance

    第一发又超时了... 题目大意:给你n个点,然后给你n-1的数,表示两两距离,然后让你输出n个答案,第i个答案表示从这n个点里面挑i个点,然后这i个点两两之间会有一个距离,答案要求这些距离和的最大值. ...

  2. Cogs 1070. [焦作一中2012] 玻璃球游戏 带权并查集,逆序处理

    题目: http://cojs.tk/cogs/problem/problem.php?pid=1070 1070. [焦作一中2012] 玻璃球游戏 ★   输入文件:marbles.in   输出 ...

  3. 2018.11.25 AMC-ICPC 亚洲区域赛(焦作站)吊银

    11月23日 大清早,跟着wyb的脚步,早起跑过去听方伟的编译原理,然鹅一点都没听进去,在焦作胡辣汤群里疯狂灌水... 听说焦作那边冷得不行,前一天看天气预报说那边已经是2℃了,都快零下了,然鹅学校里 ...

  4. ACM-ICPC 2018 焦作赛区网络预赛- G:Give Candies(费马小定理,快速幂)

    There are N children in kindergarten. Miss Li bought them NNN candies. To make the process more inte ...

  5. ACM-ICPC 2018 焦作赛区网络预赛- L:Poor God Water(BM模板/矩阵快速幂)

    God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him t ...

  6. 2018 焦作icpc现场赛总结

    Day 0 没有直达焦作的飞机,所以选择了先到新郑机场,再转乘城际列车.城际列车猜是专门给学生开通的吧,每天只有来和回一共两趟(所以机票选择的余地也不多).买的时候只有无座票了,本来以为会一直站着,但 ...

  7. 焦作网络赛K-Transport Ship【dp】

    There are NN different kinds of transport ships on the port. The i^{th}ith kind of ship can carry th ...

  8. 焦作网络赛B-Mathematical Curse【dp】

    A prince of the Science Continent was imprisoned in a castle because of his contempt for mathematics ...

  9. 焦作网络赛E-JiuYuanWantstoEat【树链剖分】【线段树】

    You ye Jiu yuan is the daughter of the Great GOD Emancipator. And when she becomes an adult, she wil ...

  10. 焦作网络赛L-Poor God Water【矩阵快速幂】

    God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him t ...

随机推荐

  1. 点击刷新验证码所需要的onclick函数

    <img src="__APP__/Public/verify" onclick="this.src=this.src+'?'+Math.random()" ...

  2. [js]js栈内存的全局/私有作用域,代码预解释

    js代码如何执行的 浏览器提供执行环境: 全局作用域(提供js执行环境, 栈内存) --> 执行js需要预解释 - 带var : 提前声明 - 带function关键字的: 提前声明+定义 js ...

  3. 怎样用Java自制优秀的图片验证码?这样!

    Completely Automated Public Turing test to tell Computers and Humans Apart 全自动区分计算机和人类的图灵测试 简称CAPTCH ...

  4. pytorch torchvision对图像进行变换

    class torchvision.transforms.Compose(转换) 多个将transform组合起来使用. class torchvision.transforms.CenterCrop ...

  5. 函数作用域之闭包与this!

    函数基础友情链接:http://speakingjs.com/es5/ch01.html#_functions 作用域链图解   var x = 1; function foo(){     var ...

  6. C#ImageList和ListView的使用

    一.ImageList  ImageList组件,又称为图片存储组件,它主要用于存储图片资源,然后在控件上显示出来,这样就简化了对图片的管理.ImageList组件的主要属性是Images,它包含关联 ...

  7. Windwos Live Writer插件指南

    Windows Live Writer 即(WLW) 是一个免费的桌面应用程序,可以用于发布博客. 官网下载地址:https://www.microsoft.com/zh-CN/download/de ...

  8. Determine YARN and MapReduce Memory Configuration Settings

    Determine YARN and MapReduce Memory Configuration Settings https://docs.hortonworks.com/HDPDocuments ...

  9. docker容器与大数据组件的冲突点

    1.容器里面安装spark,外面的程序(安装spark主机的容器)会连接不上集群.理由:这个组件用的akka,连接上集群,会提示: akka.ErrorMonitor: dropping messag ...

  10. JavaScript if 条件语句

    JavaScript if 条件语句 使用: if(条件){ }else if(条件){ }else if(条件){ }else{ } 示例: // 判断相等 if(1==1){ } // 判断不等 ...