結果

問題 No.279 木の数え上げ
ユーザー gotutiyan
提出日時 2017-09-29 15:56:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 642 bytes
コンパイル時間 690 ms
コンパイル使用メモリ 79,536 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-15 19:54:18
合計ジャッジ時間 1,784 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <fstream>
#include <set>
#include <utility>
#include <algorithm>

#define rep(i,p,n) for(int i=p;i<n;i++)
#define lli long long int
#define vi vector<int> 

using namespace std;

int max(int x, int y) {
	int a;
	(x > y) ? a = x : a = y;
	return a;
}

int min(int x, int y) {
	int a;
	(x < y) ? a = x : a = y;
	return a;
}

int main() {
	int t = 0, r = 0, e = 0;
	string s;
	cin >> s;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 't')t++;
		else if (s[i] == 'r')r++;
		else if (s[i] == 'e')e++;
	}

	cout << min(e / 2, min(r, t)) << endl;
	return 0;
}
0