結果

問題 No.279 木の数え上げ
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 08:36:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 303 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 1,910 ms
コンパイル使用メモリ 72,860 KB
実行使用メモリ 61,312 KB
最終ジャッジ日時 2023-10-11 12:29:21
合計ジャッジ時間 7,439 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,984 KB
testcase_01 AC 119 ms
55,968 KB
testcase_02 AC 119 ms
55,896 KB
testcase_03 AC 118 ms
55,844 KB
testcase_04 AC 116 ms
55,568 KB
testcase_05 AC 119 ms
56,340 KB
testcase_06 AC 117 ms
55,852 KB
testcase_07 AC 121 ms
55,760 KB
testcase_08 AC 121 ms
55,860 KB
testcase_09 AC 118 ms
56,356 KB
testcase_10 AC 302 ms
59,372 KB
testcase_11 AC 229 ms
58,396 KB
testcase_12 AC 291 ms
59,352 KB
testcase_13 AC 221 ms
56,700 KB
testcase_14 AC 303 ms
57,248 KB
testcase_15 AC 285 ms
59,464 KB
testcase_16 AC 254 ms
59,140 KB
testcase_17 AC 297 ms
59,060 KB
testcase_18 AC 236 ms
58,884 KB
testcase_19 AC 284 ms
61,312 KB
testcase_20 AC 286 ms
59,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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


	}
	
	public static int max(int... ar) {Arrays.sort(ar);return ar[ar.length-1];}
	public static int min(int... ar) {Arrays.sort(ar);return ar[0];}
	
}
0