結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
15,744 KB
testcase_01 AC 95 ms
15,788 KB
testcase_02 AC 97 ms
15,684 KB
testcase_03 AC 187 ms
24,296 KB
testcase_04 AC 296 ms
33,736 KB
testcase_05 AC 290 ms
30,780 KB
testcase_06 AC 293 ms
31,644 KB
testcase_07 AC 242 ms
29,120 KB
testcase_08 AC 251 ms
29,448 KB
testcase_09 AC 250 ms
29,628 KB
testcase_10 AC 96 ms
15,632 KB
testcase_11 AC 293 ms
30,676 KB
testcase_12 AC 251 ms
30,396 KB
testcase_13 AC 225 ms
28,860 KB
testcase_14 AC 146 ms
21,512 KB
testcase_15 AC 143 ms
21,720 KB
testcase_16 AC 96 ms
15,596 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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