結果

問題 No.279 木の数え上げ
ユーザー @abcde
提出日時 2019-02-11 14:56:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 1,314 ms
コンパイル使用メモリ 167,136 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 10:33:53
合計ジャッジ時間 2,825 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    
    // 1. 入力情報取得.
    string S;
    cin >> S;
    map<char, int> m;
    for(int i = 0; i < S.size(); i++) m[S[i]]++;
    
    // 2. 部分文字列 "tree" を何個生成出来るかをカウント.
    int ans = min(m['t'], m['r']);
    ans = min(ans, m['e'] / 2);
    
    // 3. 出力 ~ 後処理.
    cout << ans << endl;
    return 0;
    
}
0