結果

問題 No.791 うし数列
ユーザー dyechidyechi
提出日時 2019-03-28 10:35:12
言語 PHP
(8.3.4)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 32,016 KB
実行使用メモリ 31,472 KB
最終ジャッジ日時 2024-04-20 17:35:00
合計ジャッジ時間 1,522 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
31,108 KB
testcase_01 AC 38 ms
31,172 KB
testcase_02 AC 37 ms
31,472 KB
testcase_03 AC 35 ms
31,032 KB
testcase_04 AC 37 ms
31,212 KB
testcase_05 AC 37 ms
31,276 KB
testcase_06 AC 37 ms
31,332 KB
testcase_07 AC 36 ms
30,948 KB
testcase_08 AC 38 ms
31,032 KB
testcase_09 AC 37 ms
30,832 KB
testcase_10 AC 37 ms
30,820 KB
testcase_11 AC 37 ms
30,956 KB
testcase_12 AC 38 ms
30,832 KB
testcase_13 AC 38 ms
30,888 KB
testcase_14 AC 36 ms
31,380 KB
testcase_15 AC 37 ms
31,052 KB
testcase_16 AC 36 ms
31,372 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

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

if (strlen($s) > 1) {
	if (substr_count($s, "3") == strlen($s) - 1 && substr($s, 0, 1) == "1") {
		echo substr_count($s, "3", 1).PHP_EOL;
	} else {
		echo "-1".PHP_EOL;
	}
} else {
    echo "-1".PHP_EOL;
}
?>
0