結果

問題 No.375 立方体のN等分 (1)
ユーザー cielciel
提出日時 2016-06-17 10:10:56
言語 Ruby
(3.3.0)
結果
AC  
実行時間 498 ms / 5,000 ms
コード長 115 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 11,436 KB
実行使用メモリ 15,660 KB
最終ジャッジ日時 2023-08-27 01:39:35
合計ジャッジ時間 5,830 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,572 KB
testcase_01 AC 72 ms
15,512 KB
testcase_02 AC 123 ms
15,536 KB
testcase_03 AC 71 ms
15,476 KB
testcase_04 AC 73 ms
15,540 KB
testcase_05 AC 73 ms
15,472 KB
testcase_06 AC 76 ms
15,624 KB
testcase_07 AC 83 ms
15,368 KB
testcase_08 AC 109 ms
15,388 KB
testcase_09 AC 99 ms
15,660 KB
testcase_10 AC 108 ms
15,412 KB
testcase_11 AC 107 ms
15,656 KB
testcase_12 AC 110 ms
15,360 KB
testcase_13 AC 113 ms
15,624 KB
testcase_14 AC 163 ms
15,432 KB
testcase_15 AC 118 ms
15,564 KB
testcase_16 AC 119 ms
15,360 KB
testcase_17 AC 328 ms
15,608 KB
testcase_18 AC 165 ms
15,364 KB
testcase_19 AC 125 ms
15,488 KB
testcase_20 AC 126 ms
15,360 KB
testcase_21 AC 128 ms
15,440 KB
testcase_22 AC 498 ms
15,652 KB
testcase_23 AC 128 ms
15,428 KB
testcase_24 AC 131 ms
15,360 KB
testcase_25 AC 132 ms
15,596 KB
testcase_26 AC 130 ms
15,376 KB
testcase_27 AC 128 ms
15,512 KB
testcase_28 AC 130 ms
15,408 KB
testcase_29 AC 129 ms
15,584 KB
testcase_30 AC 135 ms
15,536 KB
testcase_31 AC 136 ms
15,368 KB
testcase_32 AC 132 ms
15,620 KB
testcase_33 AC 127 ms
15,432 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|c=a*b;N%c==0&&m=[m,a+b+N/c-3].min}}
$><<[m,N-1]*' '
0