結果

問題 No.279 木の数え上げ
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-20 12:11:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 316 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 2,050 ms
コンパイル使用メモリ 74,512 KB
実行使用メモリ 57,272 KB
最終ジャッジ日時 2024-04-10 02:44:58
合計ジャッジ時間 7,472 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
54,012 KB
testcase_01 AC 127 ms
54,156 KB
testcase_02 AC 125 ms
54,156 KB
testcase_03 AC 111 ms
53,140 KB
testcase_04 AC 126 ms
53,852 KB
testcase_05 AC 126 ms
54,248 KB
testcase_06 AC 126 ms
54,436 KB
testcase_07 AC 126 ms
53,956 KB
testcase_08 AC 128 ms
54,296 KB
testcase_09 AC 126 ms
54,204 KB
testcase_10 AC 283 ms
57,164 KB
testcase_11 AC 224 ms
54,400 KB
testcase_12 AC 259 ms
57,060 KB
testcase_13 AC 202 ms
54,416 KB
testcase_14 AC 316 ms
57,188 KB
testcase_15 AC 305 ms
57,096 KB
testcase_16 AC 261 ms
57,080 KB
testcase_17 AC 311 ms
57,092 KB
testcase_18 AC 252 ms
56,952 KB
testcase_19 AC 297 ms
57,272 KB
testcase_20 AC 313 ms
57,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int numt = 0;
    int numr = 0;
    int nume = 0;
    for(int i = 0; i < s.length(); i++) {
      if(s.charAt(i) == 't') numt++;
      if(s.charAt(i) == 'r') numr++;
      if(s.charAt(i) == 'e') nume++;
    }
    int ans = Math.min(numt, Math.min(numr, nume / 2));
    System.out.println(ans);
  }
}
0