結果

問題 No.843 Triple Primes
ユーザー maimai
提出日時 2019-06-28 22:16:59
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 163 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,540 KB
実行使用メモリ 18,460 KB
最終ジャッジ日時 2023-09-14 22:07:10
合計ジャッジ時間 9,594 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
15,352 KB
testcase_01 AC 249 ms
18,084 KB
testcase_02 AC 98 ms
15,220 KB
testcase_03 AC 99 ms
15,364 KB
testcase_04 AC 100 ms
15,440 KB
testcase_05 AC 97 ms
15,096 KB
testcase_06 AC 99 ms
15,432 KB
testcase_07 AC 238 ms
18,420 KB
testcase_08 AC 239 ms
18,188 KB
testcase_09 AC 244 ms
18,216 KB
testcase_10 AC 239 ms
18,188 KB
testcase_11 AC 241 ms
18,204 KB
testcase_12 AC 241 ms
18,208 KB
testcase_13 AC 241 ms
18,200 KB
testcase_14 AC 242 ms
18,084 KB
testcase_15 AC 239 ms
18,296 KB
testcase_16 AC 239 ms
18,232 KB
testcase_17 WA -
testcase_18 AC 94 ms
15,196 KB
testcase_19 AC 93 ms
15,556 KB
testcase_20 AC 133 ms
16,200 KB
testcase_21 AC 113 ms
15,840 KB
testcase_22 AC 167 ms
16,932 KB
testcase_23 AC 170 ms
17,036 KB
testcase_24 AC 131 ms
16,412 KB
testcase_25 AC 135 ms
16,284 KB
testcase_26 AC 248 ms
18,204 KB
testcase_27 AC 103 ms
15,580 KB
testcase_28 AC 242 ms
18,212 KB
testcase_29 AC 135 ms
16,464 KB
testcase_30 AC 239 ms
18,460 KB
testcase_31 AC 106 ms
15,340 KB
testcase_32 AC 98 ms
15,508 KB
testcase_33 AC 133 ms
16,448 KB
testcase_34 AC 168 ms
17,032 KB
testcase_35 AC 239 ms
18,288 KB
testcase_36 AC 114 ms
15,796 KB
testcase_37 AC 175 ms
16,924 KB
testcase_38 AC 173 ms
16,956 KB
testcase_39 AC 242 ms
18,084 KB
testcase_40 AC 95 ms
15,364 KB
testcase_41 WA -
testcase_42 AC 239 ms
18,292 KB
testcase_43 AC 239 ms
18,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'
n = gets.to_i

pli = Prime.take_while{|e| e <= n}.select{|q| 
  z = q+2
  h = Math.sqrt(z).to_i
  q != 2 && h**2 == z && h.prime?
}

p pli.size*2+1
0