結果

問題 No.36 素数が嫌い!
ユーザー 37zigen37zigen
提出日時 2016-05-05 16:46:39
言語 PHP
(8.3.4)
結果
AC  
実行時間 1,248 ms / 5,000 ms
コード長 223 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 18,408 KB
実行使用メモリ 18,728 KB
最終ジャッジ日時 2023-09-09 07:37:08
合計ジャッジ時間 5,126 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,592 KB
testcase_01 AC 21 ms
18,688 KB
testcase_02 AC 15 ms
18,480 KB
testcase_03 AC 15 ms
18,608 KB
testcase_04 AC 15 ms
18,504 KB
testcase_05 AC 16 ms
18,600 KB
testcase_06 AC 18 ms
18,632 KB
testcase_07 AC 19 ms
18,548 KB
testcase_08 AC 16 ms
18,728 KB
testcase_09 AC 15 ms
18,536 KB
testcase_10 AC 15 ms
18,592 KB
testcase_11 AC 404 ms
18,724 KB
testcase_12 AC 1,248 ms
18,560 KB
testcase_13 AC 1,244 ms
18,728 KB
testcase_14 AC 19 ms
18,676 KB
testcase_15 AC 15 ms
18,616 KB
testcase_16 AC 15 ms
18,600 KB
testcase_17 AC 15 ms
18,588 KB
testcase_18 AC 15 ms
18,636 KB
testcase_19 AC 15 ms
18,604 KB
testcase_20 AC 24 ms
18,600 KB
testcase_21 AC 15 ms
18,608 KB
testcase_22 AC 15 ms
18,576 KB
testcase_23 AC 15 ms
18,568 KB
testcase_24 AC 58 ms
18,504 KB
testcase_25 AC 15 ms
18,592 KB
testcase_26 AC 119 ms
18,656 KB
testcase_27 AC 21 ms
18,640 KB
testcase_28 AC 117 ms
18,552 KB
testcase_29 AC 19 ms
18,560 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n=trim(fgets(STDIN));

$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