結果
| 問題 |
No.375 立方体のN等分 (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-30 13:38:00 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 230 bytes |
| コンパイル時間 | 399 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 17,536 KB |
| 最終ジャッジ日時 | 2024-09-13 23:34:35 |
| 合計ジャッジ時間 | 7,729 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | TLE * 1 -- * 31 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i
tmax = n-1
tmin = tmax
1.upto(n){|x|
break if x*x*x > n
next if n%x != 0
1.upto(n/x){|y|
next if (n/x)%y != 0
z = n/x/ y
tmin = [x+y+z-3,tmin].min
}
}
puts "#{tmin} #{tmax}"