結果

問題 No.279 木の数え上げ
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-14 10:08:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 307 ms / 2,000 ms
コード長 416 bytes
コンパイル時間 2,428 ms
コンパイル使用メモリ 74,880 KB
実行使用メモリ 45,744 KB
最終ジャッジ日時 2024-04-28 19:02:28
合計ジャッジ時間 8,043 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,088 KB
testcase_01 AC 132 ms
41,336 KB
testcase_02 AC 133 ms
41,208 KB
testcase_03 AC 133 ms
41,676 KB
testcase_04 AC 130 ms
41,412 KB
testcase_05 AC 133 ms
41,248 KB
testcase_06 AC 131 ms
41,308 KB
testcase_07 AC 131 ms
41,072 KB
testcase_08 AC 133 ms
41,680 KB
testcase_09 AC 129 ms
41,060 KB
testcase_10 AC 307 ms
45,476 KB
testcase_11 AC 226 ms
42,340 KB
testcase_12 AC 287 ms
45,264 KB
testcase_13 AC 213 ms
41,900 KB
testcase_14 AC 296 ms
45,660 KB
testcase_15 AC 298 ms
45,400 KB
testcase_16 AC 296 ms
45,456 KB
testcase_17 AC 296 ms
45,572 KB
testcase_18 AC 252 ms
43,976 KB
testcase_19 AC 302 ms
45,744 KB
testcase_20 AC 307 ms
45,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int t = 0, r = 0, 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(Math.min(Math.min(t, r), e / 2));
	}
}
0