結果

問題 No.279 木の数え上げ
ユーザー rf141rf141
提出日時 2015-12-20 14:17:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 322 ms / 2,000 ms
コード長 539 bytes
コンパイル時間 2,772 ms
コンパイル使用メモリ 74,324 KB
実行使用メモリ 45,768 KB
最終ジャッジ日時 2024-04-22 16:14:15
合計ジャッジ時間 7,928 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,088 KB
testcase_01 AC 133 ms
41,112 KB
testcase_02 AC 134 ms
41,348 KB
testcase_03 AC 136 ms
41,124 KB
testcase_04 AC 134 ms
41,196 KB
testcase_05 AC 133 ms
41,176 KB
testcase_06 AC 130 ms
41,040 KB
testcase_07 AC 130 ms
41,112 KB
testcase_08 AC 133 ms
41,292 KB
testcase_09 AC 130 ms
41,488 KB
testcase_10 AC 322 ms
45,680 KB
testcase_11 AC 235 ms
42,604 KB
testcase_12 AC 273 ms
45,212 KB
testcase_13 AC 220 ms
42,148 KB
testcase_14 AC 315 ms
45,676 KB
testcase_15 AC 308 ms
45,748 KB
testcase_16 AC 303 ms
45,628 KB
testcase_17 AC 307 ms
45,768 KB
testcase_18 AC 268 ms
43,736 KB
testcase_19 AC 313 ms
45,672 KB
testcase_20 AC 319 ms
45,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;
public class Main{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		System.out.println(Calc(s));
	}

	public static int Calc(String s){
		int t = 0;
		int r = 0;
		int e = 0;
		for(int i = 0; i < s.length(); i++){
			if(s.charAt(i) == 't'){
				t++;
			}else if(s.charAt(i) == 'r'){
				r++;
			}else if(s.charAt(i) == 'e'){
				e++;
			}
		}
		if(t == 0 || r == 0 || e == 0)return 0;
		return (int)Math.min((int)Math.min(t,r),e/2);
	}
}
0