16年青岛网络赛 1002 Cure
题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1002&cid=723
Cure
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total
Submission(s): 7400 Accepted Submission(s):
1099
, we only want to know the sum of 1/k2
where k
from 1
to n
.
For each test case, there
is a single line, containing a single positive integer n
.
The input file is at most 1M.
decimal point.
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<algorithm>
using namespace std; int main ()
{
double n,m;
int i;
while(~scanf("%lf",&n)){
m=;
if(n<){ //对于12万以内的数按要求计算结果即可,超过12万输出1.64493
for(i=;i<=n;i++){
m+=1.0/i/i;
}
printf("%.5lf\n",m);
}else{
printf("%.5lf\n",1.64493);
}
}
return ;
}
16年青岛网络赛 1002 Cure的更多相关文章
- 16年青岛网络赛 1001 I Count Two Three
题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1001&cid=723 I Count Two ThreeTi ...
- HDU 4739 Zhuge Liang's Mines (2013杭州网络赛1002题)
Zhuge Liang's Mines Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Othe ...
- HDU 5880 Family View (2016 青岛网络赛 C题,AC自动机)
题目链接 2016 青岛网络赛 Problem C 题意 给出一些敏感词,和一篇文章.现在要屏蔽这篇文章中所有出现过的敏感词,屏蔽掉的用$'*'$表示. 建立$AC$自动机,查询的时候沿着$fa ...
- 2016ACM-ICPC Qingdao Online青岛网络赛题解
TonyFang+Sps+我=5/12 滚了个大粗 2016年9月21日16:42:36 10题完工辣 01 题意:求形同的数中大于n的最小值 题解:预处理所有的(5194个),在这里面二分 #inc ...
- 2018 icpc 青岛网络赛 J.Press the Button
Press the Button Time Limit: 1 Second Memory Limit: 131072 KB BaoBao and DreamGrid are playing ...
- HDU 6212 Zuma 2017青岛网络赛 区间DP
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6212 解法:看了眼题就发现这个BZOJ 1032不是一毛一样?但是BZOJ上那是个巨坑,数据有错,原来 ...
- 青岛网络赛J-Press the button【暴力】
Press the Button Time Limit: 1 Second Memory Limit: 131072 KB BaoBao and DreamGrid are playing ...
- The 2018 ACM-ICPC Asia Qingdao Regional Contest(青岛网络赛)
A Live Love 水 #include <algorithm> #include<cstdio> #include<cstring> using namesp ...
- HDU5887 Herbs Gathering(2016青岛网络赛 搜索 剪枝)
背包问题,由于数据大不容易dp,改为剪枝,先按性价比排序,若剩下的背包空间都以最高性价比选时不会比已找到的最优解更好时则剪枝,即 if(val + (LD)pk[d].val / (LD)pk[d]. ...
随机推荐
- 配置rt-thread开发环境(配置系统,生成系统镜像)
配置rt-thread开发环境 ===========Python============= 1.Python的下载地址:http://www.python.org/ftp/python/ 链接中有各 ...
- 448. Find All Numbers Disappeared in an Array Add to List
题目描述 题目分析 有个[1,n]的条件要充分利用起来. 题目代码 public class Solution { public List<Integer> findDisappeared ...
- centos7 中libgdiplus的安装
yum -y install libtool* git clone git://github.com/mono/libgdiplus.git cd libgdiplus ./autogen.sh -- ...
- jsp标签精华(持续更新中)
<%@ taglib uri="/struts-tags" prefix="s" %> <%@ taglib uri="http:/ ...
- js插入动态脚本
原文章:https://www.w3cmm.com/dom/insert-javascript.html 动态脚本指的是在页面加载时不存在,但将来的某一时刻通过修改该DOM动态添加的脚本.和操作HTM ...
- 页面加载后resize页面布局
在我们写web的时候,有的时候页面加载完以后,布局位置有一些问题,手动改变窗口大小后则正常显示位置. 其实,我们手动改变窗口大小,是执行了resize方法. share一下兼容方法: coffee c ...
- node.js基础 1之基本概念常识
node.js 好牛逼的样子哦 很火,很腻害~~~~ 有关node.js的版本常识: 一般用最新的稳定版本,非稳定版本用于测试,其中包括api的不稳定等. 起一个web服务器: ndoejs可以自定义 ...
- Xshell 登录 AWS CentOS 出现“所选择的用户秘钥未在远程主机上注册“,最终解决办法!
其实就是 登录用户名错了,是 root,不是centos 也不是 ec2-user ! Xshell 连接配置界面如下 最重要是 登录授权配置 最后,登录成功! 就这么简单
- 学习笔记Jmail收发邮件
一.利用Jmail发送邮件 1/// <summary> 2/// 利用Jmail发送邮件 3/// </summary> 4private void SendMailByJ ...
- 【转载】 ionic 的 下拉刷新 与 上拉加载
这篇文章是讲解 Ioinc中怎么实现 下拉刷新和上拉加载的.也是我们日常做项目是必不可少的功能.有兴趣的小伙伴可以来学习一下. 更多关于 IONIC 的资源: http://www.aliyue.ne ...