結果

問題 No.279 木の数え上げ
ユーザー TDTD
提出日時 2022-05-31 13:08:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 989 bytes
コンパイル時間 814 ms
コンパイル使用メモリ 106,208 KB
実行使用メモリ 30,880 KB
最終ジャッジ日時 2023-10-21 00:36:20
合計ジャッジ時間 3,686 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
23,648 KB
testcase_01 AC 22 ms
23,644 KB
testcase_02 AC 22 ms
23,648 KB
testcase_03 AC 21 ms
23,644 KB
testcase_04 AC 20 ms
23,644 KB
testcase_05 AC 21 ms
23,648 KB
testcase_06 AC 20 ms
23,644 KB
testcase_07 AC 21 ms
23,644 KB
testcase_08 AC 20 ms
23,648 KB
testcase_09 AC 20 ms
23,644 KB
testcase_10 AC 106 ms
30,596 KB
testcase_11 AC 41 ms
27,716 KB
testcase_12 AC 81 ms
29,416 KB
testcase_13 AC 33 ms
25,668 KB
testcase_14 AC 115 ms
30,880 KB
testcase_15 AC 97 ms
30,184 KB
testcase_16 AC 89 ms
29,892 KB
testcase_17 AC 104 ms
30,624 KB
testcase_18 AC 65 ms
28,824 KB
testcase_19 AC 104 ms
30,524 KB
testcase_20 AC 110 ms
30,808 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] t = {"t","r","e" };
            int[] a = new int[4];
            int count = 0;
            for(int i = 0; i < s.Length; i++)
            {
                string b = s.Substring(i, 1);
                for (int j = 0; j < t.Length; j++)
                {
                    if ( b== t[j])
                    {
                        a[j]++;
                    }
                }
            }
            a[2] /= 2;
           for(; ; )
            {
                a[0] -= 1;
                a[1] -= 1;
                a[2] -= 1;
                if (a[0] >= 0 && a[1] >= 0 && a[2] >= 0)
                {
                    count++;
                }
                else
                {
                    break;
                }
            }

            Console.WriteLine(count);
        }
    }
}
0