結果

問題 No.639 An Ordinary Sequence
ユーザー Mario
提出日時 2019-07-08 18:23:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 298 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-10-09 05:05:51
合計ジャッジ時間 1,375 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 1 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import floor

#n = int(input())
n = 1000000000000000000

memo = {}

def a(i):
	
	if i in memo:
		return memo[i]
	else:
		memo[i] = a_inner(i)
		return memo[i]
	

def a_inner(i):
	
	if i == 0:
		return 1
	else:
		i3 = floor(i / 3)
		i5 = floor(i / 5)	
		return a(i3) + a(i5)
	
print(a(n))
0