結果
問題 |
No.2829 GCD Divination
|
ユーザー |
|
提出日時 | 2024-08-02 21:48:12 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 579 bytes |
コンパイル時間 | 480 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 91,264 KB |
最終ジャッジ日時 | 2024-08-02 21:48:18 |
合計ジャッジ時間 | 5,085 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 1 TLE * 1 -- * 29 |
ソースコード
import sys, time, random from collections import deque, Counter, defaultdict input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 61 - 1 mod = 998244353 n = ii() def solve(x): if x == 1: return 0 xi = 1 / x ans = 1 for i in range(2, x + 1): if i * i > x: break if x % i == 0: ans += xi * solve(x // i) if x // i != i: ans += xi * solve(i) return ans * x / (x - 1) print(solve(n))