結果

問題 No.36 素数が嫌い!
ユーザー takeya_okinotakeya_okino
提出日時 2017-10-27 19:46:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 2,130 ms
コンパイル使用メモリ 83,700 KB
実行使用メモリ 54,328 KB
最終ジャッジ日時 2024-05-01 16:13:13
合計ジャッジ時間 8,664 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 171 ms
41,060 KB
testcase_01 AC 228 ms
41,412 KB
testcase_02 AC 133 ms
41,676 KB
testcase_03 AC 134 ms
41,316 KB
testcase_04 AC 134 ms
41,612 KB
testcase_05 AC 136 ms
41,528 KB
testcase_06 AC 132 ms
41,612 KB
testcase_07 AC 135 ms
41,292 KB
testcase_08 AC 131 ms
41,516 KB
testcase_09 AC 135 ms
41,316 KB
testcase_10 AC 132 ms
41,716 KB
testcase_11 AC 174 ms
41,496 KB
testcase_12 AC 247 ms
41,064 KB
testcase_13 AC 247 ms
41,540 KB
testcase_14 WA -
testcase_15 AC 138 ms
41,044 KB
testcase_16 AC 135 ms
41,392 KB
testcase_17 AC 135 ms
41,388 KB
testcase_18 AC 127 ms
41,308 KB
testcase_19 AC 180 ms
41,564 KB
testcase_20 AC 249 ms
41,288 KB
testcase_21 AC 219 ms
41,180 KB
testcase_22 AC 220 ms
41,364 KB
testcase_23 AC 186 ms
41,760 KB
testcase_24 AC 184 ms
41,464 KB
testcase_25 AC 198 ms
41,516 KB
testcase_26 AC 207 ms
41,512 KB
testcase_27 AC 233 ms
41,464 KB
testcase_28 AC 201 ms
41,164 KB
testcase_29 AC 248 ms
41,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    int count = 0;
    for(long i = 2; i * i <= n; i++) {
      if(n % i == 0) count++;
    }
    String ans = "NO";
    if(count > 1) ans = "YES";
    System.out.println(ans);
  }
}
0