結果

問題 No.303 割れません
ユーザー cielciel
提出日時 2015-11-16 19:33:32
言語 Ruby
(3.3.0)
結果
AC  
実行時間 294 ms / 10,000 ms
コード長 154 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 11,464 KB
実行使用メモリ 33,740 KB
最終ジャッジ日時 2023-10-11 16:49:51
合計ジャッジ時間 4,808 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
15,688 KB
testcase_01 AC 94 ms
15,704 KB
testcase_02 AC 94 ms
15,712 KB
testcase_03 AC 184 ms
24,348 KB
testcase_04 AC 294 ms
33,740 KB
testcase_05 AC 291 ms
30,780 KB
testcase_06 AC 291 ms
31,728 KB
testcase_07 AC 239 ms
29,116 KB
testcase_08 AC 249 ms
29,180 KB
testcase_09 AC 248 ms
29,172 KB
testcase_10 AC 94 ms
15,716 KB
testcase_11 AC 291 ms
30,764 KB
testcase_12 AC 247 ms
30,068 KB
testcase_13 AC 221 ms
29,228 KB
testcase_14 AC 146 ms
21,456 KB
testcase_15 AC 141 ms
21,688 KB
testcase_16 AC 96 ms
15,856 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'matrix'
def fib(n)
	(Matrix[[1,1],[1,0]]**n)[1,0]
end

n=gets.to_i
if n==2
	p 3
	puts :INF
else
	r=fib(n)
	r-=fib(n/2)**2 if n%2==0
	p n
	p r
end
0