結果

問題 No.279 木の数え上げ
ユーザー 29da16429da164
提出日時 2020-07-24 17:01:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 789 ms
コンパイル使用メモリ 64,828 KB
実行使用メモリ 5,392 KB
最終ジャッジ日時 2023-09-07 20:03:02
合計ジャッジ時間 1,715 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 WA -
testcase_11 AC 6 ms
4,380 KB
testcase_12 AC 15 ms
4,380 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 19 ms
4,380 KB
testcase_16 AC 17 ms
4,384 KB
testcase_17 WA -
testcase_18 AC 11 ms
4,380 KB
testcase_19 AC 20 ms
4,376 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

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