結果
| 問題 |
No.954 Result
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-01-03 21:57:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 722 bytes |
| コンパイル時間 | 143 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-11-22 19:36:35 |
| 合計ジャッジ時間 | 2,433 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 7 |
| other | AC * 27 WA * 2 |
ソースコード
# 2020/01/03
a=[int(input()) for _ in range(5)]
# res=[]
# for i in range(4):
# if a[i]<=a[i+1]:
# if (a[i]==0
# or (res.count(1)>1 and a[i]==1)
# or a[i]!=1 and a[i] in res):
# break
# else:
# res.append(a[i])
# else:
# res.append(a[i])
# break
# else:res.append(a[-1])
fib=[0,1]
num=0
while num<=max(a):
num=fib[-1]+fib[-2]
fib.append(num)
if a[-1]==1 and a[-2]!=1:
bgn=2
cnt=1
a.pop()
else:
bgn=1
cnt=0
e=a.pop()
flag=False
for i in range(bgn,len(fib)):
if flag:
if fib[i]!=e:break
else:
if e!=fib[i]:continue
flag=True
cnt+=1
if not a:break
e=a.pop()
print(cnt)