結果

問題 No.279 木の数え上げ
ユーザー omc-testomc-test
提出日時 2016-08-05 09:16:33
言語 Java21
(openjdk 21)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 536 bytes
コンパイル時間 3,118 ms
コンパイル使用メモリ 74,940 KB
実行使用メモリ 65,324 KB
最終ジャッジ日時 2023-11-19 03:15:59
合計ジャッジ時間 8,224 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
57,844 KB
testcase_01 AC 125 ms
58,208 KB
testcase_02 AC 118 ms
57,708 KB
testcase_03 AC 120 ms
57,844 KB
testcase_04 AC 117 ms
57,964 KB
testcase_05 AC 119 ms
57,708 KB
testcase_06 AC 108 ms
56,808 KB
testcase_07 AC 126 ms
57,712 KB
testcase_08 AC 119 ms
57,952 KB
testcase_09 AC 116 ms
57,968 KB
testcase_10 MLE -
testcase_11 AC 201 ms
60,048 KB
testcase_12 MLE -
testcase_13 AC 200 ms
58,212 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 AC 237 ms
60,856 KB
testcase_19 MLE -
testcase_20 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;
public class No0279 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char c[] = sc.next().toCharArray();
		int tCount = 0;
		int rCount = 0;
		int eCount = 0;
		for(int i=0; i<c.length; i++){
			switch(c[i]){
			case 't':
				tCount++;
				break;
			case 'r':
				rCount++;
				break;
			case 'e':
				eCount++;
				break;
			}
		}
		eCount = eCount / 2;
		int ans[] = {tCount, rCount, eCount};
		Arrays.sort(ans);
		System.out.println(ans[0]);
	}
}
0