結果

問題 No.279 木の数え上げ
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-05 01:11:33
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 598 bytes
コンパイル時間 2,510 ms
コンパイル使用メモリ 106,228 KB
実行使用メモリ 27,564 KB
最終ジャッジ日時 2023-09-13 17:37:10
合計ジャッジ時間 4,706 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 51 ms
20,612 KB
testcase_02 WA -
testcase_03 AC 50 ms
20,652 KB
testcase_04 AC 50 ms
20,504 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 52 ms
22,744 KB
testcase_09 AC 51 ms
20,500 KB
testcase_10 AC 64 ms
23,628 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 52 ms
20,684 KB
testcase_14 AC 64 ms
23,908 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 63 ms
23,612 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 63 ms
23,832 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;

class No279{
    static void Main(){
        var s=Console.ReadLine();
        int t=0;
        int r=0;
        int e=0;
        foreach(var l in s){
            switch(l){
                case 't':t++;break;
                case 'r':r++;break;
                case 'e':e++;break;
                default:break;
            }
        }
        e/=2;
        if(t<r){
            Console.WriteLine(t<e?t:e<r?e:r);
        }else if(r>t){
            Console.WriteLine(r<e?r:t<e?t:e);
        }else if(t==r){
            Console.WriteLine(t<e?t:e);
        }
    }
}
0