比赛看不懂
之后不确定题意去瞄了题解,需要分类讨论?囧
之后按照队友已经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;
}

2016-2017 CT S03E06: Codeforces Trainings Season 3 Episode 6 The Baguette Master的更多相关文章

  1. 2016-2017 CT S03E06: Codeforces Trainings Season 3 Episode 6(8/13)

    2016-2017 CT S03E06: Codeforces Trainings Season 3 Episode 6 比赛连接: http://codeforces.com/gym/101124/ ...

  2. 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) E

    链接:http://codeforces.com/gym/101116 学弟写的,以后再补 #include <iostream> #include <algorithm> # ...

  3. 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) J

    链接:http://codeforces.com/gym/101116 题意:给出n个点,要求一个矩形框将(n/2)+1个点框住,要面积最小 解法:先根据x轴选出i->j之间的点,中间的点(包括 ...

  4. 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) I

    链接:http://codeforces.com/gym/101116 题意:选六个数,必须出现次数最多,且数字最小,如果出现7优先加入7 解法:排序,出现7优先加入7,最后再将6个数排序 #incl ...

  5. 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) B

    链接:http://codeforces.com/gym/101116 学弟做的,以后再补 #include <iostream> #include <stdio.h> #in ...

  6. 2016-2017 CT S03E07: Codeforces Trainings Season 3 Episode 7 - HackerEarth Problems Compilation

    B: 思路: 暴力,每两个判断一下; C: 思路: 容斥定理,先枚举脖子下面那个点和那个不可描述的点,算出所有的方案数,这里面有多的腿当成了脖子或者胳膊的,然后就再枚举这种情况把这些减去,又减多了; ...

  7. 2016-2017 CT S03E02: Codeforces Trainings Season 3 Episode 2

    A HHPaint B Square Root C Interesting Places D Road to Home E Ant and apples F Square G Pair H The F ...

  8. 2016-2017 CT S03E07: Codeforces Trainings Season 3 Episode 7

    B. Pen Pineapple Apple Pen Solved. 题意:将一个序列合并成一个数. 思路:分类讨论一下, 水. #include<bits/stdc++.h> using ...

  9. 2014-2015 Codeforces Trainings Season 2 Episode 7 G Gophers --线段树

    题意: 有n个地鼠,m个CD碟,每个CD碟有一个影响范围,范围内的地鼠都会被吵到,每次有一个操作就是移动CD碟,然后求每次被影响的地鼠有多少只. 解法: 线段树做.我们只关注地鼠有没有被吵到就可以了, ...

随机推荐

  1. 大白话说Java反射:入门、使用、原理

    文章首发于[博客园-陈树义],点击跳转到原文<大白话说Java反射:入门.进阶.原理> 反射之中包含了一个「反」字,所以想要解释反射就必须先从「正」开始解释. 一般情况下,我们使用某个类时 ...

  2. WebService 的工作原理

    Web Service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从Internet或者Intranet上的其它系统中传递过来的请求,轻量级的 ...

  3. HDU [P3605] Escape

    二分图多重匹配 改进版的匈牙利,加入了一个cnt数组作为找到增广路的标志 本题有一个重要的优化见注释 #include <iostream> #include <cstdio> ...

  4. BZOJ 3160: 万径人踪灭 [fft manacher]

    3160: 万径人踪灭 题意:求一个序列有多少不连续的回文子序列 一开始zz了直接用\(2^{r_i}-1\) 总-回文子串 后者用manacher处理 前者,考虑回文有两种对称形式(以元素/缝隙作为 ...

  5. Windows Azure Platform Introduction (14) 申请海外的Windows Azure账户

    <Windows Azure Platform 系列文章目录> 本文的最后更新时间为:2017-12-27 本文介绍国内用户,注册和使用海外Azure账户. 前提: 1.需要一个有效的Wi ...

  6. 链表回文判断(C++)

    题目描述: 对于一个链表,请设计一个时间复杂度为O(n),额外空间复杂度为O(1)的算法,判断其是否为回文结构. 给定一个链表的头指针A,请返回一个bool值,代表其是否为回文结构.保证链表长度小于等 ...

  7. ssh: Could not resolve hostname git.*****-inc.com : Temporary failure in name resolution fatal: The remote end hung up unexpectedly

    问题出现的情景:使用git pull拉取开发的代码到测试服务器,报错: ssh: Could not resolve hostname git.****-inc.com : Temporary fai ...

  8. windows 下编译 OpenSSL1.0.2l 版

    1.需要的软件工具: microsoft visual studio2013(或2010以后其他版本) Perl 软件, 版本为strawberry - perl - 5.26.0.1 - 64bit ...

  9. golang GET 出现 x509: certificate signed by unknown authority

    我们编写一个Go程序来尝试与这个HTTPS server建立连接并通信. //gohttps/4-https/client1.gopackage main import (    "fmt& ...

  10. 开启MySQL远程访问权限 允许远程连接

    1.登陆mysql数据库 mysql -u root -p 查看user表 mysql> use mysql;Database changedmysql> select host,user ...