結果

問題 No.279 木の数え上げ
ユーザー funakoshifunakoshi
提出日時 2019-06-27 13:35:43
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 1,022 bytes
コンパイル時間 4,604 ms
コンパイル使用メモリ 102,864 KB
実行使用メモリ 28,812 KB
最終ジャッジ日時 2023-09-10 04:19:57
合計ジャッジ時間 6,825 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
20,592 KB
testcase_01 AC 54 ms
20,520 KB
testcase_02 AC 53 ms
20,544 KB
testcase_03 AC 53 ms
20,652 KB
testcase_04 AC 53 ms
20,612 KB
testcase_05 AC 53 ms
20,684 KB
testcase_06 AC 53 ms
20,616 KB
testcase_07 AC 52 ms
20,392 KB
testcase_08 AC 54 ms
20,556 KB
testcase_09 AC 52 ms
20,548 KB
testcase_10 AC 141 ms
27,880 KB
testcase_11 AC 74 ms
27,000 KB
testcase_12 AC 114 ms
28,812 KB
testcase_13 AC 65 ms
24,648 KB
testcase_14 AC 146 ms
28,140 KB
testcase_15 AC 129 ms
27,380 KB
testcase_16 AC 124 ms
27,120 KB
testcase_17 AC 139 ms
27,896 KB
testcase_18 AC 98 ms
26,112 KB
testcase_19 AC 137 ms
27,956 KB
testcase_20 AC 143 ms
28,052 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace yukicoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int tcnt = 0;
            int rcnt = 0;
            int ecnt = 0;
            int tree = 0;
            for(int i=0;i<input.Length;i++)
            {
                string temp = input.Substring(i, 1);
                if (temp == "t")
                {
                    tcnt++;
                }
                else if (temp == "r")
                {
                    rcnt++;
                }
                else if (temp == "e")
                {
                    ecnt++;
                }
            }
            while(tcnt>=1&&rcnt>=1&&ecnt>=2)
            {
                tcnt--;
                rcnt--;
                ecnt -= 2;
                tree++;
            }
            Console.WriteLine(tree);
        }

    }
}
0