結果

問題 No.279 木の数え上げ
ユーザー nokonokonokonoko
提出日時 2015-10-05 01:33:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 1,798 bytes
コンパイル時間 2,674 ms
コンパイル使用メモリ 109,440 KB
実行使用メモリ 23,936 KB
最終ジャッジ日時 2024-04-22 16:07:50
合計ジャッジ時間 2,590 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
18,688 KB
testcase_01 AC 26 ms
18,816 KB
testcase_02 AC 26 ms
18,688 KB
testcase_03 AC 28 ms
18,688 KB
testcase_04 AC 26 ms
19,200 KB
testcase_05 AC 28 ms
18,944 KB
testcase_06 AC 27 ms
18,688 KB
testcase_07 AC 27 ms
18,944 KB
testcase_08 AC 28 ms
18,816 KB
testcase_09 AC 27 ms
18,816 KB
testcase_10 AC 50 ms
23,552 KB
testcase_11 AC 31 ms
19,200 KB
testcase_12 AC 42 ms
22,016 KB
testcase_13 AC 30 ms
19,020 KB
testcase_14 AC 50 ms
23,936 KB
testcase_15 AC 46 ms
22,784 KB
testcase_16 AC 44 ms
22,528 KB
testcase_17 AC 48 ms
23,552 KB
testcase_18 AC 39 ms
20,992 KB
testcase_19 AC 49 ms
23,552 KB
testcase_20 AC 50 ms
23,680 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.Linq;
using System.Text;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        char[] s = LIB.IO.R<string>().ToCharArray();
        int tc = s.Where(c => c == 't').Count();
        int rc = s.Where(c => c == 'r').Count();
        int ec = s.Where(c => c == 'e').Count() / 2;
        int ans = Math.Min(tc, rc);
        ans = Math.Min(ans, ec);
        LIB.IO.W(ans);
        LIB.IO.WFLUSH();
    }
}

namespace LIB
{
    public class IO
    {
        private const int WMAX = 1000;
        private static StringBuilder S = new StringBuilder();
        public static T R<T>() { return UTILITY.PARSE<T>(R()); }
        public static T[] R<T>(char s = ' ') { return R().Split(s).Select(UTILITY.PARSE<T>).ToArray(); }
        public static T[] R<T>(int l) { T[] r = new T[l]; for (int i = 0; i < l; i++) { r[i] = R<T>(); } return r; }
        public static T[][] R<T>(int l, char s = ' ') { T[][] r = new T[l][]; for (int i = 0; i < l; i++) { r[i] = R<T>(s); } return r; }
        private static string R() { return Console.ReadLine(); }
        public static void W(object v, bool lf = true) { S.Append(UTILITY.PARSE<string>(v)); if (lf == true) { S.Append('\n'); } if (S.Length >= WMAX) { WFLUSH(); } }
        public static void WFLUSH() { Console.Write(S.ToString()); S.Clear(); }
    }
    public class UTILITY
    {
        public static T PARSE<T>(object value) { return (T)(Convert.ChangeType(value, typeof(T))); }
    }
    public class MEMO<Key, Result>
    {
        private Dictionary<Key, Result> R;
        public MEMO() { R = new Dictionary<Key, Result>(); }
        public Result EXEC(Key k, Func<Key, Result> f) { Result r; if (R.ContainsKey(k)) { r = R[k]; } else { r = f(k); R.Add(k, r); } return r; }
    }
}
0