結果

問題 No.279 木の数え上げ
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-03 18:06:57
言語 Java21
(openjdk 21)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 627 bytes
コンパイル時間 3,715 ms
コンパイル使用メモリ 75,432 KB
実行使用メモリ 65,248 KB
最終ジャッジ日時 2023-11-10 17:45:23
合計ジャッジ時間 9,339 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
57,700 KB
testcase_01 AC 128 ms
57,824 KB
testcase_02 AC 125 ms
57,832 KB
testcase_03 AC 126 ms
57,564 KB
testcase_04 AC 126 ms
57,824 KB
testcase_05 AC 128 ms
56,076 KB
testcase_06 AC 124 ms
57,824 KB
testcase_07 AC 131 ms
57,724 KB
testcase_08 AC 127 ms
57,956 KB
testcase_09 AC 126 ms
57,716 KB
testcase_10 MLE -
testcase_11 AC 212 ms
60,116 KB
testcase_12 MLE -
testcase_13 AC 206 ms
57,960 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 AC 302 ms
63,092 KB
testcase_18 AC 249 ms
60,776 KB
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;

public class Exercise55{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    String str = sc.next();

    char[] strArray = str.toCharArray();

    int tCount = 0;
    int rCount = 0;
    int eeCount = 0;

    for(int i = 0; i < strArray.length; i++){
      if (strArray[i] == 't'){
        tCount++;
      }else if (strArray[i] == 'r'){
        rCount++;
      }else if (strArray[i] == 'e'){
        eeCount++;
      }
    }
    eeCount /= 2;
    int min = Math.min(tCount, Math.min(rCount, eeCount));
    System.out.println(min);
  }
}
0