結果
問題 |
No.639 An Ordinary Sequence
|
ユーザー |
![]() |
提出日時 | 2018-02-23 00:21:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 530 bytes |
コンパイル時間 | 125 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-10-04 10:23:41 |
合計ジャッジ時間 | 1,298 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 17 |
ソースコード
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 or b==0: 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: print('com=%d i=%d j=%d\n',com(i,j),i,j) total+=com(i,j)*sequence(int(M*((5/3)**j))) j+=1