結果

問題 No.279 木の数え上げ
コンテスト
ユーザー 大谷祐翔
提出日時 2025-11-10 11:31:14
言語 C#
(.NET 8.0.404)
結果
MLE  
実行時間 -
コード長 757 bytes
コンパイル時間 7,731 ms
コンパイル使用メモリ 170,852 KB
実行使用メモリ 193,128 KB
最終ジャッジ日時 2025-11-10 11:31:24
合計ジャッジ時間 10,278 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 MLE * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (140 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

class Program
{
    static void Main(string[] args)
    {
        string inputWord = Console.ReadLine()!;
        int tCount = 0;
        int eCount = 0;
        int rCount = 0;
        int treeCount = 0;

        foreach (char c in inputWord)
        {
            if (c == 't')
            {
                tCount++;
            }
            else if (c == 'e')
            {
                eCount++;
            }
            else if (c == 'r')
            {
                rCount++;
            }

            if (tCount >= 1 && eCount >= 2 && rCount >= 1)
            {
                treeCount++;
                tCount--;
                eCount -= 2;
                rCount--;
            }
        }
        Console.WriteLine(treeCount);
    }
}
0