結果
| 問題 | No.36 素数が嫌い! |
| コンテスト | |
| ユーザー |
Tsukasa_Type
|
| 提出日時 | 2018-02-15 00:49:53 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 100 ms / 5,000 ms |
| コード長 | 426 bytes |
| 記録 | |
| コンパイル時間 | 1,644 ms |
| コンパイル使用メモリ | 82,100 KB |
| 実行使用メモリ | 42,716 KB |
| 最終ジャッジ日時 | 2026-03-14 02:19:40 |
| 合計ジャッジ時間 | 4,890 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
ソースコード
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++) {
int num = 0;
while (n%i==0) {
n /= i;
num++;
}
total += num;
}
return total;
}
}
Tsukasa_Type