結果

問題 No.279 木の数え上げ
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-01-06 15:19:57
言語 Java21
(openjdk 21)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 577 bytes
コンパイル時間 3,759 ms
コンパイル使用メモリ 74,368 KB
実行使用メモリ 67,332 KB
最終ジャッジ日時 2023-10-29 01:22:36
合計ジャッジ時間 10,799 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
57,472 KB
testcase_01 AC 132 ms
57,468 KB
testcase_02 AC 131 ms
57,240 KB
testcase_03 AC 130 ms
57,636 KB
testcase_04 AC 128 ms
57,472 KB
testcase_05 AC 131 ms
57,444 KB
testcase_06 AC 130 ms
57,456 KB
testcase_07 AC 132 ms
57,488 KB
testcase_08 AC 134 ms
57,452 KB
testcase_09 AC 130 ms
57,252 KB
testcase_10 MLE -
testcase_11 AC 304 ms
60,436 KB
testcase_12 MLE -
testcase_13 AC 253 ms
60,628 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 AC 337 ms
62,944 KB
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;
	int t = 0;
	int r = 0;
	int e = 0;
	int tree = 0;
	int memory = 0;
	for(int i = 1; i <= S.length(); i++){
		str = S.substring(i-1,i);
		if(str.equals("t")){
			t++;
		}
		if(str.equals("r")){
			r++;
		}
		if(str.equals("e")){
			e++;
		}
	}
	memory = t;
	if(memory > r){
		memory = r;
	}
	if(memory > e/2){
		memory = e/2;
	}
	tree = memory;
	System.out.println(tree);
}
}
0