結果

問題 No.279 木の数え上げ
ユーザー ぴろずぴろず
提出日時 2015-09-18 22:22:18
言語 Java19
(openjdk 21)
結果
AC  
実行時間 294 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 1,935 ms
コンパイル使用メモリ 72,180 KB
実行使用メモリ 61,180 KB
最終ジャッジ日時 2023-08-04 17:56:26
合計ジャッジ時間 6,982 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
55,880 KB
testcase_01 AC 117 ms
55,984 KB
testcase_02 AC 115 ms
55,404 KB
testcase_03 AC 109 ms
55,812 KB
testcase_04 AC 110 ms
55,660 KB
testcase_05 AC 114 ms
55,660 KB
testcase_06 AC 113 ms
55,372 KB
testcase_07 AC 116 ms
55,608 KB
testcase_08 AC 119 ms
55,396 KB
testcase_09 AC 112 ms
55,748 KB
testcase_10 AC 272 ms
59,000 KB
testcase_11 AC 199 ms
58,964 KB
testcase_12 AC 238 ms
59,068 KB
testcase_13 AC 186 ms
56,192 KB
testcase_14 AC 277 ms
58,940 KB
testcase_15 AC 245 ms
61,180 KB
testcase_16 AC 252 ms
57,156 KB
testcase_17 AC 254 ms
59,204 KB
testcase_18 AC 240 ms
58,984 KB
testcase_19 AC 294 ms
58,536 KB
testcase_20 AC 254 ms
59,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no279;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int[] count = new int[256];
		for(int i=0;i<s.length();i++) {
			count[s.charAt(i)]++;
		}
		int ans = count['t'];
		ans = Math.min(ans,count['r']);
		ans = Math.min(ans, count['e']/2);
		System.out.println(ans);
	}
}
0