結果

問題 No.719 Coprime
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-29 09:42:20
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,751 ms / 3,000 ms
コード長 209 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 13,184 KB
最終ジャッジ日時 2024-04-17 09:27:59
合計ジャッジ時間 21,626 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
12,672 KB
testcase_01 AC 100 ms
12,544 KB
testcase_02 AC 96 ms
12,800 KB
testcase_03 AC 101 ms
12,672 KB
testcase_04 AC 100 ms
12,544 KB
testcase_05 AC 105 ms
12,800 KB
testcase_06 AC 104 ms
12,544 KB
testcase_07 AC 107 ms
12,672 KB
testcase_08 AC 105 ms
12,672 KB
testcase_09 AC 106 ms
12,544 KB
testcase_10 AC 108 ms
12,672 KB
testcase_11 AC 112 ms
12,672 KB
testcase_12 AC 113 ms
12,672 KB
testcase_13 AC 120 ms
12,800 KB
testcase_14 AC 122 ms
12,800 KB
testcase_15 AC 126 ms
12,672 KB
testcase_16 AC 122 ms
12,800 KB
testcase_17 AC 125 ms
12,928 KB
testcase_18 AC 127 ms
12,672 KB
testcase_19 AC 124 ms
12,800 KB
testcase_20 AC 127 ms
12,800 KB
testcase_21 AC 127 ms
13,056 KB
testcase_22 AC 122 ms
12,672 KB
testcase_23 AC 132 ms
12,672 KB
testcase_24 AC 135 ms
12,928 KB
testcase_25 AC 135 ms
12,800 KB
testcase_26 AC 133 ms
12,672 KB
testcase_27 AC 147 ms
12,928 KB
testcase_28 AC 139 ms
12,800 KB
testcase_29 AC 131 ms
12,800 KB
testcase_30 AC 141 ms
12,928 KB
testcase_31 AC 134 ms
12,672 KB
testcase_32 AC 141 ms
12,800 KB
testcase_33 AC 142 ms
12,672 KB
testcase_34 AC 148 ms
12,800 KB
testcase_35 AC 153 ms
12,800 KB
testcase_36 AC 151 ms
12,800 KB
testcase_37 AC 147 ms
12,800 KB
testcase_38 AC 156 ms
12,800 KB
testcase_39 AC 150 ms
12,672 KB
testcase_40 AC 153 ms
12,800 KB
testcase_41 AC 171 ms
12,800 KB
testcase_42 AC 177 ms
12,928 KB
testcase_43 AC 218 ms
12,800 KB
testcase_44 AC 250 ms
12,800 KB
testcase_45 AC 251 ms
13,056 KB
testcase_46 AC 305 ms
12,800 KB
testcase_47 AC 300 ms
12,928 KB
testcase_48 AC 313 ms
12,800 KB
testcase_49 AC 343 ms
12,800 KB
testcase_50 AC 352 ms
12,928 KB
testcase_51 AC 339 ms
12,928 KB
testcase_52 AC 510 ms
12,800 KB
testcase_53 AC 759 ms
12,800 KB
testcase_54 AC 1,126 ms
12,928 KB
testcase_55 AC 1,175 ms
12,800 KB
testcase_56 AC 1,376 ms
12,928 KB
testcase_57 AC 1,434 ms
13,056 KB
testcase_58 AC 1,712 ms
13,056 KB
testcase_59 AC 1,751 ms
13,056 KB
testcase_60 AC 1,746 ms
13,184 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'prime'
m=2048
l=(0..n=gets.to_i).map{{0=>0}}
(2..n).map{|i|r=s=0;t=1;Prime.each(i){|q|i%q<1&&(r=q;s|=t);t*=2};l[r][s%m]=i}
p l.inject([0]*m){|f,k|(0...m).map{|x|k.map{|s,i|s>(x&s)?0:f[x^s]+i}.max}}.max
0