結果

問題 No.312 置換処理
ユーザー sam_kinosam_kino
提出日時 2016-08-11 18:13:45
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 31,308 KB
実行使用メモリ 31,428 KB
最終ジャッジ日時 2024-04-25 01:30:32
合計ジャッジ時間 3,471 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
31,020 KB
testcase_01 AC 89 ms
31,032 KB
testcase_02 AC 118 ms
31,320 KB
testcase_03 AC 111 ms
30,980 KB
testcase_04 AC 38 ms
31,020 KB
testcase_05 AC 38 ms
30,776 KB
testcase_06 AC 42 ms
30,936 KB
testcase_07 AC 63 ms
31,384 KB
testcase_08 AC 40 ms
31,032 KB
testcase_09 AC 41 ms
30,768 KB
testcase_10 AC 41 ms
31,028 KB
testcase_11 AC 47 ms
30,816 KB
testcase_12 AC 41 ms
31,332 KB
testcase_13 AC 40 ms
30,912 KB
testcase_14 AC 40 ms
31,428 KB
testcase_15 AC 40 ms
31,152 KB
testcase_16 AC 41 ms
30,956 KB
testcase_17 AC 40 ms
31,184 KB
testcase_18 AC 38 ms
31,028 KB
testcase_19 AC 40 ms
31,328 KB
testcase_20 AC 38 ms
31,388 KB
testcase_21 AC 39 ms
31,084 KB
testcase_22 AC 41 ms
31,188 KB
testcase_23 AC 40 ms
30,848 KB
testcase_24 AC 40 ms
30,820 KB
testcase_25 AC 40 ms
30,924 KB
testcase_26 AC 41 ms
31,016 KB
testcase_27 AC 41 ms
31,008 KB
testcase_28 AC 39 ms
31,032 KB
testcase_29 AC 39 ms
31,144 KB
testcase_30 AC 49 ms
30,932 KB
testcase_31 AC 40 ms
31,128 KB
testcase_32 AC 45 ms
30,960 KB
testcase_33 AC 60 ms
31,288 KB
testcase_34 AC 62 ms
31,196 KB
testcase_35 AC 41 ms
30,968 KB
testcase_36 AC 39 ms
31,012 KB
testcase_37 AC 38 ms
30,928 KB
testcase_38 AC 38 ms
31,208 KB
testcase_39 AC 38 ms
30,816 KB
testcase_40 AC 40 ms
31,220 KB
testcase_41 AC 40 ms
31,032 KB
testcase_42 WA -
testcase_43 AC 40 ms
31,004 KB
testcase_44 AC 41 ms
31,088 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?PHP
//   cd dot/PHP
//   PHP try.php

$num=trim(fgets(STDIN));
if(($num%3)==0){
	echo "3".PHP_EOL;
	exit;
}

if(($num%4)==0){
	echo "4".PHP_EOL;
	exit;
}

if(($num%5)==0){
	echo "5".PHP_EOL;
	exit;
}

if(($num%7)==0){
	echo "7".PHP_EOL;
	exit;
}
if(($num%11)==0){
	echo "7".PHP_EOL;
	exit;
}
//----------------------------------
for($i=13;$i<=sqrt($num);$i+=2){
	if(($i%3)==0 || ($i%5)==0 || ($i%7)==0 || ($i%11)==0){
		continue;
	}elseif(($num%$i)==0){
		echo $i.PHP_EOL;
		exit;
	}

}
	if($num%2==0){
		echo ($num/2).PHP_EOL;
		exit;
	}else{
		echo $num.PHP_EOL;
	}
0