結果
問題 |
No.954 Result
|
ユーザー |
|
提出日時 | 2020-04-30 15:32:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 550 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-07-04 12:46:09 |
合計ジャッジ時間 | 2,281 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 7 |
other | AC * 29 |
ソースコード
import math a_list = [int(input()) for i in range(5)] def fibonacci(n): return round((pow((1 + math.sqrt(5)) / 2, n) - pow((1 - math.sqrt(5)) / 2, n)) / math.sqrt(5)) count = 0 for n in range(1, 72): if a_list[-1] == fibonacci(n): count += 1 if a_list[-1] == 1 and a_list[-2] == 2: n += 1 temp = 2 for i in range(n + 1, n + 5): if a_list[-temp] == fibonacci(i): count += 1 temp += 1 else: break break print(count)