結果

問題 No.279 木の数え上げ
ユーザー Ryota EnokidoRyota Enokido
提出日時 2018-12-13 21:09:05
言語 Java21
(openjdk 21)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,152 bytes
コンパイル時間 2,233 ms
コンパイル使用メモリ 76,004 KB
実行使用メモリ 65,260 KB
最終ジャッジ日時 2023-10-25 09:32:00
合計ジャッジ時間 8,422 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
57,376 KB
testcase_01 AC 121 ms
57,408 KB
testcase_02 AC 121 ms
57,636 KB
testcase_03 AC 121 ms
57,432 KB
testcase_04 AC 123 ms
57,432 KB
testcase_05 AC 123 ms
57,612 KB
testcase_06 AC 125 ms
57,584 KB
testcase_07 AC 124 ms
57,628 KB
testcase_08 AC 126 ms
57,416 KB
testcase_09 AC 114 ms
56,376 KB
testcase_10 MLE -
testcase_11 AC 240 ms
58,096 KB
testcase_12 MLE -
testcase_13 AC 204 ms
58,136 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 AC 296 ms
62,876 KB
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.lang.Math;
import java.lang.StringBuilder;
import java.util.regex.Pattern;
import java.util.Arrays;


    public class Main {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
  
            String s = sc.nextLine();
            StringBuilder sb = new StringBuilder(s);
            int countT = 0;
            int countR = 0;
            int countE = 0;

            for(int i=0; i<s.length(); i++){
                switch(sb.charAt(i)){
                    case 't':
                        countT++;
                        break;
                    case 'r':
                        countR++;
                        break;
                    case 'e':
                        countE++;
                        break;
                }
            }
            
            
            
            System.out.println(min(countT,countR,countE/2));
        }
        
        public static int min(int a, int b, int c){
        	int minVal=a;
        	if(b<minVal) minVal = b;
        	if(c<minVal) minVal = c;
        	return	minVal;
        }
        
    }
0