結果

問題 No.279 木の数え上げ
ユーザー harhogefoo
提出日時 2016-10-13 16:00:32
言語 Ruby
(3.4.1)
結果
AC  
実行時間 481 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 14,080 KB
最終ジャッジ日時 2024-11-22 03:42:53
合計ジャッジ時間 6,208 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp

h = Hash.new(0)
s.each_char do |c|
  if c == 't'
    h[:t] += 1
  elsif c == 'r'
    h[:r] += 1
  elsif c == 'e'
    h[:e] += 1
  end
end
h[:e] = h[:e] / 2

result = h.min { |a, b| a[1] <=> b[1] }
puts result[1]
0