結果

問題 No.279 木の数え上げ
コンテスト
ユーザー yudedako
提出日時 2016-03-13 11:53:24
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 15 ms / 2,000 ms
+ 738µs
コード長 445 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 306 ms
コンパイル使用メモリ 71,648 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-17 00:06:51
合計ジャッジ時間 2,607 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <string>
#include <array>
int main() {
	std::string str;
	std::cin >> str;
	std::array<int, 3> count{ 0, 0, 0 };
	for (const auto &c : str) {
		switch (c) {
		case 't':
			++count[0];
			break;
		case 'r':
			++count[1];
			break;
		case 'e':
			++count[2];
		}
	}
	int min = str.size();
	count[2] >>= 1;
	for (const auto &c : count) {
		if (min > c) {
			min = c;
		}
	}
	std::cout << min << std::endl;
	return 0;
}
0