結果
| 問題 | 
                            No.279 木の数え上げ
                             | 
                    
| コンテスト | |
| ユーザー | 
                            👑  | 
                    
| 提出日時 | 2022-08-08 23:11:01 | 
| 言語 | C++17(gcc12)  (gcc 12.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 38 ms / 2,000 ms | 
| コード長 | 856 bytes | 
| コンパイル時間 | 595 ms | 
| コンパイル使用メモリ | 72,892 KB | 
| 最終ジャッジ日時 | 2025-01-30 19:32:17 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 21 | 
ソースコード
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <stdio.h>
#include <stdint.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
#define CIN( LL , A ) LL A; cin >> A 
#define GETLINE( A ) string A; getline( cin , A ) 
int main()
{
  CIN( string , S );
  const uint& size = S.size();
  const string t = "t";
  const string r = "r";
  const string e = "e";
  ll t_num = 0;
  ll r_num = 0;
  ll e_num = 0;
  for( ll i = 0 ; i < size ; i++ ){
    const string c = S.substr( i , 1 );
    if( c == t ){
      t_num++;
    } else if( c == r ){
      r_num++;
    } else if( c == e ){
      e_num++;
    }
  }
  ll min_num = t_num;
  if( r_num < min_num ){
    min_num = r_num;
  }
  e_num /= 2;
  if( e_num < min_num ){
    min_num = e_num;
  }
  cout << min_num << endl;
  return 0;
}