結果
問題 | No.53 悪の漸化式 |
ユーザー |
![]() |
提出日時 | 2021-08-15 00:54:14 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 144 ms / 5,000 ms |
コード長 | 559 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 81,968 KB |
実行使用メモリ | 89,856 KB |
最終ジャッジ日時 | 2024-10-06 05:13:39 |
合計ジャッジ時間 | 4,067 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import bisectimport copyimport decimalimport fractionsimport heapqimport itertoolsimport mathimport randomimport sysfrom collections import deque,defaultdictfrom functools import lru_cache,reducefrom heapq import heappush,heappop,heapify,_heappop_max,_heapify_maxdef _heappush_max(heap,item):heap.append(item)heapq._siftdown_max(heap,0,len(heap)-1)from math import gcd as Gcdread=sys.stdin.readreadline=sys.stdin.readlinereadlines=sys.stdin.readlinesN=int(readline())if N==0:ans=4else:ans=pow(3,N)/pow(4,N-1)print(ans)