結果
問題 | No.279 木の数え上げ |
ユーザー | rio-yuasa |
提出日時 | 2023-06-23 18:28:53 |
言語 | Ruby (3.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 422 bytes |
コンパイル時間 | 281 ms |
コンパイル使用メモリ | 11,408 KB |
実行使用メモリ | 68,012 KB |
最終ジャッジ日時 | 2023-09-13 13:22:15 |
合計ジャッジ時間 | 5,591 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 79 ms
15,064 KB |
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 | WA | - |
testcase_16 | WA | - |
testcase_17 | MLE | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | MLE | - |
コンパイルメッセージ
Syntax OK
ソースコード
# 入力された値を文字列で受け取る input = gets.chomp base = input.chars # tの数を数える count1 = base.count("t") # rの数を数える count2 = base.count("r") # eの数を数える count3 = base.count("e") a = 0 count1.times do if count1 <= count2 || (count1 * 2) <= count3 count1 = count1 - 1 count2 = count2 - 1 count3 = count3 - 1 a = a + 1 end end puts a