結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
Tsukasa_Type
|
| 提出日時 | 2018-02-15 00:48:25 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 445 bytes |
| コンパイル時間 | 2,271 ms |
| コンパイル使用メモリ | 74,216 KB |
| 実行使用メモリ | 54,564 KB |
| 最終ジャッジ日時 | 2024-12-23 11:37:29 |
| 合計ジャッジ時間 | 8,914 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 22 WA * 4 |
ソースコード
import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
long n = sc.nextLong();
System.out.println(PrimeFact(n)>=2?"YES":"NO");
}
static int PrimeFact (long n) {
double sqrt = Math.sqrt(n);
int total = 0;
for (int i=2; i<sqrt; i++) {
boolean b = false;
while (n%i==0) {
n /= i;
b = true;
}
if (b==true) {total++;}
}
return total;
}
}
Tsukasa_Type