結果

問題 No.279 木の数え上げ
ユーザー dazydazy
提出日時 2017-03-10 15:09:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 335 ms / 2,000 ms
コード長 540 bytes
コンパイル時間 3,027 ms
コンパイル使用メモリ 72,252 KB
実行使用メモリ 63,500 KB
最終ジャッジ日時 2023-09-06 13:14:23
合計ジャッジ時間 9,388 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
55,884 KB
testcase_01 AC 110 ms
53,996 KB
testcase_02 AC 109 ms
55,744 KB
testcase_03 AC 108 ms
55,688 KB
testcase_04 AC 107 ms
55,356 KB
testcase_05 AC 108 ms
55,924 KB
testcase_06 AC 109 ms
56,036 KB
testcase_07 AC 113 ms
55,944 KB
testcase_08 AC 112 ms
56,148 KB
testcase_09 AC 113 ms
56,140 KB
testcase_10 AC 322 ms
62,900 KB
testcase_11 AC 231 ms
59,156 KB
testcase_12 AC 290 ms
63,500 KB
testcase_13 AC 218 ms
59,096 KB
testcase_14 AC 325 ms
63,268 KB
testcase_15 AC 324 ms
60,928 KB
testcase_16 AC 278 ms
62,952 KB
testcase_17 AC 316 ms
62,708 KB
testcase_18 AC 280 ms
61,416 KB
testcase_19 AC 325 ms
62,956 KB
testcase_20 AC 335 ms
62,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        int ans;
        String N = scan.next();
        String tmp;
        int t = 0, r = 0, e = 0;
        for (int i = 0; i < N.length(); i++) {
            tmp = N.substring(i, i+1);
            if (tmp.equals("t")) t++;
            else if (tmp.equals("r")) r++;
            else if (tmp.equals("e")) e++;
        }

        ans = Math.min(Math.min(t, r), e/2);
        System.out.println(ans);
    }
}
0