結果

問題 No.279 木の数え上げ
ユーザー 水野嶺水野嶺
提出日時 2020-05-28 15:32:08
言語 Java19
(openjdk 21)
結果
WA  
実行時間 -
コード長 599 bytes
コンパイル時間 1,727 ms
コンパイル使用メモリ 70,868 KB
実行使用メモリ 63,736 KB
最終ジャッジ日時 2023-08-03 06:33:37
合計ジャッジ時間 6,769 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 111 ms
56,256 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) 
	{
		// 入力値の読み込み
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		int countt = 0;
		int countr = 0;
		int counte = 0;
		
		char t='t';
		char r='r';
		char e='e';
		
		for(char x: str.toCharArray()){
			if(x == t){
				countt++;
			}else if(x == r){
				countr++;
			}else if(x == e){
				counte++;
			}
		}
		
		int min =countt;
		if(countt > countr){
			min = countr;
		}
		if(min > counte/2){
			min = counte;
		}
		
		System.out.println(min);
	}
}
0