結果

問題 No.279 木の数え上げ
ユーザー threepipes_sthreepipes_s
提出日時 2015-10-06 13:27:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 1,577 bytes
コンパイル時間 2,094 ms
コンパイル使用メモリ 76,664 KB
実行使用メモリ 43,400 KB
最終ジャッジ日時 2024-04-22 16:08:02
合計ジャッジ時間 5,057 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
36,824 KB
testcase_01 AC 52 ms
36,944 KB
testcase_02 AC 51 ms
36,788 KB
testcase_03 AC 52 ms
37,076 KB
testcase_04 AC 52 ms
36,996 KB
testcase_05 AC 52 ms
36,936 KB
testcase_06 AC 52 ms
37,004 KB
testcase_07 AC 52 ms
36,812 KB
testcase_08 AC 53 ms
36,688 KB
testcase_09 AC 52 ms
36,612 KB
testcase_10 AC 157 ms
42,776 KB
testcase_11 AC 101 ms
39,360 KB
testcase_12 AC 140 ms
42,116 KB
testcase_13 AC 95 ms
38,936 KB
testcase_14 AC 167 ms
43,016 KB
testcase_15 AC 149 ms
42,468 KB
testcase_16 AC 145 ms
42,204 KB
testcase_17 AC 155 ms
42,712 KB
testcase_18 AC 121 ms
40,784 KB
testcase_19 AC 155 ms
42,840 KB
testcase_20 AC 160 ms
43,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args){
		try {
			(new Solve()).solve();
		} catch (NumberFormatException | IOException e) {
			e.printStackTrace();
		}
	}
}

class Solve{
	void solve() throws NumberFormatException, IOException{
		final ContestScanner in = new ContestScanner();
		char[] s = in.nextToken().toCharArray();
		int[] alp = new int[26];
		for(int i=0; i<s.length; i++){
			alp[s[i]-'a']++;
		}
		System.out.println(Math.min(alp['r'-'a'], Math.min(alp['t'-'a'], alp['e'-'a']/2)));
	}
}

class ContestScanner {
	private BufferedReader reader;
	private String[] line;
	private int idx;

	public ContestScanner() throws FileNotFoundException {
		reader = new BufferedReader(new InputStreamReader(System.in));
	}

	public ContestScanner(String filename) throws FileNotFoundException {
		reader = new BufferedReader(new InputStreamReader(new FileInputStream(
				filename)));
	}

	public String nextToken() throws IOException {
		if (line == null || line.length <= idx) {
			line = reader.readLine().trim().split(" ");
			idx = 0;
		}
		return line[idx++];
	}

	public long nextLong() throws IOException, NumberFormatException {
		return Long.parseLong(nextToken());
	}

	public int nextInt() throws NumberFormatException, IOException {
		return (int) nextLong();
	}

	public double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}
}
0