結果

問題 No.473 和と積の和
ユーザー hogeover30hogeover30
提出日時 2017-02-01 11:39:01
言語 Ruby
(3.3.0)
結果
AC  
実行時間 2,058 ms / 3,000 ms
コード長 243 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 11,428 KB
実行使用メモリ 26,316 KB
最終ジャッジ日時 2023-08-27 05:16:22
合計ジャッジ時間 20,136 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
15,144 KB
testcase_01 AC 95 ms
15,192 KB
testcase_02 AC 97 ms
15,032 KB
testcase_03 AC 815 ms
20,632 KB
testcase_04 AC 96 ms
15,176 KB
testcase_05 AC 96 ms
15,140 KB
testcase_06 AC 97 ms
15,028 KB
testcase_07 AC 95 ms
15,272 KB
testcase_08 AC 96 ms
15,280 KB
testcase_09 AC 96 ms
15,396 KB
testcase_10 AC 93 ms
15,316 KB
testcase_11 AC 95 ms
15,204 KB
testcase_12 AC 96 ms
15,280 KB
testcase_13 AC 96 ms
15,200 KB
testcase_14 AC 96 ms
15,272 KB
testcase_15 AC 97 ms
15,312 KB
testcase_16 AC 96 ms
15,264 KB
testcase_17 AC 97 ms
15,028 KB
testcase_18 AC 96 ms
15,180 KB
testcase_19 AC 97 ms
15,320 KB
testcase_20 AC 97 ms
15,284 KB
testcase_21 AC 95 ms
15,192 KB
testcase_22 AC 97 ms
15,252 KB
testcase_23 AC 105 ms
15,604 KB
testcase_24 AC 109 ms
15,508 KB
testcase_25 AC 2,058 ms
26,316 KB
testcase_26 AC 624 ms
19,420 KB
testcase_27 AC 720 ms
20,244 KB
testcase_28 AC 97 ms
15,148 KB
testcase_29 AC 99 ms
15,472 KB
testcase_30 AC 99 ms
15,400 KB
testcase_31 AC 98 ms
15,496 KB
testcase_32 AC 98 ms
15,348 KB
testcase_33 AC 97 ms
15,468 KB
testcase_34 AC 1,287 ms
23,316 KB
testcase_35 AC 1,273 ms
23,128 KB
testcase_36 AC 97 ms
15,412 KB
testcase_37 AC 98 ms
15,272 KB
testcase_38 AC 1,292 ms
23,136 KB
testcase_39 AC 735 ms
20,176 KB
testcase_40 AC 735 ms
20,196 KB
testcase_41 AC 728 ms
20,272 KB
testcase_42 AC 1,436 ms
23,332 KB
testcase_43 AC 1,429 ms
23,408 KB
testcase_44 AC 1,456 ms
23,388 KB
testcase_45 AC 95 ms
15,400 KB
testcase_46 AC 93 ms
15,404 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!ruby -narprime
eval'N,X='+$F*?,
a=(X+=1).prime_division.map{|k,v|(0..v).map{|i|k**i}}
a=a.pop.product(*a).map{|e|e.reduce :*}.sort
m={}
f=->x,n,d{r=0;x<2&&n==0?1:m[[x,n,d]]||=d.downto(1){|i|x%a[i]>0||r+=f[x/a[i],n-1,i]}&&r}
p f[X,N,a.size-1]
0