結果

問題 No.36 素数が嫌い!
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-24 22:46:12
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 4,012 ms
コンパイル使用メモリ 74,348 KB
実行使用メモリ 41,652 KB
最終ジャッジ日時 2024-04-24 03:13:15
合計ジャッジ時間 8,985 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 144 ms
41,652 KB
testcase_02 AC 100 ms
40,152 KB
testcase_03 AC 107 ms
41,456 KB
testcase_04 AC 106 ms
40,832 KB
testcase_05 AC 107 ms
41,232 KB
testcase_06 AC 99 ms
40,196 KB
testcase_07 AC 107 ms
40,868 KB
testcase_08 AC 116 ms
41,188 KB
testcase_09 AC 113 ms
41,240 KB
testcase_10 WA -
testcase_11 AC 122 ms
40,036 KB
testcase_12 AC 154 ms
40,080 KB
testcase_13 AC 154 ms
40,112 KB
testcase_14 AC 116 ms
41,280 KB
testcase_15 AC 103 ms
40,264 KB
testcase_16 AC 111 ms
41,264 KB
testcase_17 AC 113 ms
41,456 KB
testcase_18 AC 110 ms
40,944 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 111 ms
39,892 KB
testcase_25 WA -
testcase_26 AC 143 ms
41,252 KB
testcase_27 AC 147 ms
40,320 KB
testcase_28 AC 146 ms
41,580 KB
testcase_29 AC 162 ms
41,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No44 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long n = N;
		long soinsuu = 0;
		long i = 2;
		while(n != 1) {
			if(n % i == 0) {
				n /= i;
				soinsuu++;
			}else if(i == 2) {
				i++;
			}else {
				i += 2;
			}
			if(i * i > N) {
				break;
			}
		}
		
		if(soinsuu >= 3) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
}
0