結果

問題 No.279 木の数え上げ
ユーザー YOSHIYOSHI
提出日時 2021-03-08 19:21:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 205 ms / 2,000 ms
コード長 562 bytes
コンパイル時間 3,787 ms
コンパイル使用メモリ 74,124 KB
実行使用メモリ 42,804 KB
最終ジャッジ日時 2024-04-18 18:04:13
合計ジャッジ時間 7,138 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
36,920 KB
testcase_01 AC 58 ms
36,864 KB
testcase_02 AC 58 ms
37,112 KB
testcase_03 AC 58 ms
36,772 KB
testcase_04 AC 57 ms
36,516 KB
testcase_05 AC 58 ms
36,792 KB
testcase_06 AC 57 ms
36,704 KB
testcase_07 AC 58 ms
36,640 KB
testcase_08 AC 59 ms
36,928 KB
testcase_09 AC 58 ms
36,688 KB
testcase_10 AC 184 ms
42,644 KB
testcase_11 AC 131 ms
38,980 KB
testcase_12 AC 191 ms
42,352 KB
testcase_13 AC 95 ms
38,336 KB
testcase_14 AC 201 ms
42,804 KB
testcase_15 AC 177 ms
42,388 KB
testcase_16 AC 194 ms
42,360 KB
testcase_17 AC 198 ms
42,660 KB
testcase_18 AC 177 ms
41,176 KB
testcase_19 AC 205 ms
42,716 KB
testcase_20 AC 189 ms
42,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No00000279_Main2 {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		int[] cnt = new int[3];
		for(int i = 0; i < str.length(); i++) {
			if(str.charAt(i) == 't') cnt[0] += 1;
			if(str.charAt(i) == 'r') cnt[1] += 1;
			if(str.charAt(i) == 'e') cnt[2] += 1;
		}
		System.out.println(Math.min(cnt[0], Math.min(cnt[1], cnt[2]/2)));
	}
}
0