結果
問題 |
No.954 Result
|
ユーザー |
|
提出日時 | 2020-04-30 15:28:50 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 547 bytes |
コンパイル時間 | 345 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-12-15 22:47:26 |
合計ジャッジ時間 | 2,726 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 7 |
other | AC * 27 WA * 2 |
ソースコード
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(71): 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)