結果

問題 No.279 木の数え上げ
ユーザー togaerrortogaerror
提出日時 2015-09-24 21:16:34
言語 Perl
(5.38.2)
結果
MLE  
実行時間 -
コード長 411 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 5,292 KB
実行使用メモリ 84,472 KB
最終ジャッジ日時 2023-09-26 14:54:13
合計ジャッジ時間 5,074 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,992 KB
testcase_01 AC 5 ms
5,100 KB
testcase_02 AC 5 ms
4,964 KB
testcase_03 AC 5 ms
4,980 KB
testcase_04 AC 5 ms
4,924 KB
testcase_05 AC 5 ms
5,044 KB
testcase_06 AC 5 ms
4,984 KB
testcase_07 AC 5 ms
5,076 KB
testcase_08 AC 5 ms
5,048 KB
testcase_09 AC 5 ms
4,972 KB
testcase_10 MLE -
testcase_11 AC 84 ms
20,652 KB
testcase_12 AC 244 ms
54,600 KB
testcase_13 AC 49 ms
13,892 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 AC 185 ms
42,684 KB
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;

my $s = <>;
chomp $s;
my @str = split //, $s;
my @count;

for(my $i = 0; $i < 3; $i++) {
	$count[$i] = 0; 
}

for(my $i = 0; $i < $#str + 1; $i++) {
	if($str[$i] eq 't') {
		$count[0]++;
	} elsif($str[$i] eq 'r') {
		$count[1]++;
	} elsif($str[$i] eq 'e') {
		$count[2]++;
	}
}
$count[2] /= 2;
$count[2] = int $count[2];

@count = sort {$a <=> $b} @count;

print "$count[0]\n";

exit;
0