結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2015-04-13 17:36:54 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 628 bytes |
コンパイル時間 | 1,798 ms |
コンパイル使用メモリ | 74,824 KB |
実行使用メモリ | 46,576 KB |
最終ジャッジ日時 | 2024-07-04 14:15:08 |
合計ジャッジ時間 | 8,940 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 3 RE * 2 TLE * 1 -- * 20 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner koko = new Scanner(System.in); long n = koko.nextInt(); int a=0; for(int i=2; i<n; i++){ if(a==1){ break; }else if(n%i==0){ for(int j=2; j<i; j++){ if(i%j==0){ a=1; System.out.println("YES"); break; } } } } if(a==0){ System.out.println("NO"); } } }