結果

問題 No.376 立方体のN等分 (2)
ユーザー cielciel
提出日時 2020-02-08 19:39:15
言語 Crystal
(1.11.2)
結果
AC  
実行時間 1,461 ms / 5,000 ms
コード長 133 bytes
コンパイル時間 17,712 ms
コンパイル使用メモリ 255,568 KB
実行使用メモリ 5,128 KB
最終ジャッジ日時 2023-09-13 10:13:23
合計ジャッジ時間 29,231 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,424 KB
testcase_01 AC 3 ms
4,456 KB
testcase_02 AC 106 ms
4,512 KB
testcase_03 AC 104 ms
4,996 KB
testcase_04 AC 122 ms
4,388 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 2 ms
4,448 KB
testcase_07 AC 2 ms
4,392 KB
testcase_08 AC 8 ms
4,380 KB
testcase_09 AC 28 ms
4,384 KB
testcase_10 AC 114 ms
4,900 KB
testcase_11 AC 57 ms
4,464 KB
testcase_12 AC 75 ms
4,556 KB
testcase_13 AC 78 ms
4,384 KB
testcase_14 AC 86 ms
4,508 KB
testcase_15 AC 96 ms
4,396 KB
testcase_16 AC 1,257 ms
5,116 KB
testcase_17 AC 107 ms
4,464 KB
testcase_18 AC 111 ms
4,380 KB
testcase_19 AC 113 ms
4,608 KB
testcase_20 AC 115 ms
4,384 KB
testcase_21 AC 1,293 ms
5,116 KB
testcase_22 AC 120 ms
4,380 KB
testcase_23 AC 1,332 ms
5,112 KB
testcase_24 AC 1,249 ms
5,128 KB
testcase_25 AC 124 ms
4,380 KB
testcase_26 AC 1,461 ms
5,068 KB
testcase_27 AC 125 ms
4,440 KB
testcase_28 AC 126 ms
4,376 KB
testcase_29 AC 126 ms
4,436 KB
testcase_30 AC 126 ms
4,376 KB
testcase_31 AC 126 ms
4,384 KB
testcase_32 AC 126 ms
4,380 KB
testcase_33 AC 125 ms
4,428 KB
testcase_34 AC 126 ms
4,388 KB
testcase_35 AC 126 ms
4,376 KB
testcase_36 AC 126 ms
4,468 KB
testcase_37 AC 127 ms
4,380 KB
testcase_38 AC 126 ms
4,380 KB
testcase_39 AC 126 ms
4,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

m=n=gets.not_nil!.to_i64
y=(1_i64..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)}}
print m," ",n-1
0