結果

問題 No.279 木の数え上げ
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 17:10:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 316 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 2,479 ms
コンパイル使用メモリ 74,084 KB
実行使用メモリ 45,936 KB
最終ジャッジ日時 2024-04-16 17:48:07
合計ジャッジ時間 7,900 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
40,080 KB
testcase_01 AC 126 ms
41,160 KB
testcase_02 AC 128 ms
41,288 KB
testcase_03 AC 118 ms
40,112 KB
testcase_04 AC 126 ms
41,040 KB
testcase_05 AC 125 ms
41,296 KB
testcase_06 AC 128 ms
41,084 KB
testcase_07 AC 126 ms
41,328 KB
testcase_08 AC 113 ms
40,304 KB
testcase_09 AC 128 ms
41,300 KB
testcase_10 AC 314 ms
45,828 KB
testcase_11 AC 217 ms
42,768 KB
testcase_12 AC 288 ms
45,840 KB
testcase_13 AC 207 ms
42,268 KB
testcase_14 AC 315 ms
45,540 KB
testcase_15 AC 282 ms
45,552 KB
testcase_16 AC 286 ms
45,256 KB
testcase_17 AC 308 ms
45,592 KB
testcase_18 AC 261 ms
44,040 KB
testcase_19 AC 316 ms
45,532 KB
testcase_20 AC 308 ms
45,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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