結果
問題 |
No.375 立方体のN等分 (1)
|
ユーザー |
|
提出日時 | 2017-04-30 14:11:18 |
言語 | Ruby (3.4.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 278 bytes |
コンパイル時間 | 63 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 18,972 KB |
最終ジャッジ日時 | 2024-09-13 23:38:41 |
合計ジャッジ時間 | 8,446 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 TLE * 1 -- * 24 |
コンパイルメッセージ
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 break if y*y>n/x z = n/x/ y break if y > z tmin = [x+y+z-3,tmin].min } } puts "#{tmin} #{tmax}"