結果

問題 No.375 立方体のN等分 (1)
ユーザー Coki628Coki628
提出日時 2020-09-23 18:23:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,261 bytes
コンパイル時間 956 ms
コンパイル使用メモリ 87,424 KB
実行使用メモリ 77,416 KB
最終ジャッジ日時 2023-09-10 08:11:22
合計ジャッジ時間 6,000 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,860 KB
testcase_01 AC 96 ms
72,008 KB
testcase_02 WA -
testcase_03 AC 94 ms
72,244 KB
testcase_04 AC 93 ms
72,304 KB
testcase_05 AC 99 ms
72,368 KB
testcase_06 AC 103 ms
77,260 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 98 ms
77,032 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 92 ms
72,160 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 90 ms
72,372 KB
testcase_21 AC 99 ms
72,048 KB
testcase_22 WA -
testcase_23 AC 104 ms
76,900 KB
testcase_24 AC 98 ms
77,324 KB
testcase_25 AC 91 ms
72,352 KB
testcase_26 AC 100 ms
76,744 KB
testcase_27 WA -
testcase_28 AC 99 ms
77,000 KB
testcase_29 AC 100 ms
76,912 KB
testcase_30 AC 100 ms
76,960 KB
testcase_31 AC 101 ms
76,840 KB
testcase_32 AC 101 ms
76,956 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c for j in range(b)] for i in range(a)]
def list3d(a, b, c, d): return [[[d for k in range(c)] for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e for l in range(d)] for k in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10**9)
INF = 10**18
MOD = 10**9 + 7
EPS = 10**-10

def factorize(num: int) -> dict:
    """ 素因数分解 """
    from math import sqrt
    from collections import Counter

    d = Counter()
    for i in range(2, int(sqrt(num))+1):
        while num % i == 0:
            num //= i
            d[i] += 1
        if num == 1:
            break
    if num != 1:
        d[num] += 1
    return d

N = INT()

fact = factorize(N)
A = []
for k, v in fact.items():
    A += [k] * v
A.sort(reverse=1)
M = len(A)

B = [1, 1, 1]
for i in range(M):
    B[i%3] *= A[i]

mn = 0
for b in B:
    mn += b - 1
print(mn, N-1)
0