結果
問題 | No.279 木の数え上げ |
ユーザー |
![]() |
提出日時 | 2015-12-19 13:02:40 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 161 ms / 2,000 ms |
コード長 | 485 bytes |
コンパイル時間 | 2,081 ms |
コンパイル使用メモリ | 74,516 KB |
実行使用メモリ | 42,680 KB |
最終ジャッジ日時 | 2024-10-14 15:22:18 |
合計ジャッジ時間 | 4,718 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
import java.io.*; import java.util.*; class Main279 { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int cntT = 0, cntR = 0, cntE = 0; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == 't') cntT++; if (c == 'r') cntR++; if (c == 'e') cntE++; } System.out.println(Math.min(Math.min(cntT, cntR), cntE / 2)); } }