結果

問題 No.279 木の数え上げ
ユーザー Tsukasa_Type
提出日時 2018-02-09 17:10:54
言語 Java
(openjdk 23)
結果
AC  
実行時間 306 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 2,247 ms
コンパイル使用メモリ 74,480 KB
実行使用メモリ 45,948 KB
最終ジャッジ日時 2024-10-07 16:35:54
合計ジャッジ時間 7,737 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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