結果

問題 No.279 木の数え上げ
ユーザー kkkk
提出日時 2015-09-22 15:27:55
言語 PHP
(8.3.4)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 18,748 KB
実行使用メモリ 19,032 KB
最終ジャッジ日時 2023-08-04 18:03:29
合計ジャッジ時間 2,282 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,980 KB
testcase_01 AC 15 ms
18,964 KB
testcase_02 AC 16 ms
18,904 KB
testcase_03 AC 16 ms
18,916 KB
testcase_04 AC 16 ms
18,936 KB
testcase_05 AC 16 ms
18,784 KB
testcase_06 AC 15 ms
19,032 KB
testcase_07 AC 16 ms
18,968 KB
testcase_08 AC 16 ms
18,936 KB
testcase_09 AC 16 ms
18,768 KB
testcase_10 AC 105 ms
18,952 KB
testcase_11 AC 35 ms
18,944 KB
testcase_12 AC 75 ms
18,932 KB
testcase_13 AC 26 ms
18,968 KB
testcase_14 AC 110 ms
19,032 KB
testcase_15 AC 93 ms
18,952 KB
testcase_16 AC 86 ms
18,968 KB
testcase_17 AC 103 ms
18,936 KB
testcase_18 AC 61 ms
18,920 KB
testcase_19 AC 101 ms
18,952 KB
testcase_20 AC 108 ms
18,964 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

$str_arr = array();

while(( $S = fgetc( STDIN ) )) {
	if ($S=='t'){
        $str_arr['t'] += 1;
	}else if($S=='r'){
		$str_arr['r'] += 1;
	}else if($S=='e'){
		$str_arr['e'] += 1;
	}
}

$S = "";
$min = 0;

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

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

$ans = 0;

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

echo $ans . "\n";
0