2016-2017 CT S03E06: Codeforces Trainings Season 3 Episode 6 The Baguette Master
来源:互联网 发布:js身份证号码格式 编辑:程序博客网 时间:2024/05/21 10:06
比赛看不懂
之后不确定题意去瞄了题解,需要分类讨论?囧
之后按照队友已经ac的题意
就是求外面一圈周长,直接可以求得
#include<bits/stdc++.h>using namespace std;#define sz(X) ((int)X.size())typedef long long ll;const int INF = 0x3f3f3f3f;const int N = 3e5+5;const double pi = acos(-1.0);const double eps = 1e-6;int w;int a,b,c,d,e;double B,C1,C2,A1,A2,D;int sgn(double x) { if(fabs(x) < eps) return 0; else if(x < 0) return -1; else return 1;} double solve(double an) { if(sgn(an - 2*pi) == 0) return 0; else { an /= 2; double ans = 0; ans += 2*w / tan(an); return ans; }}int main(){ while(~scanf("%d",&w)) { double ans = 0; scanf("%d %d %d %d %d",&a,&b,&c,&d,&e); ans = a+b+c+d; // printf("%.3f\n",ans); B = acos( (a*a+b*b-e*e)*1.0 / (2*a*b) ); C1 = acos( (b*b+e*e-a*a)*1.0 / (2*b*e) ); A1 = acos( (a*a+e*e-b*b)*1.0 / (2*a*e) ); D = acos( (c*c+d*d-e*e)*1.0 / (2*c*d) ); C2 = acos( (c*c+e*e-d*d)*1.0 / (2*c*e) ); A2 = acos( (e*e+d*d-c*c)*1.0 / (2*e*d) ); ans += solve(B) + solve(C1+C2) + solve(A1+A2) + solve(D); printf("%.3f\n",ans); } return 0;}
0 0
- 2016-2017 CT S03E06: Codeforces Trainings Season 3 Episode 6 The Baguette Master
- 2016-2017 CT S03E01: Codeforces Trainings Season 3 Episode 1 J Wrong Answer 最大独立集
- 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 J
- 2016-2017 CT S03E08: Codeforces Trainings Season 3 Episode 8 K1 gcd
- 20162017-ct-s03e02-codeforces-trainings-season-3-episode-2-en-I Painting the natural numbers
- 20162017-ct-s03e02-codeforces-trainings-season-3-episode-2-en-A HHPaint
- CodeForces Gym Trainings Season 3 Episode 5 A题
- CF Trainings Season 1 Episode 6 I (dp)
- 2014-2015 Codeforces Trainings Season 2 Episode 7 G Gophers --线段树
- Friend, Season 1, episode 1
- Codeforces 12E Start of the season
- Lost - Season 03 Episode 13 - The Man from Tallahassee - March, 21
- 《Friends Season 04, Episode 01》---笔记
- 《Friends Season 04, Episode 02》---笔记
- Lost - Season 03 Episode 12 - Par Avion - March, 14
- Season in the sun
- The Joining (Episode 122)
- the algorithms episode one
- Mapreduce算法四、key值和value值分别是组合值
- MyEclipse里面集成Tomcat
- 深复制和浅复制
- 【计算机视觉】OpenCV之GPU与OpenCL的相关内容说明
- 字符进行数值运算
- 2016-2017 CT S03E06: Codeforces Trainings Season 3 Episode 6 The Baguette Master
- 二叉树的链式实现
- 深度学习:Hinton_Science_Reducing the dimensionality of data with neural networks
- Cpp Concurrency In Action(读书笔记2)——线程间共享数据
- JS控制退格键删除内容
- JQuery中事件是否发生的判断
- 数位DP
- Linux如何安装jdk
- j2ee中的forward和redirect的区别