結果

問題 No.279 木の数え上げ
ユーザー sekiya9311sekiya9311
提出日時 2016-05-02 02:07:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 1,118 bytes
コンパイル時間 976 ms
コンパイル使用メモリ 99,808 KB
実行使用メモリ 5,420 KB
最終ジャッジ日時 2024-04-22 16:19:23
合計ジャッジ時間 1,894 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

/*------------------------------------------*/
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <bitset>
#include <cmath>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>

#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define RREP(i,a) for(int (i)=(a)-1;(i)>=0;(i)--)
#define FORR(i,a,b) for(int (i)=(a)-1;(i)>=(b);(i)--)
#define MOD 1e9+7
#define PI acos(-1.0)
#define DEBUG(C) cout<<C<<endl;	//デバッグ用マクロ

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main(){
	string s; cin>>s;
	int tcnt=0,rcnt=0,ecnt=0;
	REP(i,s.size()){
		if(s[i]=='t') tcnt++;
		if(s[i]=='r') rcnt++;
		if(s[i]=='e') ecnt++;
	}
	int cnt=tcnt;
	cnt=min(cnt,rcnt);
	cnt=min(cnt,ecnt/2);
	cout<<cnt<<endl;
}
0