結果

問題 No.279 木の数え上げ
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-01-06 15:07:08
言語 Java21
(openjdk 21)
結果
MLE  
実行時間 -
コード長 659 bytes
コンパイル時間 4,930 ms
コンパイル使用メモリ 74,628 KB
実行使用メモリ 121,772 KB
最終ジャッジ日時 2023-10-19 16:07:39
合計ジャッジ時間 11,973 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
57,256 KB
testcase_01 AC 138 ms
57,612 KB
testcase_02 AC 141 ms
57,096 KB
testcase_03 AC 138 ms
57,464 KB
testcase_04 AC 136 ms
57,016 KB
testcase_05 AC 139 ms
57,416 KB
testcase_06 AC 136 ms
57,492 KB
testcase_07 AC 139 ms
57,472 KB
testcase_08 AC 138 ms
57,048 KB
testcase_09 AC 136 ms
57,528 KB
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 AC 274 ms
62,928 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package yuki_coder;

import java.util.Scanner;

public class No_279 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	String S = sc.nextLine();
	sc.close();
	String[] str = new String[S.length()];
	int t = 0;
	int r = 0;
	int e = 0;
	int tree = 0;
	int memory = 0;
	for(int i = 1; i <=S.length(); i++){
		str[i-1] = S.substring(i-1, i);
	}
	for(int i = 0; i < S.length(); i++){
		if(str[i].equals("t")){
			t++;
		}
		if(str[i].equals("r")){
			r++;
		}
		if(str[i].equals("e")){
			e++;
		}
	}
	memory = t;
	if(memory > r){
		memory = r;
	}
	if(memory > e/2){
		memory = e/2;
	}
	tree = memory;
	System.out.println(tree);
}
}
0