Finding the Radius for an Inserted Circle 公式/几何 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
来源:互联网 发布:淘宝助理电子单号撤销 编辑:程序博客网 时间:2024/05/20 07:35
题目链接
几何加公式题,利用余弦定理求角的余弦值,进而求解
#include<bits/stdc++.h>using namespace std;typedef long long ll;const long double pi = acos(-1.0);long double R;int k,l;long double ans[11];int main(){// freopen("data.txt","r",stdin);// ios_base::sync_with_stdio(false); cin >>l>>R; ans[1] = R/(sin(pi/3))-R; long double ra = cos(pi/3); long double a,b,c,x; for(int i=2;i<=10;i++) { a = ans[i-1]; x = (2*a*a+2*a*R-2*a*(a+R)*ra) /( 2*((R-a)+(a+R)*ra) ) ; ans[i] =x; a = ans[i-1]+R; b = ans[i-1]+x; c = R+x;// cout << a<<" "<<b<<" "<<c<<endl; ra =(c*c + b*b - a*a) / (2*b*c); ra *= -1; } for(int i=0;i<l;i++) { cin >> k; cout <<k<<" "<<(ll)ans[k]<<endl; } cin >> k; return 0;}
阅读全文
0 0
- Finding the Radius for an Inserted Circle 公式/几何 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 G. Finding the Radius for an Inserted Circle
- Finding the Radius for an Inserted Circle--2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 G. Finding the Radius for an Inserted Circle
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 G. Finding the Radius for an Inserted Circle(计算几何,二分)
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛: G. Finding the Radius for an Inserted Circle(笛卡尔定理)
- 2017 ACM-ICPC南宁网络赛: G. Finding the Radius for an Inserted Circle
- ???Finding the Radius for an Inserted Circle
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 The Heaviest Non-decreasing Subsequence Problem
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 The Heaviest Non-decreasing Subsequence Problem
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 The Heaviest Non-decreasing Subsequence Problem
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛:The Heaviest Non-decreasing Subsequence Problem
- Finding the Radius for an Inserted Circle 笛卡尔定理
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 I GSM Base Station Identification(暴力,计算几何)
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 GSM Base Station Identification 线性变换||计算几何
- 判断机器大小端模式
- 8. String to Integer (atoi)
- 第一次给自己的博客安家,Mark一下。
- STM32睡眠模式低功耗(停止模式)
- ARM中一些常见英文缩写解释
- Finding the Radius for an Inserted Circle 公式/几何 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
- 日记(周末)
- QQ测拉效果实现(二)
- redhat7.0修改yum源
- Linux下编译安装redis
- 欢迎使用CSDN-markdown编辑器
- WebService实践(二)
- java double类型保留两位小数
- 网页用户登录权限校验的两种实现方式