結果

問題 No.12 限定された素数
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-03-01 20:36:57
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 206 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,240 KB
実行使用メモリ 27,548 KB
最終ジャッジ日時 2023-09-06 05:58:57
合計ジャッジ時間 32,176 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1,299 ms
27,264 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1,183 ms
27,324 KB
testcase_07 AC 1,185 ms
27,292 KB
testcase_08 WA -
testcase_09 AC 1,122 ms
27,240 KB
testcase_10 WA -
testcase_11 AC 1,235 ms
27,332 KB
testcase_12 AC 1,191 ms
27,168 KB
testcase_13 AC 1,161 ms
27,336 KB
testcase_14 WA -
testcase_15 AC 1,159 ms
27,236 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'prime'
m=5000001
gets
b=c=l=0
gets.split.map{|a|b|=1<<a.ord-48}
z=1
Prime.each(m+10){|x|
  c<b||z=[z,[x,m].min-l].max
  y=x
  (
    c|=1<<y%10
    (c=0;l=x;break) if(b|c)>b
  )while(y/=10)>0
}
p z-2
0