結果

問題 No.279 木の数え上げ
ユーザー ちよちゃんちよちゃん
提出日時 2016-05-26 17:41:56
言語 Java21
(openjdk 21)
結果
MLE  
実行時間 -
コード長 626 bytes
コンパイル時間 4,357 ms
コンパイル使用メモリ 74,952 KB
実行使用メモリ 120,500 KB
最終ジャッジ日時 2024-04-16 17:31:05
合計ジャッジ時間 12,577 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,460 KB
testcase_01 AC 131 ms
41,464 KB
testcase_02 AC 129 ms
41,028 KB
testcase_03 AC 128 ms
41,192 KB
testcase_04 AC 128 ms
41,540 KB
testcase_05 AC 131 ms
41,428 KB
testcase_06 AC 130 ms
41,560 KB
testcase_07 AC 130 ms
41,172 KB
testcase_08 AC 132 ms
41,684 KB
testcase_09 AC 129 ms
41,476 KB
testcase_10 MLE -
testcase_11 AC 408 ms
57,660 KB
testcase_12 MLE -
testcase_13 AC 343 ms
53,988 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Yuki279 {
	
	public static void main(String[] args) {
	
		Scanner scan = new Scanner(System.in);
		String str = scan.next();
		scan.close();
		String strArr[] = str.split("");
		int t = 0;
		int r = 0;
		int e = 0;
		for(int i = 0; i < strArr.length; i++ ) {
			switch (strArr[i]) {
			case "t":
				t += 1;
				break;
			case "r":
				r += 1;
				break;
			case "e":
				e += 1;
				break;
			}
		}
		int count = 0;
		while(t >= 1 && r >= 1 && e >= 2){
			if(t>=1 && r>=1 && e>=2){
				count++;
				t -= 1; r -= 1; e -= 2;
			}
		}
		System.out.println(count);
	}
}
0