結果
問題 |
No.1273 はじめのζ関数
|
ユーザー |
|
提出日時 | 2020-11-01 02:24:54 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 607 bytes |
コンパイル時間 | 2,002 ms |
コンパイル使用メモリ | 193,136 KB |
最終ジャッジ日時 | 2025-01-15 18:42:54 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 39 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) const double EPS = 1e-18; const double PI = acos(-1); double calc(int x) { if (x == 2) return pow(PI, 2) / 6.0 - 1.0; double ret = 0; for (int i = 2; ; i++) { double tmp = pow(1.0/i, x); if (tmp < EPS) break; ret += tmp; } return ret; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); double ret = 0; int x; cin >> x; for (int i = x; ; i++) { if (pow(1.0/2, i) < EPS) break; ret += calc(i); } cout << int(ret * 1e6) << endl; return 0; }