結果
| 問題 |
No.375 立方体のN等分 (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-30 13:40:33 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 253 bytes |
| コンパイル時間 | 127 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-09-13 23:34:39 |
| 合計ジャッジ時間 | 4,251 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 2 WA * 30 |
コンパイルメッセージ
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
break if y < z
tmin = [x+y+z-3,tmin].min
}
}
puts "#{tmin} #{tmax}"