結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,256 KB
testcase_01 AC 132 ms
41,264 KB
testcase_02 AC 130 ms
41,292 KB
testcase_03 AC 134 ms
41,296 KB
testcase_04 AC 128 ms
41,280 KB
testcase_05 AC 130 ms
41,268 KB
testcase_06 AC 126 ms
41,136 KB
testcase_07 AC 126 ms
41,212 KB
testcase_08 AC 131 ms
41,308 KB
testcase_09 AC 127 ms
41,256 KB
testcase_10 MLE -
testcase_11 AC 396 ms
57,364 KB
testcase_12 MLE -
testcase_13 AC 327 ms
54,176 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;
			default:
				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