結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2020-10-30 22:18:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 506 bytes |
| コンパイル時間 | 1,577 ms |
| コンパイル使用メモリ | 167,632 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 01:08:47 |
| 合計ジャッジ時間 | 2,733 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 40 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
LL GCD(LL a, LL b) { return b ? GCD(b, a % b) : a; }
double F(LL j, LL x) {
double jb = j, xb = x;
return jb / (pow(jb, xb) * (jb - 1.));
}
int main() {
LL x; cin >> x;
double ans = 0.;
if (x == 2) {
ans = 1.;
}
else {
for (LL j = 2; log(j) * x < 30.; j++) {
ans += F(j, x);
}
}
LL ansi = ans * 1000000;
cout << ansi << endl;
return 0;
}
Nachia