結果

問題 No.303 割れません
ユーザー 👑 kmjpkmjp
提出日時 2015-11-14 01:29:46
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 280 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 78,048 KB
実行使用メモリ 266,128 KB
最終ジャッジ日時 2023-10-11 17:37:43
合計ジャッジ時間 11,933 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,444 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

L=input()

def fib(L):
	v1=v2=a=b=c=1
	d=0
	L-=2
	while L:
		if L%2:
			v2,v1=a*v2+b*v1,c*v2+d*v1
		L /= 2
		bc=b*c
		a,b,c,d=a*a+bc,b*(a+d),c*(a+d),bc+d*d
	return v2


if L==2:
	print 3
	print "INF"
else:
	ret = fib(L)
	
	if L%2==0:
		ret -= fib(L/2)**2
	
	print L
	print ret
	
0