結果
| 問題 |
No.375 立方体のN等分 (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-05 22:34:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 553 bytes |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-12-17 13:58:50 |
| 合計ジャッジ時間 | 2,583 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 WA * 15 |
ソースコード
# yukicoder No.375 立方体のN等分 (1)
# nを素因数分解する関数
def prime_decomp(n):
i = 3
table = []
if n % 2 == 0:
while n % 2 == 0:
n //= 2
table.append(2)
while i * i <= n:
while n % i == 0:
n //= i
table.append(i)
i += 2
if n > 1:
table.append(n)
return table
N = int(input())
div_N = prime_decomp(N)
cut = [1, 1, 1]
for i in div_N:
cut[cut.index(min(cut))] *= i
T_min = sum(cut) - 3
T_max = N - 1
print(T_min, T_max)