結果

問題 No.303 割れません
ユーザー 👑 kmjpkmjp
提出日時 2015-11-13 23:37:52
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 343 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 77,556 KB
実行使用メモリ 76,532 KB
最終ジャッジ日時 2023-10-11 16:55:32
合計ジャッジ時間 12,392 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
76,532 KB
testcase_01 AC 75 ms
76,140 KB
testcase_02 AC 76 ms
76,368 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 4
	print 1
else:
	if L<100:
		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):
			a,b = b,a+b
			
			if L%2==0 and i == L/2:
				t = b
		
		ret = b - t*t
	
	print L
	print ret
	
0