hdu5879 Cure
题目链接:hdu5879 Cure
题解:用字符串输入。n很大时答案趋近与(π^2)/6。
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<queue>
#include<cmath>
using namespace std;
const int N = ;
const double pi = acos(-1.0);
char a[N];
double sum[N]; int main(){
int i, l, x;
for(int i = ; i < N; ++i)
sum[i] = sum[i - ] + 1.0/i/i;
while(~scanf("%s",a)){
l = strlen(a);
if(l >= )printf("%.5lf\n",pi*pi/);
else{
for(x = i = ; i < l; ++i)
x = * x + a[i] - '';
printf("%.5lf\n", sum[x]);
}
}
return ;
}
hdu5879 Cure的更多相关文章
- 16年青岛网络赛 1002 Cure
题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1002&cid=723 Cure Time Limit: 30 ...
- HDU 5879 Cure
Cure Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- HDU5879(打表)
Cure Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- UEBA 学术界研究现状——用户行为异常检测思路:序列挖掘prefixspan,HMM,LSTM/CNN,SVM异常检测,聚类CURE算法
论文 技术分析<关于网络分层信息泄漏点快速检测仿真> "1.基于动态阈值的泄露点快速检测方法,采样Mallat算法对网络分层信息的离散采样数据进行离散小波变换;利用滑动窗口对该尺 ...
- Cure HDU - 5879(预处理+技巧)
Cure Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- CodeForcesGym 100641B A Cure for the Common Code
A Cure for the Common Code Time Limit: 3000ms Memory Limit: 262144KB This problem will be judged on ...
- HDU 5879 Cure -2016 ICPC 青岛赛区网络赛
题目链接 题意:给定一个数n,求1到n中的每一项的平方分之一的累加和. 题解:题目没有给数据范围,而实际上n很大很大超过long long.因为题目只要求输出五位小数,我们发现当数大到一定程度时值是固 ...
- 2016 ACM/ICPC Asia Regional Qingdao Online HDU5879
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5879 解法:我们知道到某个极限之后结果相同,所以找到那个极限,其他保存之后输出就好了 #include&l ...
- CF 148A Insomnia cure
题目链接:传送门 题目大意:就是给四个数,和一个d,问1-d中有多少个数字不是那四个数的倍数; 这道题的d数据很小直接暴力可以过: 暴力代码:时间复杂度O(1): #include<stdio. ...
随机推荐
- Writing Text File From A Tabular Block In Oracle Forms
The example given below for writing text file or CSV using Text_IO package from a tabular block in O ...
- DJANGO基础学习之转义总结:escape,autoescape,safe,mark_safe
何谓转义?就是把html语言的关键字过滤掉.例如,<div>就是html的关键字,如果要在html页面上呈现<div>,其源代码就必须是<div> PS:转义其实就 ...
- [Effective Java]第三章 对所有对象都通用的方法
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- Linux简介与厂商版本
Linux简介与厂商版本 作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 1. Linux简介 Linux可以有狭义和广义两种 ...
- Maven聚合与继承
分别为两种不同形式的聚合 相关代码如下: https://github.com/humeng126/account-parent_1 https://github.com/humeng126/acco ...
- iOS - UITouch
前言 NS_CLASS_AVAILABLE_IOS(2_0) @interface UITouch : NSObject @available(iOS 2.0, *) public class UIT ...
- iOS之UIImagePickerController的应用
直接代码敬之 @import MobileCoreServices; @import AVFoundation; <UIImagePickerControllerDelegate,UINavig ...
- SDL1.2到2.0的迁移指南(转)
里面有些单词不好翻译所以放在开头,以备查验. BLock Image Transfer, a computer graphics operation in which two bitmap patte ...
- SecureCRT设置
SecureCRT设置 文章来源:http://blog.csdn.net/dongqinliuzi/article/details/39890569 本文主要介绍SecureCRT的使用方法和技巧. ...
- Hexo+github 搭建个人博客(一)
一.软件环境准备 1.安装git windows下载exe安装:linux 执行 apt-get install git-core 安装 2.安装Node.js windows使用 msi 文件进行安 ...