結果

問題 No.279 木の数え上げ
ユーザー tom_tom_tomtom_tom_tom
提出日時 2015-11-10 17:01:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 276 ms / 2,000 ms
コード長 763 bytes
コンパイル時間 3,419 ms
コンパイル使用メモリ 74,388 KB
実行使用メモリ 45,660 KB
最終ジャッジ日時 2024-04-22 16:11:53
合計ジャッジ時間 7,953 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
40,796 KB
testcase_01 AC 98 ms
39,704 KB
testcase_02 AC 100 ms
40,168 KB
testcase_03 AC 113 ms
40,936 KB
testcase_04 AC 110 ms
40,896 KB
testcase_05 AC 112 ms
41,160 KB
testcase_06 AC 112 ms
40,956 KB
testcase_07 AC 102 ms
39,912 KB
testcase_08 AC 113 ms
39,736 KB
testcase_09 AC 110 ms
40,224 KB
testcase_10 AC 261 ms
45,652 KB
testcase_11 AC 182 ms
42,624 KB
testcase_12 AC 244 ms
45,352 KB
testcase_13 AC 179 ms
42,288 KB
testcase_14 AC 275 ms
45,660 KB
testcase_15 AC 256 ms
45,484 KB
testcase_16 AC 250 ms
45,096 KB
testcase_17 AC 276 ms
45,388 KB
testcase_18 AC 225 ms
43,908 KB
testcase_19 AC 275 ms
45,568 KB
testcase_20 AC 256 ms
45,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder;

import java.util.Scanner;

/**
 * http://yukicoder.me/problems/531
 * star1
 */
public class YukiCoder279 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int t = 0, r = 0, e = 0;
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c == 't') {
                t++;
            } else if (c == 'r') {
                r++;
            } else if (c == 'e') {
                e++;
            }
        }
        int num = Math.min(Math.min(t, r), e / 2);
        System.out.println(num);
    }
}
/*

takahashikunlovesyukicoder
1

treapisnotki
0

eerteerteerteert
4
*/
0