結果

問題 No.2973 シュニレルマン積分入門
ユーザー 遭難者
提出日時 2023-08-29 15:36:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 592 ms
コンパイル使用メモリ 81,916 KB
実行使用メモリ 88,904 KB
最終ジャッジ日時 2024-11-29 20:50:49
合計ジャッジ時間 6,755 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
from fractions import Fraction

input = stdin.readline


n = int(input())
if n > 0:
    print("0/1")
elif n < 0:
    n *= -1
    a = [Fraction(0) for i in range(n + 1)]
    a[0] = Fraction(1, 10)
    a[1] = Fraction(-1, 100)
    for i in range(2, n + 1):
        a[i] = -(a[i - 1] + a[i - 2]) / 10
    ans_x, ans_y = a[n].numerator, a[n].denominator
    mul = 10**100 // ans_y
    ans_x *= mul
    ans_y *= mul
    print(ans_x, ans_y, sep="/")
else:
    print("1/10")
0