結果

問題 No.36 素数が嫌い!
ユーザー irisAshirisAsh
提出日時 2017-08-15 17:53:25
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 1,709 ms / 5,000 ms
コード長 296 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 44,288 KB
最終ジャッジ日時 2024-04-21 01:56:53
合計ジャッジ時間 21,723 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 924 ms
44,160 KB
testcase_01 AC 1,347 ms
44,288 KB
testcase_02 AC 56 ms
38,400 KB
testcase_03 AC 57 ms
38,400 KB
testcase_04 AC 57 ms
38,400 KB
testcase_05 AC 63 ms
42,112 KB
testcase_06 AC 65 ms
42,112 KB
testcase_07 AC 63 ms
41,984 KB
testcase_08 AC 59 ms
38,784 KB
testcase_09 AC 66 ms
41,984 KB
testcase_10 AC 65 ms
38,784 KB
testcase_11 AC 732 ms
44,160 KB
testcase_12 AC 1,624 ms
44,160 KB
testcase_13 AC 1,623 ms
44,160 KB
testcase_14 AC 73 ms
43,264 KB
testcase_15 AC 56 ms
38,784 KB
testcase_16 AC 59 ms
38,656 KB
testcase_17 AC 59 ms
38,656 KB
testcase_18 AC 57 ms
38,784 KB
testcase_19 AC 814 ms
44,032 KB
testcase_20 AC 1,629 ms
44,160 KB
testcase_21 AC 1,319 ms
44,032 KB
testcase_22 AC 1,352 ms
44,032 KB
testcase_23 AC 931 ms
44,160 KB
testcase_24 AC 1,018 ms
44,288 KB
testcase_25 AC 57 ms
38,784 KB
testcase_26 AC 1,098 ms
44,160 KB
testcase_27 AC 1,436 ms
44,160 KB
testcase_28 AC 1,109 ms
44,288 KB
testcase_29 AC 1,709 ms
44,160 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