結果

問題 No.279 木の数え上げ
ユーザー kou6839kou6839
提出日時 2015-09-21 12:53:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 311 ms / 2,000 ms
コード長 538 bytes
コンパイル時間 2,570 ms
コンパイル使用メモリ 77,348 KB
実行使用メモリ 45,924 KB
最終ジャッジ日時 2024-04-22 16:05:24
合計ジャッジ時間 7,572 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,344 KB
testcase_01 AC 131 ms
41,396 KB
testcase_02 AC 131 ms
41,360 KB
testcase_03 AC 130 ms
41,552 KB
testcase_04 AC 129 ms
41,224 KB
testcase_05 AC 132 ms
41,616 KB
testcase_06 AC 130 ms
41,088 KB
testcase_07 AC 135 ms
41,248 KB
testcase_08 AC 134 ms
41,456 KB
testcase_09 AC 131 ms
41,792 KB
testcase_10 AC 304 ms
45,412 KB
testcase_11 AC 228 ms
42,932 KB
testcase_12 AC 277 ms
45,460 KB
testcase_13 AC 208 ms
42,180 KB
testcase_14 AC 306 ms
45,780 KB
testcase_15 AC 274 ms
45,464 KB
testcase_16 AC 298 ms
45,640 KB
testcase_17 AC 304 ms
45,924 KB
testcase_18 AC 273 ms
44,404 KB
testcase_19 AC 311 ms
45,852 KB
testcase_20 AC 311 ms
45,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.concurrent.locks.ReentrantReadWriteLock;

public class Main{
	public static void main(String[] args){
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		
		String in = sc.next();
		int t=0,r=0,e=0;
		for(int i=0;i<in.length();i++){
			if(in.charAt(i)=='t') t++;
			if(in.charAt(i)=='r') r++;
			if(in.charAt(i)=='e') e++;
		}
		
		if(t>=1 && r>=1 && e>=2){
			System.out.println(Math.min(t, Math.min(r, e/2)));
		}else{
			System.out.println(0);
		}
	}
}
0