結果
| 問題 | 
                            No.279 木の数え上げ
                             | 
                    
| コンテスト | |
| ユーザー | 
                             hamray
                         | 
                    
| 提出日時 | 2017-11-17 00:37:20 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 24 ms / 2,000 ms | 
| コード長 | 485 bytes | 
| コンパイル時間 | 565 ms | 
| コンパイル使用メモリ | 74,116 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-25 07:03:29 | 
| 合計ジャッジ時間 | 2,043 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 21 | 
ソースコード
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<math.h>
#include<stack>
using namespace std;
int main(void){
    string S; cin >> S;
    int cnt_t = 0, cnt_r = 0, cnt_e = 0;
    int ans = 0;
    for(int i = 0; i < S.size(); i++){
       if(S[i] == 't') cnt_t++;
       if(S[i] == 'r') cnt_r++;
       if(S[i] == 'e') cnt_e++;
    }
    ans = min(cnt_e / 2, min(cnt_t, cnt_r));
    cout << ans << endl;
    return 0;
}
            
            
            
        
            
hamray