結果
| 問題 | No.639 An Ordinary Sequence |
| コンテスト | |
| ユーザー |
kwnwsdnc
|
| 提出日時 | 2018-02-23 00:29:56 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 393 bytes |
| 記録 | |
| コンパイル時間 | 521 ms |
| コンパイル使用メモリ | 20,572 KB |
| 実行使用メモリ | 28,312 KB |
| 最終ジャッジ日時 | 2026-04-20 07:17:16 |
| 合計ジャッジ時間 | 5,054 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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