結果

問題 No.312 置換処理
ユーザー sam_kinosam_kino
提出日時 2016-08-11 15:05:05
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 520 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 30,660 KB
実行使用メモリ 31,036 KB
最終ジャッジ日時 2024-04-25 01:21:46
合計ジャッジ時間 3,278 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
30,604 KB
testcase_01 AC 42 ms
30,892 KB
testcase_02 AC 40 ms
30,824 KB
testcase_03 AC 41 ms
30,704 KB
testcase_04 AC 41 ms
30,652 KB
testcase_05 AC 40 ms
30,972 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 41 ms
30,596 KB
testcase_14 AC 41 ms
30,716 KB
testcase_15 AC 40 ms
30,688 KB
testcase_16 AC 41 ms
30,848 KB
testcase_17 AC 40 ms
30,484 KB
testcase_18 AC 40 ms
30,828 KB
testcase_19 AC 40 ms
30,736 KB
testcase_20 AC 41 ms
30,888 KB
testcase_21 AC 41 ms
30,640 KB
testcase_22 AC 40 ms
30,616 KB
testcase_23 AC 41 ms
30,484 KB
testcase_24 AC 40 ms
30,508 KB
testcase_25 AC 42 ms
30,388 KB
testcase_26 AC 41 ms
30,636 KB
testcase_27 AC 42 ms
30,672 KB
testcase_28 AC 42 ms
30,804 KB
testcase_29 AC 41 ms
30,808 KB
testcase_30 AC 41 ms
30,780 KB
testcase_31 AC 40 ms
30,480 KB
testcase_32 AC 42 ms
30,920 KB
testcase_33 AC 40 ms
30,480 KB
testcase_34 AC 40 ms
30,444 KB
testcase_35 WA -
testcase_36 AC 41 ms
30,872 KB
testcase_37 AC 41 ms
30,816 KB
testcase_38 AC 41 ms
30,500 KB
testcase_39 AC 41 ms
30,572 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 40 ms
30,576 KB
testcase_43 AC 41 ms
30,804 KB
testcase_44 AC 41 ms
30,820 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;
}
//----------------------------------
for($i=11;$i<=($num/2);$i+=2){
	if(($i%3)==0 || ($i%5)==0 || ($i%7)==0){
		break;
	}

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

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

//echo "End SAM !!".PHP_EOL;
echo $num.PHP_EOL;
0