結果

問題 No.375 立方体のN等分 (1)
ユーザー hogeover30hogeover30
提出日時 2017-01-26 16:48:59
言語 Ruby
(3.3.0)
結果
AC  
実行時間 507 ms / 5,000 ms
コード長 114 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 11,208 KB
実行使用メモリ 15,656 KB
最終ジャッジ日時 2023-08-27 06:48:40
合計ジャッジ時間 6,189 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,444 KB
testcase_01 AC 77 ms
15,588 KB
testcase_02 AC 126 ms
15,632 KB
testcase_03 AC 78 ms
15,480 KB
testcase_04 AC 79 ms
15,532 KB
testcase_05 AC 80 ms
15,308 KB
testcase_06 AC 76 ms
15,364 KB
testcase_07 AC 85 ms
15,368 KB
testcase_08 AC 115 ms
15,376 KB
testcase_09 AC 103 ms
15,648 KB
testcase_10 AC 108 ms
15,612 KB
testcase_11 AC 106 ms
15,468 KB
testcase_12 AC 112 ms
15,308 KB
testcase_13 AC 119 ms
15,612 KB
testcase_14 AC 172 ms
15,328 KB
testcase_15 AC 125 ms
15,656 KB
testcase_16 AC 125 ms
15,600 KB
testcase_17 AC 334 ms
15,500 KB
testcase_18 AC 174 ms
15,612 KB
testcase_19 AC 122 ms
15,608 KB
testcase_20 AC 128 ms
15,652 KB
testcase_21 AC 131 ms
15,592 KB
testcase_22 AC 507 ms
15,444 KB
testcase_23 AC 134 ms
15,312 KB
testcase_24 AC 132 ms
15,400 KB
testcase_25 AC 140 ms
15,536 KB
testcase_26 AC 132 ms
15,572 KB
testcase_27 AC 132 ms
15,372 KB
testcase_28 AC 133 ms
15,408 KB
testcase_29 AC 133 ms
15,608 KB
testcase_30 AC 132 ms
15,524 KB
testcase_31 AC 138 ms
15,364 KB
testcase_32 AC 133 ms
15,444 KB
testcase_33 AC 136 ms
15,656 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<1&&m=[m,a+b+n/c-3].min}}
$><<[m,n-1]*' '
0