結果

問題 No.303 割れません
ユーザー 👑 kmjpkmjp
提出日時 2015-11-14 00:25:29
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 374 bytes
コンパイル時間 1,248 ms
コンパイル使用メモリ 78,060 KB
実行使用メモリ 76,688 KB
最終ジャッジ日時 2023-10-11 17:31:26
合計ジャッジ時間 13,365 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,688 KB
testcase_01 AC 75 ms
76,640 KB
testcase_02 AC 75 ms
76,664 KB
testcase_03 TLE -
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 #

import sys
import math

L=input()

if L==2:
	print 3
	print "INF"
else:
	if L<10:
		A=[1,1,1]
		for i in range(3,303):
			A.append(A[-1]+A[-2])

		ret = A[L]
		if L%2 == 0:
			ret -= A[L/2]*A[L/2]
	else:
		a=1
		b=1
		t=0
		for i in range(3,L+1):
			if i%100==0:
				print i
			a,b = b,a+b
			
			if L%2==0 and i == L/2:
				t = b
		
		ret = b - t*t
	
	print L
	print ret
	
0