結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
|
提出日時 | 2017-08-08 18:15:50 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 491 bytes |
コンパイル時間 | 2,243 ms |
コンパイル使用メモリ | 74,656 KB |
実行使用メモリ | 55,956 KB |
最終ジャッジ日時 | 2024-10-12 00:13:42 |
合計ジャッジ時間 | 6,929 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 RE * 2 |
other | WA * 6 RE * 20 |
ソースコード
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long N = sc.nextInt(); int divisorCount = 0; for(long i=2; i<=Math.pow(N, 0.5); i++){ if(N%i == 0){ divisorCount++; } if(divisorCount==2){ System.out.println("YES"); System.exit(1); } } System.out.println("No"); } }