結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-30 21:37:02 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 506 bytes |
| コンパイル時間 | 811 ms |
| コンパイル使用メモリ | 78,552 KB |
| 最終ジャッジ日時 | 2025-01-15 16:53:32 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 39 WA * 1 |
ソースコード
#include <iostream>
#include <cmath>
using ldouble = long double;
constexpr ldouble INF = 1e14;
void solve() {
int x;
std::cin >> x;
ldouble ans = 0;
for (ldouble i = 2;; ++i) {
if (std::pow(i, x) > INF) break;
for (int p = x; std::pow(i, p) <= INF; ++p) {
ans += std::pow(i, -p);
}
}
std::cout << std::floor(ans * 1e6) << "\n";
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}