結果

問題 No.279 木の数え上げ
ユーザー simansiman
提出日時 2021-03-27 17:16:32
言語 Ruby
(3.3.0)
結果
AC  
実行時間 399 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 1,000 ms
コンパイル使用メモリ 11,424 KB
実行使用メモリ 17,452 KB
最終ジャッジ日時 2023-08-19 14:57:13
合計ジャッジ時間 5,590 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
14,984 KB
testcase_01 AC 68 ms
15,080 KB
testcase_02 AC 70 ms
15,076 KB
testcase_03 AC 70 ms
15,020 KB
testcase_04 AC 67 ms
14,980 KB
testcase_05 AC 71 ms
15,220 KB
testcase_06 AC 68 ms
15,104 KB
testcase_07 AC 71 ms
15,128 KB
testcase_08 AC 69 ms
15,136 KB
testcase_09 AC 67 ms
15,292 KB
testcase_10 AC 381 ms
17,140 KB
testcase_11 AC 135 ms
15,760 KB
testcase_12 AC 279 ms
16,636 KB
testcase_13 AC 107 ms
15,564 KB
testcase_14 AC 399 ms
17,452 KB
testcase_15 AC 363 ms
17,012 KB
testcase_16 AC 339 ms
16,832 KB
testcase_17 AC 392 ms
17,440 KB
testcase_18 AC 228 ms
16,328 KB
testcase_19 AC 369 ms
17,208 KB
testcase_20 AC 398 ms
17,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

S = gets.chomp
counter = [0, 0, 0]

S.each_char do |s|
  counter[0] += 1 if s == 't'
  counter[1] += 1 if s == 'r'
  counter[2] += 1 if s == 'e'
end

puts [counter[0], counter[1], counter[2] / 2].min
0