結果

問題 No.36 素数が嫌い!
ユーザー 37zigen37zigen
提出日時 2016-05-05 16:45:02
言語 PHP
(8.3.4)
結果
RE  
実行時間 -
コード長 230 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 32,272 KB
実行使用メモリ 32,788 KB
最終ジャッジ日時 2024-04-15 13:17:30
合計ジャッジ時間 5,348 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 46 ms
32,400 KB
testcase_03 AC 45 ms
32,404 KB
testcase_04 RE -
testcase_05 AC 48 ms
32,528 KB
testcase_06 AC 48 ms
32,400 KB
testcase_07 AC 53 ms
32,216 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 388 ms
32,400 KB
testcase_12 AC 1,118 ms
32,400 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 46 ms
32,216 KB
testcase_17 AC 45 ms
32,276 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 132 ms
32,404 KB
testcase_27 AC 49 ms
32,272 KB
testcase_28 AC 132 ms
32,404 KB
testcase_29 AC 49 ms
32,400 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n=trim(fgets(STDIN));
// $n=6;
$f_count=0;
for($i=2;$i*$i<=$n;$i++){
	while($n%$i==0){
		$f_count++;
		$n/=$i;
		if($f_count>1)break 2;
	}
}
if($f_count>1&&!(f_count==2&&$n==1))echo "YES".PHP_EOL;
else echo "NO".PHP_EOL;
?>
0