結果

問題 No.36 素数が嫌い!
ユーザー irisAshirisAsh
提出日時 2017-08-15 17:53:25
言語 JavaScript
(node v20.8.0)
結果
AC  
実行時間 1,593 ms / 5,000 ms
コード長 296 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 6,996 KB
実行使用メモリ 47,196 KB
最終ジャッジ日時 2023-08-03 02:19:36
合計ジャッジ時間 21,967 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 907 ms
47,112 KB
testcase_01 AC 1,315 ms
47,136 KB
testcase_02 AC 75 ms
42,228 KB
testcase_03 AC 75 ms
42,156 KB
testcase_04 AC 75 ms
42,172 KB
testcase_05 AC 80 ms
42,140 KB
testcase_06 AC 80 ms
42,276 KB
testcase_07 AC 79 ms
42,168 KB
testcase_08 AC 76 ms
42,192 KB
testcase_09 AC 78 ms
42,268 KB
testcase_10 AC 79 ms
42,168 KB
testcase_11 AC 720 ms
47,000 KB
testcase_12 AC 1,593 ms
46,968 KB
testcase_13 AC 1,587 ms
47,060 KB
testcase_14 AC 89 ms
46,460 KB
testcase_15 AC 76 ms
42,356 KB
testcase_16 AC 74 ms
42,448 KB
testcase_17 AC 74 ms
42,340 KB
testcase_18 AC 76 ms
42,184 KB
testcase_19 AC 811 ms
47,016 KB
testcase_20 AC 1,586 ms
47,196 KB
testcase_21 AC 1,287 ms
46,996 KB
testcase_22 AC 1,319 ms
47,188 KB
testcase_23 AC 917 ms
47,128 KB
testcase_24 AC 993 ms
47,016 KB
testcase_25 AC 75 ms
42,236 KB
testcase_26 AC 1,092 ms
47,096 KB
testcase_27 AC 1,418 ms
47,196 KB
testcase_28 AC 1,079 ms
47,000 KB
testcase_29 AC 1,555 ms
47,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let i = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')[0]
let d = 0
if (i % 2 == 0) {
  d++
  if (i != 4 && i % 4 == 0) d++
}
for (let c = 3; c*c < i; c+=2) {
  if (i % c == 0) {
    d++
    if (i % (c * c) == 0) {
      d++
      break
    }
  }
}
console.log(d > 1 ? 'YES' : 'NO')
0