結果

問題 No.279 木の数え上げ
ユーザー omc-test
提出日時 2016-08-05 09:16:33
言語 Java
(openjdk 23)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 6,677 ms
コンパイル使用メモリ 74,624 KB
実行使用メモリ 49,424 KB
最終ジャッジ日時 2024-09-26 06:13:34
合計ジャッジ時間 11,861 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;
public class No0279 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char c[] = sc.next().toCharArray();
		int tCount = 0;
		int rCount = 0;
		int eCount = 0;
		for(int i=0; i<c.length; i++){
			switch(c[i]){
			case 't':
				tCount++;
				break;
			case 'r':
				rCount++;
				break;
			case 'e':
				eCount++;
				break;
			}
		}
		eCount = eCount / 2;
		int ans[] = {tCount, rCount, eCount};
		Arrays.sort(ans);
		System.out.println(ans[0]);
	}
}
0