結果

問題 No.12 限定された素数
ユーザー syarosyaro
提出日時 2016-01-18 12:41:25
言語 Ruby
(3.2.2)
結果
AC  
実行時間 1,316 ms / 5,000 ms
コード長 153 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 11,568 KB
実行使用メモリ 27,304 KB
最終ジャッジ日時 2023-08-15 23:12:03
合計ジャッジ時間 36,584 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,267 ms
27,056 KB
testcase_01 AC 1,268 ms
27,160 KB
testcase_02 AC 1,295 ms
27,040 KB
testcase_03 AC 1,316 ms
27,172 KB
testcase_04 AC 1,275 ms
27,072 KB
testcase_05 AC 1,263 ms
27,156 KB
testcase_06 AC 1,273 ms
27,252 KB
testcase_07 AC 1,297 ms
26,940 KB
testcase_08 AC 1,267 ms
27,304 KB
testcase_09 AC 1,277 ms
27,168 KB
testcase_10 AC 1,282 ms
27,072 KB
testcase_11 AC 1,277 ms
27,172 KB
testcase_12 AC 1,273 ms
27,292 KB
testcase_13 AC 1,267 ms
27,188 KB
testcase_14 AC 1,314 ms
26,964 KB
testcase_15 AC 1,276 ms
27,176 KB
testcase_16 AC 1,259 ms
27,072 KB
testcase_17 AC 1,275 ms
27,232 KB
testcase_18 AC 1,249 ms
27,064 KB
testcase_19 AC 1,290 ms
27,236 KB
testcase_20 AC 1,284 ms
27,172 KB
testcase_21 AC 1,260 ms
27,088 KB
testcase_22 AC 1,267 ms
27,076 KB
testcase_23 AC 1,269 ms
27,080 KB
testcase_24 AC 1,285 ms
27,080 KB
testcase_25 AC 1,270 ms
27,076 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!ruby -rprime
a=u=r=m=0
gets
gets.bytes{|c|a+=1<<c-48}
Prime.each(5e6){|q|u<a||r=[r,q+~m].max;q.to_s.bytes{|c|u|=1<<c-48};u|a>a&&m=q+u=0}
p r.+r<=>5e6-3
0