結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
15,740 KB
testcase_01 AC 94 ms
15,716 KB
testcase_02 AC 96 ms
15,668 KB
testcase_03 AC 186 ms
24,452 KB
testcase_04 AC 297 ms
33,808 KB
testcase_05 AC 289 ms
30,616 KB
testcase_06 AC 291 ms
31,764 KB
testcase_07 AC 235 ms
29,148 KB
testcase_08 AC 245 ms
29,616 KB
testcase_09 AC 245 ms
29,552 KB
testcase_10 AC 94 ms
15,568 KB
testcase_11 AC 290 ms
30,684 KB
testcase_12 AC 247 ms
30,384 KB
testcase_13 AC 220 ms
29,012 KB
testcase_14 AC 146 ms
21,700 KB
testcase_15 AC 142 ms
21,532 KB
testcase_16 AC 94 ms
15,568 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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