結果

問題 No.279 木の数え上げ
ユーザー 37zigen37zigen
提出日時 2016-03-29 13:05:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 287 ms / 2,000 ms
コード長 464 bytes
コンパイル時間 1,857 ms
コンパイル使用メモリ 74,404 KB
実行使用メモリ 45,788 KB
最終ジャッジ日時 2024-04-22 16:17:55
合計ジャッジ時間 6,654 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
41,076 KB
testcase_01 AC 107 ms
41,028 KB
testcase_02 AC 112 ms
41,244 KB
testcase_03 AC 111 ms
41,100 KB
testcase_04 AC 104 ms
40,656 KB
testcase_05 AC 103 ms
40,104 KB
testcase_06 AC 109 ms
41,148 KB
testcase_07 AC 117 ms
41,188 KB
testcase_08 AC 110 ms
40,952 KB
testcase_09 AC 108 ms
40,956 KB
testcase_10 AC 286 ms
45,468 KB
testcase_11 AC 207 ms
43,220 KB
testcase_12 AC 246 ms
44,984 KB
testcase_13 AC 195 ms
41,832 KB
testcase_14 AC 276 ms
45,652 KB
testcase_15 AC 278 ms
45,548 KB
testcase_16 AC 264 ms
45,580 KB
testcase_17 AC 275 ms
45,648 KB
testcase_18 AC 236 ms
43,864 KB
testcase_19 AC 287 ms
45,388 KB
testcase_20 AC 273 ms
45,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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