結果
問題 |
No.279 木の数え上げ
|
ユーザー |
![]() |
提出日時 | 2016-11-29 20:23:30 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 480 bytes |
コンパイル時間 | 3,355 ms |
コンパイル使用メモリ | 74,548 KB |
実行使用メモリ | 54,160 KB |
最終ジャッジ日時 | 2024-11-27 13:50:30 |
合計ジャッジ時間 | 8,250 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 21 |
ソースコード
import java.util.*; import java.math.*; public class pre { public static void main(String[] args) { Scanner s = new Scanner(System.in); String str = s.next(); int t=0,r=0,e=0; for(int i=0; i<str.length();i++){ if(str.charAt(i)=='t') t++; else if(str.charAt(i)=='r') r++; else if(str.charAt(i)=='e') e++; } int count=0; while(t>0 || r>0 || e>1){ t--; r--; e-=2; count++; } System.out.println(count); } }