結果

問題 No.279 木の数え上げ
ユーザー friedrice
提出日時 2024-11-25 21:58:24
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 4,943 ms
コンパイル使用メモリ 307,472 KB
実行使用メモリ 5,348 KB
最終ジャッジ日時 2024-11-25 21:58:31
合計ジャッジ時間 6,108 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
using mint = atcoder::modint998244353;
using maxt = atcoder::modint1000000007;

int main() {
  string S;
  cin >> S;
  int t_cnt = 0, r_cnt = 0, e_cnt = 0;
  for(char o : S) {
    if(o == 't') {
      t_cnt++;
    }
    else if(o == 'r') {
      r_cnt++;
    }
    else if(o == 'e') {
      e_cnt++;
    }
  }
  cout << min(t_cnt, min(r_cnt, e_cnt / 2)) << endl;
}
0