結果
| 問題 |
No.2973 シュニレルマン積分入門
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-11-29 22:28:34 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 397 bytes |
| コンパイル時間 | 217 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 11,392 KB |
| 最終ジャッジ日時 | 2024-11-29 22:28:40 |
| 合計ジャッジ時間 | 5,039 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 20 |
ソースコード
import fractions
from functools import lru_cache
N=int(input())
@lru_cache(maxsize=None)
def A(N):
if N==0:
return fractions.Fraction(1)
if N==1:
return fractions.Fraction(1)
if N>0:
return A(N-1)-10*A(N-2)
else:
return (A(N+1)-A(N+2))/10
ab=A(-N)
b,a=ab.denominator,ab.numerator
if N-1<0:
b*=10**(-N+1)
else:
a*=10**(N-1)
print(a,b,sep="/")
vwxyz