結果

問題 No.279 木の数え上げ
ユーザー ayaaya
提出日時 2019-07-29 13:40:27
言語 PHP
(8.3.4)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 587 bytes
コンパイル時間 643 ms
コンパイル使用メモリ 18,788 KB
実行使用メモリ 20,864 KB
最終ジャッジ日時 2023-09-15 11:50:08
合計ジャッジ時間 1,565 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,912 KB
testcase_01 AC 16 ms
18,860 KB
testcase_02 AC 16 ms
18,764 KB
testcase_03 AC 16 ms
18,760 KB
testcase_04 AC 16 ms
18,752 KB
testcase_05 AC 16 ms
18,860 KB
testcase_06 AC 16 ms
18,764 KB
testcase_07 AC 16 ms
18,728 KB
testcase_08 AC 16 ms
18,752 KB
testcase_09 AC 16 ms
18,724 KB
testcase_10 AC 20 ms
20,800 KB
testcase_11 AC 16 ms
18,768 KB
testcase_12 AC 18 ms
18,620 KB
testcase_13 AC 16 ms
18,728 KB
testcase_14 AC 19 ms
20,668 KB
testcase_15 AC 19 ms
20,780 KB
testcase_16 AC 18 ms
18,756 KB
testcase_17 AC 18 ms
20,696 KB
testcase_18 AC 17 ms
18,792 KB
testcase_19 AC 19 ms
20,864 KB
testcase_20 AC 19 ms
20,704 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
/**
 * No.279 木の数え上げ
 * 問題文
 *kamipeipaa君は木が大好きですが,今日は文字列で遊んでいます。
 *kamipeipaa君は文字列Sを並び替えたときに"tree"という部分文字列をいくつ作ることが可能か興味があります。教えてあげてください。
 *入力
 *S
 */
$researchWord="tree";

$input=trim(fgets(STDIN));
$research=array_count_values(str_split($researchWord));
$tid=array();
foreach($research as $key =>$value){
  $tid+=array($key =>floor(substr_count($input,$key)/$value));
}

sort($tid);
echo $tid[0];
?>
0