結果

問題 No.279 木の数え上げ
ユーザー 29da164
提出日時 2020-07-24 17:01:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 548 ms
コンパイル使用メモリ 64,472 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-25 13:50:34
合計ジャッジ時間 1,603 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

int main(void){
  int it=0;
  int ir=0;
  int ie=0;
  int x=0;
  std::string a;
  std::cin >> a;
  const char* ca = a.c_str();
  for(int i=0;i<a.length();i++){
    if(ca[i]=='t') it++;
    if(ca[i]=='r') ir++;
    if(ca[i]=='e') ie++;
  }
  if(it>=ir){
    if(ir>=ie/2) x=ie/2;
    else x=ir;
  }
  else x=it;
  std::cout << x << std::endl;
}
0