結果

問題 No.375 立方体のN等分 (1)
ユーザー cielciel
提出日時 2016-06-17 10:01:34
言語 Ruby
(3.2.2)
結果
AC  
実行時間 533 ms / 5,000 ms
コード長 115 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 11,504 KB
実行使用メモリ 15,664 KB
最終ジャッジ日時 2023-08-27 06:18:08
合計ジャッジ時間 6,437 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
15,560 KB
testcase_01 AC 77 ms
15,392 KB
testcase_02 AC 125 ms
15,576 KB
testcase_03 AC 76 ms
15,636 KB
testcase_04 AC 72 ms
15,324 KB
testcase_05 AC 76 ms
15,600 KB
testcase_06 AC 78 ms
15,340 KB
testcase_07 AC 89 ms
15,432 KB
testcase_08 AC 114 ms
15,596 KB
testcase_09 AC 101 ms
15,392 KB
testcase_10 AC 109 ms
15,604 KB
testcase_11 AC 112 ms
15,476 KB
testcase_12 AC 118 ms
15,356 KB
testcase_13 AC 121 ms
15,548 KB
testcase_14 AC 169 ms
15,664 KB
testcase_15 AC 130 ms
15,640 KB
testcase_16 AC 129 ms
15,632 KB
testcase_17 AC 353 ms
15,452 KB
testcase_18 AC 178 ms
15,572 KB
testcase_19 AC 133 ms
15,532 KB
testcase_20 AC 135 ms
15,416 KB
testcase_21 AC 133 ms
15,364 KB
testcase_22 AC 533 ms
15,520 KB
testcase_23 AC 134 ms
15,440 KB
testcase_24 AC 131 ms
15,596 KB
testcase_25 AC 135 ms
15,508 KB
testcase_26 AC 140 ms
15,508 KB
testcase_27 AC 136 ms
15,368 KB
testcase_28 AC 136 ms
15,468 KB
testcase_29 AC 130 ms
15,404 KB
testcase_30 AC 130 ms
15,396 KB
testcase_31 AC 134 ms
15,588 KB
testcase_32 AC 138 ms
15,352 KB
testcase_33 AC 137 ms
15,368 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

m=N=gets.to_i
y=(1..N**0.5).reject{|i|N%i>0}
y.map{|a|y.each{|b|N%(a*b)==0&&m=[m,a+b+N/a/b-3].min}}
$><<[m,N-1]*' '
0