結果

問題 No.954 Result
コンテスト
ユーザー tonnnura172
提出日時 2020-04-02 00:08:04
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,107 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 445 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 21,200 KB
最終ジャッジ日時 2026-03-25 20:40:41
合計ジャッジ時間 9,975 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 7
other RE * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul, add
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a = [INT() for _ in range(5)][::-1]

if a[0] == 1 and a[1] == 2:
	tmp1 = 1
	tmp2 = 1
	num = 1
else:
	tmp1 = 0
	tmp2 = 1
	num = 1

i = 0
while num < 10**15:
	if a[0] == num:
		for i in range(1, 5):
			num = tmp1+tmp2
			tmp1, tmp2 = tmp2, num
			if a[i] != num:
				break
		else:
			i += 1
		break

	num = tmp1+tmp2
	tmp1, tmp2 = tmp2, num
print(i)
0