結果

問題 No.279 木の数え上げ
ユーザー spaciaspacia
提出日時 2015-12-19 13:02:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 2,487 ms
コンパイル使用メモリ 74,308 KB
実行使用メモリ 42,552 KB
最終ジャッジ日時 2024-04-22 16:13:42
合計ジャッジ時間 4,997 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
36,824 KB
testcase_01 AC 48 ms
36,836 KB
testcase_02 AC 47 ms
36,832 KB
testcase_03 AC 47 ms
37,008 KB
testcase_04 AC 47 ms
36,668 KB
testcase_05 AC 50 ms
36,904 KB
testcase_06 AC 48 ms
36,676 KB
testcase_07 AC 48 ms
36,904 KB
testcase_08 AC 50 ms
36,740 KB
testcase_09 AC 50 ms
36,572 KB
testcase_10 AC 154 ms
41,352 KB
testcase_11 AC 101 ms
38,844 KB
testcase_12 AC 140 ms
41,152 KB
testcase_13 AC 80 ms
38,236 KB
testcase_14 AC 166 ms
42,280 KB
testcase_15 AC 169 ms
42,504 KB
testcase_16 AC 142 ms
41,328 KB
testcase_17 AC 161 ms
42,468 KB
testcase_18 AC 117 ms
39,860 KB
testcase_19 AC 157 ms
41,796 KB
testcase_20 AC 160 ms
42,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main279 {
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		String s = br.readLine();
		int cntT = 0, cntR = 0, cntE = 0;
		
		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);
			if (c == 't') cntT++;
			if (c == 'r') cntR++;
			if (c == 'e') cntE++;
		}
		
		System.out.println(Math.min(Math.min(cntT, cntR), cntE / 2));
	}
}
0