結果
| 問題 | No.36 素数が嫌い! |
| コンテスト | |
| ユーザー |
hhgfhn1
|
| 提出日時 | 2018-10-30 00:48:16 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 100 ms / 5,000 ms |
| コード長 | 559 bytes |
| 記録 | |
| コンパイル時間 | 1,784 ms |
| コンパイル使用メモリ | 82,140 KB |
| 実行使用メモリ | 42,484 KB |
| 最終ジャッジ日時 | 2026-05-13 17:38:51 |
| 合計ジャッジ時間 | 5,537 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
ソースコード
import java.util.Scanner;
public class Main {
@SuppressWarnings("resource")
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
long n = scanner.nextLong();
num_prime(n);
if (res >= 3) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
static int res = 0;
private static void num_prime(long n) {
for (int i = 2; i <= Math.sqrt(n); i++) {
if (n % i == 0) {
res++;
if (n / i % i == 0) {
res++;
if (n / i / i % i == 0) {
res++;
}
}
}
}
}
}
hhgfhn1