結果
問題 |
No.279 木の数え上げ
|
ユーザー |
|
提出日時 | 2021-03-08 19:21:45 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 178 ms / 2,000 ms |
コード長 | 562 bytes |
コンパイル時間 | 3,188 ms |
コンパイル使用メモリ | 74,792 KB |
実行使用メモリ | 42,632 KB |
最終ジャッジ日時 | 2024-10-10 11:24:27 |
合計ジャッジ時間 | 6,438 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No00000279_Main2 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); int[] cnt = new int[3]; for(int i = 0; i < str.length(); i++) { if(str.charAt(i) == 't') cnt[0] += 1; if(str.charAt(i) == 'r') cnt[1] += 1; if(str.charAt(i) == 'e') cnt[2] += 1; } System.out.println(Math.min(cnt[0], Math.min(cnt[1], cnt[2]/2))); } }