結果
問題 | No.279 木の数え上げ |
ユーザー | threepipes_s |
提出日時 | 2015-10-06 13:27:48 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 165 ms / 2,000 ms |
コード長 | 1,577 bytes |
コンパイル時間 | 2,170 ms |
コンパイル使用メモリ | 78,492 KB |
実行使用メモリ | 54,472 KB |
最終ジャッジ日時 | 2024-10-14 15:15:33 |
合計ジャッジ時間 | 5,084 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 55 ms
50,292 KB |
testcase_01 | AC | 56 ms
50,280 KB |
testcase_02 | AC | 55 ms
49,872 KB |
testcase_03 | AC | 56 ms
50,108 KB |
testcase_04 | AC | 56 ms
50,284 KB |
testcase_05 | AC | 56 ms
49,984 KB |
testcase_06 | AC | 55 ms
49,884 KB |
testcase_07 | AC | 55 ms
50,100 KB |
testcase_08 | AC | 58 ms
50,124 KB |
testcase_09 | AC | 56 ms
50,172 KB |
testcase_10 | AC | 155 ms
54,100 KB |
testcase_11 | AC | 100 ms
51,428 KB |
testcase_12 | AC | 136 ms
53,952 KB |
testcase_13 | AC | 92 ms
51,284 KB |
testcase_14 | AC | 160 ms
54,240 KB |
testcase_15 | AC | 144 ms
54,120 KB |
testcase_16 | AC | 145 ms
54,256 KB |
testcase_17 | AC | 150 ms
53,836 KB |
testcase_18 | AC | 121 ms
53,496 KB |
testcase_19 | AC | 151 ms
54,080 KB |
testcase_20 | AC | 165 ms
54,472 KB |
ソースコード
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()); } }