結果
| 問題 |
No.639 An Ordinary Sequence
|
| コンテスト | |
| ユーザー |
kwnwsdnc
|
| 提出日時 | 2018-02-23 00:29:56 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 393 bytes |
| コンパイル時間 | 196 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 21,248 KB |
| 最終ジャッジ日時 | 2024-10-04 10:55:30 |
| 合計ジャッジ時間 | 4,430 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 16 |
ソースコード
def sequence(n):
if n==0:
return 1
else:
return sequence(int(n/3))+sequence(int(n/5))
def com(a,b):
if b==0 or a==b:
return 1
elif b==1:
return a
return com(a-1,b-1)+com(a-1,b)
N=int(input())
i=0
j=0
total=0
while N>1:
N=N/5
i+=1
while j<=i:
total+=com(i,j)*sequence(int(N*((5/3)**j)))
j+=1
print('%d'%total)
kwnwsdnc