結果

問題 No.639 An Ordinary Sequence
ユーザー coro65536coro65536
提出日時 2018-01-27 00:00:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 465 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 64,036 KB
最終ジャッジ日時 2023-08-27 20:26:10
合計ジャッジ時間 5,868 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 134 ms
30,528 KB
testcase_03 AC 133 ms
30,452 KB
testcase_04 AC 134 ms
30,452 KB
testcase_05 AC 134 ms
30,520 KB
testcase_06 AC 133 ms
30,452 KB
testcase_07 AC 135 ms
30,580 KB
testcase_08 AC 134 ms
30,600 KB
testcase_09 AC 136 ms
30,608 KB
testcase_10 AC 135 ms
30,508 KB
testcase_11 AC 133 ms
30,608 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 133 ms
30,732 KB
testcase_18 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

# C
import math
import scipy.misc as scm

N = int(input())

if N == 0:
    print(1)
    quit()
if N == 1 or N == 2:
    print(2)
    quit()

arr = [[0 for j in range(int(math.log(N, 5))+1)] for i in range(int(math.log(N, 3))+1)]  # 1 indexed

ans = 2 + int(math.log(N, 5)) + int(math.log(N, 3))

for i in range(1, int(math.log(N, 3))+1):
    for j in range(1, int(math.log(N, 5))+1):
        if 3**i * 5**j <= N:
            ans += scm.comb(i+j, i, 1)

print(ans)

0