結果

問題 No.375 立方体のN等分 (1)
ユーザー hogeover30hogeover30
提出日時 2017-01-26 16:50:04
言語 Ruby
(3.3.0)
結果
AC  
実行時間 625 ms / 5,000 ms
コード長 113 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 11,300 KB
実行使用メモリ 47,480 KB
最終ジャッジ日時 2023-08-27 05:14:44
合計ジャッジ時間 6,873 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,512 KB
testcase_01 AC 84 ms
15,420 KB
testcase_02 AC 135 ms
15,960 KB
testcase_03 AC 82 ms
15,544 KB
testcase_04 AC 83 ms
15,496 KB
testcase_05 AC 82 ms
15,408 KB
testcase_06 AC 86 ms
15,636 KB
testcase_07 AC 96 ms
15,440 KB
testcase_08 AC 129 ms
17,596 KB
testcase_09 AC 108 ms
15,600 KB
testcase_10 AC 115 ms
15,504 KB
testcase_11 AC 118 ms
15,336 KB
testcase_12 AC 122 ms
15,656 KB
testcase_13 AC 128 ms
15,472 KB
testcase_14 AC 190 ms
19,408 KB
testcase_15 AC 132 ms
15,600 KB
testcase_16 AC 134 ms
15,440 KB
testcase_17 AC 413 ms
34,208 KB
testcase_18 AC 191 ms
19,016 KB
testcase_19 AC 137 ms
15,604 KB
testcase_20 AC 140 ms
15,432 KB
testcase_21 AC 142 ms
15,372 KB
testcase_22 AC 625 ms
47,480 KB
testcase_23 AC 142 ms
15,420 KB
testcase_24 AC 141 ms
15,412 KB
testcase_25 AC 144 ms
15,432 KB
testcase_26 AC 143 ms
15,472 KB
testcase_27 AC 142 ms
15,644 KB
testcase_28 AC 144 ms
15,628 KB
testcase_29 AC 141 ms
15,596 KB
testcase_30 AC 143 ms
15,428 KB
testcase_31 AC 141 ms
15,424 KB
testcase_32 AC 143 ms
15,444 KB
testcase_33 AC 142 ms
15,612 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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