結果

問題 No.279 木の数え上げ
ユーザー ちよちゃんちよちゃん
提出日時 2016-05-29 15:30:11
言語 Java21
(openjdk 21)
結果
MLE  
実行時間 -
コード長 650 bytes
コンパイル時間 3,557 ms
コンパイル使用メモリ 74,612 KB
実行使用メモリ 120,680 KB
最終ジャッジ日時 2024-04-16 18:16:05
合計ジャッジ時間 13,354 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,060 KB
testcase_01 AC 132 ms
41,156 KB
testcase_02 AC 133 ms
41,208 KB
testcase_03 AC 136 ms
41,328 KB
testcase_04 AC 130 ms
40,884 KB
testcase_05 AC 133 ms
41,076 KB
testcase_06 AC 130 ms
41,188 KB
testcase_07 AC 132 ms
41,252 KB
testcase_08 AC 132 ms
41,408 KB
testcase_09 AC 134 ms
41,432 KB
testcase_10 MLE -
testcase_11 AC 405 ms
57,712 KB
testcase_12 MLE -
testcase_13 AC 327 ms
52,088 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;
			} else { 
				break;
			}
		}
		System.out.println(count);
	}
}
0