結果
問題 |
No.279 木の数え上げ
|
ユーザー |
|
提出日時 | 2025-09-23 12:05:09 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 634 bytes |
コンパイル時間 | 2,807 ms |
コンパイル使用メモリ | 276,044 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-23 12:05:15 |
合計ジャッジ時間 | 4,550 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> [[nodiscard]] static inline constexpr std::array<int_fast32_t, 128> prepare(const std::string& S) noexcept { std::array<int_fast32_t, 128> count_of = { 0, }; for (const auto& s : S) ++count_of[s]; return count_of; } [[nodiscard]] static inline constexpr int_fast32_t solve(const std::array<int_fast32_t, 128>& count_of) noexcept { return std::min<int_fast32_t>({ count_of['t'], count_of['r'], count_of['e'] / 2 }); } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); std::string S; S.reserve(1'000'000), std::cin >> S; std::cout << solve(prepare(S)) << '\n'; return 0; }