結果

問題 No.279 木の数え上げ
ユーザー YukimotoPG
提出日時 2019-02-14 08:36:11
言語 Java
(openjdk 23)
結果
AC  
実行時間 311 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 2,052 ms
コンパイル使用メモリ 74,940 KB
実行使用メモリ 57,276 KB
最終ジャッジ日時 2024-09-13 11:16:47
合計ジャッジ時間 7,693 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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++;
		}
		System.out.println(min(t, r, e/2));


	}
	
	public static int max(int... ar) {Arrays.sort(ar);return ar[ar.length-1];}
	public static int min(int... ar) {Arrays.sort(ar);return ar[0];}
	
}
0