[HDOJ5879]Cure(求极限,打表)
2016-09-19 16:44
183 查看
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5879
#include <algorithm> #include <iostream> #include <iomanip> #include <cstring> #include <climits> #include <complex> #include <fstream> #include <cassert> #include <cstdio> #include <bitset> #include <vector> #include <deque> #include <queue> #include <stack> #include <ctime> #include <set> #include <map> #include <cmath> using namespace std; #define fr first #define sc second #define cl clear #define BUG puts("here!!!") #define W(a) while(a--) #define pb(a) push_back(a) #define Rint(a) scanf("%d", &a) #define Rll(a) scanf("%I64d", &a) #define Rs(a) scanf("%s", a) #define Cin(a) cin >> a #define FRead() freopen("in", "r", stdin) #define FWrite() freopen("out", "w", stdout) #define Rep(i, len) for(int i = 0; i < (len); i++) #define For(i, a, len) for(int i = (a); i < (len); i++) #define Cls(a) memset((a), 0, sizeof(a)) #define Clr(a, x) memset((a), (x), sizeof(a)) #define Full(a) memset((a), 0x7f7f7f, sizeof(a)) #define lrt rt << 1 #define rrt rt << 1 | 1 #define pi 3.14159265359 #define RT return #define lowbit(x) x & (-x) #define onecnt(x) __builtin_popcount(x) typedef long long LL; typedef long double LD; typedef unsigned long long ULL; typedef pair<int, int> pii; typedef pair<string, int> psi; typedef pair<LL, LL> pll; typedef map<string, int> msi; typedef vector<int> vi; typedef vector<LL> vl; typedef vector<vl> vvl; typedef vector<bool> vb; const int maxn = 1000010; char tn[2*maxn]; double ret[maxn]; LL n; signed main() { Cls(ret); double tmp = .0; For(i, 1, 1000000) { tmp += double(1.0)/double((LL)i*i); ret[i] = tmp; } while(~Rs(tn)) { int len = strlen(tn); if(len >= 7) n = 999999; else sscanf(tn, "%I64d", &n); printf("%.5lf\n", ret ); } RT 0; }
相关文章推荐
- hdoj5879Cure
- hdu 5879 Cure 打表
- hdoj-5879-Cure
- HDU-5879-Cure-打表模拟(水)
- hdu 5879 -Cure 暴力打表
- [HDU 5879] Cure (数学+打表)
- HDU 5879 Cure(打表预处理)
- HDU 5879 Cure(打表)qingdao网赛
- hdu_5879_Cure(打表)
- HDU-5879 Cure(精度)(极限)
- hdoj 5879 Cure
- [HDOJ6154] CaoHaha's staff(规律, 打表, 二分)
- HDU 5879 - Cure【2016 ACM 区域赛青岛赛区网络赛】
- HDOJ 题目1084 钱币兑换问题(母函数,打表)
- HDOJ题目1848Fibonacci again and again(sg博弈,打表模板)
- hdoj--5104--Primes Problem(素数打表)
- hdoj 天气情况 1437 (打表&数学)
- hdoj 4548 美素数 【打表】
- Bestcoder #21&&hdoj 5139 Formula 【另类打表之分块】
- hdoj 分拆素数和 2089 (素数打表++枚举)