cf B. Vasily the Bear and Fly
http://codeforces.com/contest/336/problem/B
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std; int main()
{
int m,r;
scanf("%d%d",&m,&r);
double sum=;
for(int i=; i<m; i++)
{
if(i==) sum+=*r*m;
else if(i==) sum+=(*r+sqrt()*r)*(*m-);
else
{
sum+=(*m-*i)*(((*i-)+sqrt())*r);
}
}
printf("%lf\n",sum/m/m);
return ;
}
cf B. Vasily the Bear and Fly的更多相关文章
- cf A. Vasily the Bear and Triangle
http://codeforces.com/contest/336/problem/A #include <cstdio> #include <cstring> #includ ...
- codeforces 336D Vasily the Bear and Beautiful Strings(组合数学)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud Vasily the Bear and Beautiful Strings Vas ...
- codeforces 336C Vasily the Bear and Sequence(贪心)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud Vasily the Bear and Sequence Vasily the b ...
- C. Vasily the Bear and Sequence Codeforces 336C(枚举,思维)
C. Vasily the Bear and Sequence time limit per test 1 second memory limit per test 256 megabytes inp ...
- Codeforces Round #195 (Div. 2) D题Vasily the Bear and Beautiful Strings
这场CF,脑子乱死啊...C题,搞了很长时间,结束了,才想到怎么做.B题,没看,D题,今天看了一下,很不错的组合题. 如果n和m都挺多的时候 以下情况都是变为1,根据偶数个0,最后将会为1,奇数个0, ...
- CF #356 div1 A. Bear and Prime 100
题目链接:http://codeforces.com/contest/679/problem/A CF有史以来第一次出现交互式的题目,大致意思为选择2到100中某一个数字作为隐藏数,你可以询问最多20 ...
- Codeforces Round #195 (Div. 2) A. Vasily the Bear and Triangle
水题,注意数据范围即可 #include <iostream> #include <algorithm> #include <utility> using name ...
- codeforces C. Vasily the Bear and Sequence 解题报告
题目链接:http://codeforces.com/problemset/problem/336/C 题目意思:给出一个递增的正整数序列 a1, a2, ..., an,要求从中选出一堆数b1, b ...
- codeforces A. Vasily the Bear and Triangle 解题报告
题目链接:http://codeforces.com/problemset/problem/336/A 好简单的一条数学题,是8月9日的.比赛中没有做出来,今天看,从pupil变成Newbie了,那个 ...
随机推荐
- cf Ping-Pong (Easy Version)
http://codeforces.com/contest/320/problem/B 这道题看了很长时间没看懂, 就是个dfs: #include <cstdio> #include & ...
- xdebug及webgrind的联用
参考URL: http://www.tuicool.com/articles/ERFNva http://blog.sina.com.cn/s/blog_635833b3010127q5.html h ...
- python的工作记录B
这次很强了.就差最后一步,判断一下SVN的版本是否是真的库里的. #!/usr/bin/env python # -*- coding: utf-8 -*- import os,sys,command ...
- FJ省队集训DAY2 T2
思路:我们可以考虑三角剖分,这样问题就变成考虑三角形的选取概率和三角形内有多少个点了. 先用树状数组预处理出三角剖分的三角形中有多少个点,然后用线段树维护,先用原点极角排序,然后枚举i,再以i极角排序 ...
- 自制单片机之七……扩展:DS18B20温度测量
DS18B20数字温度测量传感器,网上介绍很多,我就不罗嗦了.见图 DS18B20与前产品DS1820的不同: DS18B20继承了DS1820的全部优点,并做了如下改进 1.供电范围扩大为3.0-- ...
- VC6.0 编译 gdlib 库
环境 WinXP, MSVC6.0 1 从 https://bitbucket.org/libgd/gd-libgd/downloads 下载最新版本 libgd 2 可以用 nmake 编译 w ...
- JVM基础和调优(四)
垃圾回收算法中的一些问题 再上一遍中,说道JVM并不是采用一种垃圾回收的方法,因为不同的内存块采取的方法是不样的,那么:为什么要分块?为什么不采用同一种方法回收垃圾,这样不是更加的统一吗? 分块的垃圾 ...
- DDMS files not found: tools\hprof-conv.exe
最近在Eclipse下每次更新ADT和SDK后都报一些错误,比如 DDMS files not found: D:\android-sdk-windows-1.6_r1\android-sdk-win ...
- windows下体验Redis
Redis 是一个高性能的key-value数据库, 使用内存作为主存储,数据访问速度非常快,当然它也提供了两种机制支持数据持久化存储.比较遗憾的是,Redis项目不直接支持Windows,Windo ...
- 【技术文档】《算法设计与分析导论》R.C.T.Lee等·第7章 动态规划
由于种种原因(看这一章间隔的时间太长,弄不清动态规划.分治.递归是什么关系),导致这章内容看了三遍才基本看懂动态规划是什么.动态规划适合解决可分阶段的组合优化问题,但它又不同于贪心算法,动态规划所解决 ...