結果

問題 No.279 木の数え上げ
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-12 20:35:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 293 ms / 2,000 ms
コード長 555 bytes
コンパイル時間 1,986 ms
コンパイル使用メモリ 71,944 KB
実行使用メモリ 61,148 KB
最終ジャッジ日時 2023-08-17 03:55:51
合計ジャッジ時間 7,370 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,820 KB
testcase_01 AC 118 ms
55,564 KB
testcase_02 AC 120 ms
55,596 KB
testcase_03 AC 118 ms
55,652 KB
testcase_04 AC 117 ms
55,352 KB
testcase_05 AC 117 ms
56,304 KB
testcase_06 AC 119 ms
55,760 KB
testcase_07 AC 116 ms
55,664 KB
testcase_08 AC 118 ms
55,376 KB
testcase_09 AC 117 ms
55,764 KB
testcase_10 AC 271 ms
59,104 KB
testcase_11 AC 217 ms
58,316 KB
testcase_12 AC 255 ms
59,004 KB
testcase_13 AC 200 ms
56,408 KB
testcase_14 AC 268 ms
59,028 KB
testcase_15 AC 259 ms
61,148 KB
testcase_16 AC 293 ms
59,144 KB
testcase_17 AC 290 ms
59,112 KB
testcase_18 AC 254 ms
58,748 KB
testcase_19 AC 287 ms
59,120 KB
testcase_20 AC 290 ms
59,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int t = 0;
        int r = 0;
        int e = 0;
        for(int i=0; i<S.length(); i++){
            if( 't'==S.charAt(i) ){
                t++;
            }else if( 'r'==S.charAt(i) ){
                r++;
            }else if( 'e'==S.charAt(i) ){
                e++;
            }
        }
        int min = Math.min(t, Math.min(r,e/2) );
        System.out.println(min);
    }
}
0