結果
| 問題 |
No.2973 シュニレルマン積分入門
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-11-29 22:29:56 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 309 bytes |
| コンパイル時間 | 204 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,392 KB |
| 最終ジャッジ日時 | 2024-11-29 22:30:01 |
| 合計ジャッジ時間 | 4,578 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 21 |
ソースコード
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
ans=-A(N-2)
print(ans)
vwxyz