結果

問題 No.12 限定された素数
ユーザー syarosyaro
提出日時 2016-01-18 23:18:08
言語 Ruby
(3.2.2)
結果
AC  
実行時間 1,414 ms / 5,000 ms
コード長 151 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 11,500 KB
実行使用メモリ 27,252 KB
最終ジャッジ日時 2023-08-15 23:14:07
合計ジャッジ時間 39,560 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,395 ms
27,108 KB
testcase_01 AC 1,401 ms
27,172 KB
testcase_02 AC 1,393 ms
27,204 KB
testcase_03 AC 1,414 ms
27,172 KB
testcase_04 AC 1,401 ms
27,204 KB
testcase_05 AC 1,397 ms
27,132 KB
testcase_06 AC 1,395 ms
27,140 KB
testcase_07 AC 1,399 ms
27,088 KB
testcase_08 AC 1,397 ms
26,968 KB
testcase_09 AC 1,390 ms
27,048 KB
testcase_10 AC 1,393 ms
27,068 KB
testcase_11 AC 1,394 ms
27,220 KB
testcase_12 AC 1,400 ms
27,048 KB
testcase_13 AC 1,399 ms
27,152 KB
testcase_14 AC 1,406 ms
27,160 KB
testcase_15 AC 1,403 ms
27,084 KB
testcase_16 AC 1,398 ms
27,192 KB
testcase_17 AC 1,401 ms
27,204 KB
testcase_18 AC 1,403 ms
27,252 KB
testcase_19 AC 1,408 ms
27,072 KB
testcase_20 AC 1,398 ms
26,984 KB
testcase_21 AC 1,400 ms
27,064 KB
testcase_22 AC 1,404 ms
27,188 KB
testcase_23 AC 1,401 ms
27,188 KB
testcase_24 AC 1,400 ms
27,168 KB
testcase_25 AC 1,405 ms
27,068 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<=>4e6
0