結果

問題 No.537 ユーザーID
ユーザー FVRChanFVRChan
提出日時 2018-05-11 18:55:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 1,107 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 10,028 KB
最終ジャッジ日時 2023-09-10 12:37:54
合計ジャッジ時間 2,426 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,092 KB
testcase_01 AC 17 ms
8,236 KB
testcase_02 AC 16 ms
8,260 KB
testcase_03 AC 17 ms
8,332 KB
testcase_04 AC 17 ms
8,336 KB
testcase_05 AC 17 ms
8,340 KB
testcase_06 AC 16 ms
8,192 KB
testcase_07 AC 17 ms
8,292 KB
testcase_08 AC 17 ms
8,196 KB
testcase_09 RE -
testcase_10 AC 17 ms
8,004 KB
testcase_11 AC 17 ms
8,352 KB
testcase_12 AC 17 ms
8,196 KB
testcase_13 AC 18 ms
8,336 KB
testcase_14 AC 16 ms
8,336 KB
testcase_15 AC 17 ms
8,232 KB
testcase_16 AC 17 ms
8,420 KB
testcase_17 AC 17 ms
8,200 KB
testcase_18 AC 18 ms
8,424 KB
testcase_19 AC 22 ms
8,404 KB
testcase_20 AC 125 ms
8,136 KB
testcase_21 AC 18 ms
8,384 KB
testcase_22 AC 16 ms
8,412 KB
testcase_23 AC 17 ms
8,092 KB
testcase_24 AC 17 ms
8,136 KB
testcase_25 AC 17 ms
8,400 KB
testcase_26 AC 17 ms
8,432 KB
testcase_27 AC 17 ms
8,340 KB
testcase_28 AC 22 ms
9,220 KB
testcase_29 AC 27 ms
10,028 KB
testcase_30 AC 26 ms
9,928 KB
testcase_31 AC 16 ms
8,364 KB
testcase_32 AC 17 ms
8,432 KB
testcase_33 AC 21 ms
9,064 KB
testcase_34 AC 17 ms
8,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff
def divisor_sub(p, q):
    a = []
    for i in range(0, q + 1):
        a.append(p ** i)
    return a

def divisor(n):
    xs = factorization(n)
    ys = divisor_sub(xs[0][0], xs[0][1])
    for p, q in xs[1:]:
        ys = [x * y for x in divisor_sub(p, q) for y in ys]
    return sorted(ys)

n=int(input())
stack,pair=list(map(int,divisor(n))),[]
for i in range(int(len(stack)/2)+len(stack)%2):
	pair.append([stack[i],stack[len(stack)-1-i]])

strings=[]
for p in pair:
	strings.append(str(p[0])+str(p[1]))
	strings.append(str(p[1])+str(p[0]))
strings=list(set(strings))
print(len(strings))
0