結果

問題 No.279 木の数え上げ
ユーザー swdamdrswdamdr
提出日時 2017-01-24 17:13:50
言語 C#(csc)
(csc 3.9.0)
結果
MLE  
実行時間 -
コード長 1,217 bytes
コンパイル時間 1,995 ms
コンパイル使用メモリ 100,380 KB
実行使用メモリ 66,544 KB
最終ジャッジ日時 2023-08-24 21:51:51
合計ジャッジ時間 6,737 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
22,540 KB
testcase_01 AC 53 ms
20,488 KB
testcase_02 AC 54 ms
20,412 KB
testcase_03 AC 54 ms
20,368 KB
testcase_04 AC 53 ms
20,464 KB
testcase_05 AC 54 ms
20,468 KB
testcase_06 AC 53 ms
22,436 KB
testcase_07 AC 54 ms
22,532 KB
testcase_08 AC 54 ms
20,480 KB
testcase_09 AC 53 ms
22,456 KB
testcase_10 MLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        string s = Console.ReadLine();
        List<string> lst = new List<string>();
        int cnt = 0;
        bool b = true;

        for (int i = 0; i < s.Length; i++)
        {
            lst.Add(s[i].ToString());
        }

        while (true)
        {
            if (lst.Contains("t"))
            {
                lst.Remove("t");
            }
            else
            {
                b = false;
            }

            if (lst.Contains("r"))
            {
                lst.Remove("r");
            }
            else
            {
                b = false;
            }

            for (int i = 0; i < 2; i++)
            {
                if (lst.Contains("e"))
                {
                    lst.Remove("e");
                }
                else
                {
                    b = false;
                }
            }

            if (b == true)
            {
                cnt++;
            }
            else
            {
                break;
            }
        }

        Console.WriteLine(cnt);
        Console.Read();
    }
}
0