codeforces 492B. Vanya and Lanterns 解题报告
题目链接:http://codeforces.com/problemset/problem/492/B
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
+ ;
double a[maxn];
double l[maxn], r[maxn];
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif // ONLINE_JUDGE
int n;
double ll;
while (scanf("%d%lf", &n, &ll) != EOF)
{
; i < n; i++)
scanf("%lf", &a[i]);
sort(a, a+n);
memset(l, , sizeof(l));
memset(r, , sizeof(r));
l[] = a[];
r[n-] = ll - a[n-];
], r[n-]);
; i < n; i++)
{
)
r[i] = (a[i+] - a[i]) / ;
else
{
l[i] = (a[i] - a[i-]) / ;
r[i] = (a[i+] - a[i]) / ;
}
ans = max(max(l[i], r[i]), ans);
}
printf("%.10lf\n", ans);
}
;
}
codeforces 492B. Vanya and Lanterns 解题报告的更多相关文章
- codeforces 492C. Vanya and Exams 解题报告
题目链接:http://codeforces.com/problemset/problem/492/C 题目意思:给出 3 个整数:n, r, avg.然后有 n 行,每行有两个数:第 i 行有 ...
- Codeforces Educational Round 92 赛后解题报告(A-G)
Codeforces Educational Round 92 赛后解题报告 惨 huayucaiji 惨 A. LCM Problem 赛前:A题嘛,总归简单的咯 赛后:A题这种**题居然想了20m ...
- codeforces 476C.Dreamoon and Sums 解题报告
题目链接:http://codeforces.com/problemset/problem/476/C 题目意思:给出两个数:a 和 b,要求算出 (x/b) / (x%b) == k,其中 k 的取 ...
- Codeforces Round #382 (Div. 2) 解题报告
CF一如既往在深夜举行,我也一如既往在周三上午的C++课上进行了virtual participation.这次div2的题目除了E题都水的一塌糊涂,参赛时的E题最后也没有几个参赛者AC,排名又成为了 ...
- codeforces 507B. Amr and Pins 解题报告
题目链接:http://codeforces.com/problemset/problem/507/B 题目意思:给出圆的半径,以及圆心坐标和最终圆心要到达的坐标位置.问最少步数是多少.移动见下图.( ...
- codeforces 500B.New Year Permutation 解题报告
题目链接:http://codeforces.com/problemset/problem/500/B 题目意思:给出一个含有 n 个数的排列:p1, p2, ..., pn-1, pn.紧接着是一个 ...
- codeforces B. Xenia and Ringroad 解题报告
题目链接:http://codeforces.com/problemset/problem/339/B 题目理解不难,这句是解题的关键 In order to complete the i-th ta ...
- codeforces 462C Appleman and Toastman 解题报告
题目链接:http://codeforces.com/problemset/problem/461/A 题目意思:给出一群由 n 个数组成的集合你,依次循环执行两种操作: (1)每次Toastman得 ...
- codeforces 460A Vasya and Socks 解题报告
题目链接:http://codeforces.com/problemset/problem/460/A 题目意思:有一个人有 n 对袜子,每天早上会穿一对,然后当天的晚上就会扔掉,不过他会在 m 的倍 ...
随机推荐
- C++你不知道的那些事儿—C++语言的15个晦涩特性
这个列表收集了 C++ 语言的一些晦涩(Obscure)特性,是我经年累月研究这门语言的各个方面收集起来的.C++非常庞大,我总是能学到一些新知识.即使你对C++已了如指掌,也希望你能从列表中学到一些 ...
- XMAL语法系列之-(2)---WPF控件继承图
WPF控件继承图 1 FrameworkElement 1.1 Panel(面板类元素) 1.1.1 Canvas 1.1.2 DockPanel 1.1.3 Grid 1.1.4 TabPanel ...
- uva10870 递推关系Recurrences
Consider recurrent functions of the following form:f(n) = a1f(n - 1) + a2f(n - 2) + a3f(n - 3) + : : ...
- php正则
PHP代码 $str = preg_replace("/(<a.*?>)(.*?)(<\/a>)/", '\1<span class="li ...
- c# random string
var randomString= Path.GetRandomFileName(); 返回 ar1opgzw.1gp 详细 http://www.dotnetperls.com/random-str ...
- 第一款支持容器和云部署的开源数据库Neo4j 3.0
导读 Neo4j 3.0.0 正式发布,这是 Neo4j 3.0 系列的第一个版本.此版本对内部架构进行了全新的设计:提供给开发者更强大的生产力:提供更广阔的部署选择.Neo4j 3.0 被认为是世界 ...
- C# 游戏服务器框架
http://www.supersocket.net/ http://blog.csdn.net/zhuweisky/article/details/9055989 http://blog.csdn. ...
- 流媒体(音频 AudioStreamer)
AudioStreamer 在github可以搜索到, 专门播放流媒体(音频)
- NumPy的详细教程
原文 http://blog.csdn.net/lsjseu/article/details/20359201 主题 NumPy 先决条件 在阅读这个教程之前,你多少需要知道点python.如果你想 ...
- Genymotion加速下载虚拟镜像速度慢失败Connection timeout
Genymotion也算是个android的模拟程序了, Add new device后下载速度太慢了,容易失败 解决方法有二: 1.设置HTTP代理,在Setting->Network,自己设 ...