結果

問題 No.279 木の数え上げ
コンテスト
ユーザー the10hours
提出日時 2015-10-06 00:17:55
言語 C#(csc)
(csc 3.9.0)
コンパイル:
csc -langversion:latest -unsafe -warn:0 -o+ /r:System.Numerics.dll _filename_ -out:a.exe
実行:
/usr/bin/mono a.exe
結果
MLE  
実行時間 -
コード長 1,017 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 513 ms
コンパイル使用メモリ 110,468 KB
実行使用メモリ 118,440 KB
最終ジャッジ日時 2026-04-02 19:20:03
合計ジャッジ時間 4,344 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 MLE * 1 -- * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #
raw source code

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