結果
| 問題 | No.376 立方体のN等分 (2) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-10 09:27:02 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 978 ms / 5,000 ms |
| コード長 | 390 bytes |
| 記録 | |
| コンパイル時間 | 148 ms |
| コンパイル使用メモリ | 84,864 KB |
| 実行使用メモリ | 80,512 KB |
| 最終ジャッジ日時 | 2026-04-26 01:00:45 |
| 合計ジャッジ時間 | 10,316 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 38 |
ソースコード
import itertools
def isqrt(n):
x = n
y = (x + 1) // 2
while y < x:
x = y
y = (x + n // x) // 2
return x
N = int(input())
div = [i for i in range(1, isqrt(N) + 1) if not N % i]
Nmin = Nmax = N - 1
for i, j in itertools.combinations_with_replacement(div, 2):
if not N % (i * j):
Nmin = min(Nmin, i + j + (N // (i * j)) - 3)
print(Nmin, Nmax)