結果

問題 No.279 木の数え上げ
ユーザー GrenacheGrenache
提出日時 2015-09-18 22:23:46
言語 Java21
(openjdk 21)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 630 bytes
コンパイル時間 3,980 ms
コンパイル使用メモリ 74,392 KB
実行使用メモリ 65,484 KB
最終ジャッジ日時 2023-11-27 19:53:23
合計ジャッジ時間 9,386 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
57,964 KB
testcase_01 AC 129 ms
57,832 KB
testcase_02 AC 129 ms
57,728 KB
testcase_03 AC 128 ms
57,848 KB
testcase_04 AC 138 ms
57,832 KB
testcase_05 AC 126 ms
57,704 KB
testcase_06 AC 125 ms
57,844 KB
testcase_07 AC 130 ms
57,960 KB
testcase_08 AC 142 ms
57,956 KB
testcase_09 AC 129 ms
57,960 KB
testcase_10 MLE -
testcase_11 AC 218 ms
60,192 KB
testcase_12 MLE -
testcase_13 AC 205 ms
58,216 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 AC 250 ms
60,944 KB
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder279 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        char[] s = sc.next().toCharArray();
        int[] cnt = new int[3];

        for (int i = 0; i < s.length; i++) {
        	if (s[i] == 't') {
        		cnt[0]++;
        	} else if (s[i] == 'r') {
        		cnt[1]++;
        	} else if (s[i] == 'e') {
        		cnt[2]++;
        	}
        }

        int ret = cnt[0];
        ret = Math.min(ret, cnt[1]);
        ret = Math.min(ret, cnt[2] / 2);
        
        System.out.println(ret);

        sc.close();
    }
}
0