結果

問題 No.279 木の数え上げ
ユーザー YOSHI
提出日時 2021-03-08 19:17:40
言語 Java
(openjdk 23)
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 583 bytes
コンパイル時間 3,297 ms
コンパイル使用メモリ 75,388 KB
実行使用メモリ 42,964 KB
最終ジャッジ日時 2024-10-10 11:21:23
合計ジャッジ時間 6,670 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No00000279_Main {

	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;
		}
		cnt[2] /= 2;
		Arrays.sort(cnt);
		System.out.println(cnt[0]);
	}
}
0