結果

問題 No.279 木の数え上げ
ユーザー rio-yuasario-yuasa
提出日時 2023-06-23 18:25:00
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 11,268 KB
実行使用メモリ 77,108 KB
最終ジャッジ日時 2023-09-13 13:17:54
合計ジャッジ時間 6,051 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 MLE -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 WA -
testcase_17 MLE -
testcase_18 WA -
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# 入力された値を文字列で受け取る
input = gets.chomp

base = input.chars

base.count("t")

# tの数を数える
count1 = base.count("t")
# rの数を数える
count2 = base.count("r")
# eの数を数える
count3 = base.count("e")

a = 0
count1.times do
    puts count1
    puts count2
    puts count3
    if count1 <= count2 || (count1 * 2) <= count3
        count1 = count1 - 1
        count2 = count2 - 1
        count3 = count3 - 1
        a = a + 1
    end
end

puts a
0