結果

問題 No.279 木の数え上げ
ユーザー kichirb3
提出日時 2018-02-27 20:21:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 606 ms
コンパイル使用メモリ 68,448 KB
実行使用メモリ 5,292 KB
最終ジャッジ日時 2024-11-30 02:27:24
合計ジャッジ時間 1,678 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.279 木の数え上げ
// https://yukicoder.me/problems/no/279
//

#include <iostream>
#include <vector>
using namespace std;

int solve(string &S);

int main() {
    string S;
    cin >> S;
    int ans = solve(S);
    cout << ans << endl;
}

int solve(string &S) {
    vector<int> letters(26);
    for (char c: S) {
        letters[c - 'a']++;
    }

    int t = letters['t' - 'a'];
    int r = letters['r' - 'a'];
    int e = letters['e' - 'a'];
    return min(min(t, r), e/2);
}
0