結果
問題 | No.303 割れません |
ユーザー |
|
提出日時 | 2018-01-05 11:02:16 |
言語 | Python2 (2.7.18) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 416 bytes |
コンパイル時間 | 363 ms |
コンパイル使用メモリ | 7,332 KB |
実行使用メモリ | 11,532 KB |
最終ジャッジ日時 | 2024-12-23 05:53:28 |
合計ジャッジ時間 | 92,256 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 TLE * 4 |
ソースコード
#yuki_303 def mul(a,b): return [a[0]*b[0]+a[1]*b[2], a[0]*b[1]+a[1]*b[3], a[2]*b[0]+a[3]*b[2], a[2]*b[1]+a[3]*b[3]] def fib(n): if n<=1: return n res=[1, 0, 0, 1] mx =[1, 1, 1, 0] while n>0: if n%2: res=mul(mx, res) mx=mul(mx, mx) n/=2 return res[2] l=int(raw_input()) if l==2: print 3 print 'INF' else: print l res=fib(l) if l%2==0: res-=fib(l/2)**2 print res