結果

問題 No.279 木の数え上げ
ユーザー tokutaro
提出日時 2020-03-26 06:37:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 76,512 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-02 00:44:15
合計ジャッジ時間 1,794 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
#include <algorithm>
using namespace std;

int main() {
    string S;
    cin >> S;
    map<char, int> m;
    for (int i = 0; i < S.size(); i++) {
        if (S[i] == 't' || S[i] == 'r' || S[i] == 'e') {
            if (m.find(S[i]) != m.end()) m[S[i]] += 1;
            else m[S[i]] = 1;
        }
    }
    cout << min(min(m['t'], m['r']), m['e'] / 2) << endl;
    return 0;
}
0