結果
問題 |
No.375 立方体のN等分 (1)
|
ユーザー |
![]() |
提出日時 | 2025-04-16 15:52:31 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 188 ms / 5,000 ms |
コード長 | 507 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 81,992 KB |
実行使用メモリ | 67,128 KB |
最終ジャッジ日時 | 2025-04-16 15:53:35 |
合計ジャッジ時間 | 3,047 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
ソースコード
import math N = int(input()) min_sum = float('inf') max_a = int(math.isqrt(N)) + 1 # Upper bound for a for a in range(1, max_a + 1): if N % a != 0: continue M = N // a max_b = int(math.isqrt(M)) for b in range(a, max_b + 1): if M % b != 0: continue c = M // b if b > c: continue current_sum = a + b + c if current_sum < min_sum: min_sum = current_sum Tmax = N - 1 Tmin = min_sum - 3 print(Tmin, Tmax)