結果

問題 No.279 木の数え上げ
ユーザー Lo_OTLo_OT
提出日時 2018-03-22 22:06:30
言語 Java21
(openjdk 21)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,151 bytes
コンパイル時間 3,370 ms
コンパイル使用メモリ 71,144 KB
実行使用メモリ 64,412 KB
最終ジャッジ日時 2023-09-07 01:50:59
合計ジャッジ時間 9,739 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,780 KB
testcase_01 AC 125 ms
56,064 KB
testcase_02 AC 124 ms
55,988 KB
testcase_03 AC 124 ms
54,080 KB
testcase_04 AC 121 ms
55,400 KB
testcase_05 AC 124 ms
55,344 KB
testcase_06 AC 125 ms
56,100 KB
testcase_07 AC 121 ms
56,016 KB
testcase_08 AC 124 ms
55,532 KB
testcase_09 AC 125 ms
55,500 KB
testcase_10 MLE -
testcase_11 AC 242 ms
59,416 KB
testcase_12 MLE -
testcase_13 AC 212 ms
56,860 KB
testcase_14 MLE -
testcase_15 AC 335 ms
63,896 KB
testcase_16 MLE -
testcase_17 MLE -
testcase_18 AC 288 ms
60,088 KB
testcase_19 AC 337 ms
63,828 KB
testcase_20 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        codeabbey solver = new codeabbey();
        solver.solve(1, in, out);
        out.close();
    }

    static class codeabbey {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int t = 0, r = 0, e = 0;
            String str = in.nextLine(); // 10^6

            for (char ch : str.toCharArray()) {
                if (ch == 't') t++;
                if (ch == 'r') r++;
                if (ch == 'e') e++;
            }
//        System.out.println("t:" + t + " ,r:" + r + " ,e:" + e);
            e = e / 2;
            int ans = Math.min(t, r);
            ans = Math.min(ans, e);
            out.println(ans);
        }

    }
}

0