結果
問題 |
No.639 An Ordinary Sequence
|
ユーザー |
![]() |
提出日時 | 2018-02-23 00:15:54 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 492 bytes |
コンパイル時間 | 84 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-04 10:05:13 |
合計ジャッジ時間 | 1,259 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | AC * 6 WA * 11 |
ソースコード
def sequence(n): if n==0: return 1 else: return sequence(int(n/3))+sequence(int(n/5)) def com(a,b): N=1 i=b if a==b: return 1 else: while i>1: N*=a a-=1 i-=1 while b>1: N/=b b-=1 return N N=int(input()) i=0 j=0 M=N total=0 while M>1: M=M/5 i+=1 while j<=i: total+=com(i,j)*sequence(int(M*((5/3)**j))) j+=1 print('%d'%total)