結果
問題 | No.1235 ζ関数 |
ユーザー |
![]() |
提出日時 | 2020-10-06 11:45:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 389 bytes |
コンパイル時間 | 1,429 ms |
コンパイル使用メモリ | 160,304 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-20 10:42:29 |
合計ジャッジ時間 | 2,053 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; double my_pow(double x, ll n) { if (n == 0) return 1; if (n % 2 == 0) return my_pow(x * x, n / 2); return x * my_pow(x, n - 1); } int main() { int N; cin >> N; double s = 1; for (int i = 2; i < 10; i++) { s += my_pow((double)1 / i, N); } printf("%.9f\n", s); return 0; }