結果

問題 No.279 木の数え上げ
ユーザー kkkk
提出日時 2015-09-22 14:57:41
言語 PHP
(8.3.4)
結果
MLE  
実行時間 -
コード長 520 bytes
コンパイル時間 893 ms
コンパイル使用メモリ 18,676 KB
実行使用メモリ 84,292 KB
最終ジャッジ日時 2023-09-26 14:23:53
合計ジャッジ時間 3,227 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,936 KB
testcase_01 AC 15 ms
18,812 KB
testcase_02 AC 15 ms
18,772 KB
testcase_03 AC 15 ms
18,812 KB
testcase_04 AC 16 ms
18,776 KB
testcase_05 AC 15 ms
18,780 KB
testcase_06 AC 15 ms
18,772 KB
testcase_07 AC 15 ms
18,832 KB
testcase_08 AC 15 ms
18,884 KB
testcase_09 AC 14 ms
18,768 KB
testcase_10 MLE -
testcase_11 AC 37 ms
32,952 KB
testcase_12 AC 80 ms
59,592 KB
testcase_13 AC 27 ms
26,852 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 AC 65 ms
49,468 KB
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

// your code goes here

$S = str_split(trim(fgets(STDIN)));
$str_arr = array();

for ($s=0; $s<count($S); $s++){
  if (empty($str_arr[$S[$s]])){
    $str_arr[$S[$s]] = 1;
  }else{
  	$str_arr[$S[$s]]++;
  }
}

$min = 0;

if (isset($str_arr['r']) && isset($str_arr['t'])){
	if ($str_arr['r']>=$str_arr['t']){
		$min = $str_arr["t"];
	}else{
		$min = $str_arr["r"];
	}
}else{
	$min = 0;
}

$e_min = floor( $str_arr['e'] / 2 );

$ans = 0;

if ($min>=$e_min){
	$ans = $e_min;
}else{
	$ans = $min;
}

echo $ans . "\n";
0