結果

問題 No.279 木の数え上げ
ユーザー the10hoursthe10hours
提出日時 2015-10-06 00:17:55
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,017 bytes
コンパイル時間 6,341 ms
コンパイル使用メモリ 99,944 KB
実行使用メモリ 23,296 KB
最終ジャッジ日時 2023-09-27 07:10:18
合計ジャッジ時間 6,577 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,352 KB
testcase_01 AC 53 ms
21,248 KB
testcase_02 AC 59 ms
21,196 KB
testcase_03 AC 53 ms
21,192 KB
testcase_04 AC 53 ms
23,296 KB
testcase_05 AC 57 ms
21,228 KB
testcase_06 AC 52 ms
21,416 KB
testcase_07 AC 51 ms
21,216 KB
testcase_08 AC 58 ms
19,188 KB
testcase_09 AC 53 ms
21,284 KB
testcase_10 TLE -
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.Collections.Generic;
using System.Linq;
using System.Text;

class yc
{
    public static void Main()
    {
        string str = Console.ReadLine();
        List<char> listStr = new List<char>();
        int[] trees = new int[3];
        int key;

        for (int i = 0; i < str.Length; i++)
        {
            listStr.Add(str[i]);
        }

        for (int i = 0; i < str.Length; i++)
        {
            key = listStr.IndexOf('t');
            if (key != -1)
            {
                trees[0]++;
                listStr.Remove(listStr[key]);
            }
            key = listStr.IndexOf('r');
            if (key != -1)
            {
                trees[1]++;
                listStr.Remove(listStr[key]);
            }
            key = listStr.IndexOf('e');
            if (key != -1)
            {
                trees[2]++;
                listStr.Remove(listStr[key]);
            }
        }
        trees[2] /= 2;

        Console.WriteLine(trees.Min());

    }
}
0