結果

問題 No.375 立方体のN等分 (1)
ユーザー shinjiwebshinjiweb
提出日時 2016-06-23 14:25:09
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 221 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 16,256 KB
最終ジャッジ日時 2024-04-20 01:08:45
合計ジャッジ時間 11,262 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
12,544 KB
testcase_01 AC 79 ms
12,544 KB
testcase_02 AC 422 ms
12,416 KB
testcase_03 AC 78 ms
12,416 KB
testcase_04 AC 78 ms
12,416 KB
testcase_05 AC 79 ms
12,544 KB
testcase_06 AC 81 ms
12,544 KB
testcase_07 AC 125 ms
12,288 KB
testcase_08 AC 298 ms
12,416 KB
testcase_09 AC 119 ms
12,288 KB
testcase_10 AC 171 ms
12,416 KB
testcase_11 AC 159 ms
12,416 KB
testcase_12 AC 182 ms
12,416 KB
testcase_13 AC 180 ms
12,288 KB
testcase_14 AC 887 ms
12,544 KB
testcase_15 WA -
testcase_16 AC 175 ms
12,416 KB
testcase_17 AC 1,444 ms
13,184 KB
testcase_18 AC 974 ms
12,800 KB
testcase_19 AC 224 ms
12,416 KB
testcase_20 AC 135 ms
12,288 KB
testcase_21 AC 132 ms
12,416 KB
testcase_22 AC 1,825 ms
16,256 KB
testcase_23 AC 182 ms
12,416 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 179 ms
12,416 KB
testcase_27 AC 237 ms
12,544 KB
testcase_28 AC 131 ms
12,544 KB
testcase_29 AC 130 ms
12,544 KB
testcase_30 AC 173 ms
12,288 KB
testcase_31 AC 206 ms
12,416 KB
testcase_32 AC 133 ms
12,416 KB
testcase_33 AC 182 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
array = []
1.upto(n**(1.0 / 3.0)) do |a|
  next unless n % a == 0
  1.upto((n / a)**(1.0 / 2.0)) do |b|
    array << (a + b + n / (a * b) - 3) if n / a % b == 0
  end
end
print array.min
print ' '
puts n - 1
0