結果

問題 No.303 割れません
ユーザー cielciel
提出日時 2015-11-16 19:35:36
言語 Ruby
(3.3.0)
結果
AC  
実行時間 296 ms / 10,000 ms
コード長 130 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 11,528 KB
実行使用メモリ 33,976 KB
最終ジャッジ日時 2023-10-11 16:51:08
合計ジャッジ時間 4,568 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
15,760 KB
testcase_01 AC 92 ms
15,844 KB
testcase_02 AC 93 ms
15,664 KB
testcase_03 AC 195 ms
24,312 KB
testcase_04 AC 296 ms
33,976 KB
testcase_05 AC 287 ms
30,636 KB
testcase_06 AC 290 ms
31,872 KB
testcase_07 AC 238 ms
29,388 KB
testcase_08 AC 245 ms
29,496 KB
testcase_09 AC 245 ms
29,504 KB
testcase_10 AC 93 ms
15,688 KB
testcase_11 AC 290 ms
30,860 KB
testcase_12 AC 247 ms
30,456 KB
testcase_13 AC 220 ms
28,900 KB
testcase_14 AC 149 ms
21,568 KB
testcase_15 AC 141 ms
21,800 KB
testcase_16 AC 92 ms
15,700 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'matrix'
f=->(n){(Matrix[[1,1],[1,0]]**n)[1,0]}
if 2==n=gets.to_i
	p 3
	puts :INF
else
	p n
	p f[n]-(n%2>0?0:f[n/2]**2)
end
0