結果

問題 No.279 木の数え上げ
ユーザー yun_appyun_app
提出日時 2016-05-11 17:15:55
言語 JavaScript
(node v21.7.1)
結果
WA  
実行時間 -
コード長 609 bytes
コンパイル時間 32 ms
コンパイル使用メモリ 5,120 KB
実行使用メモリ 48,580 KB
最終ジャッジ日時 2024-04-21 01:22:25
合計ジャッジ時間 3,515 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
39,424 KB
testcase_01 AC 69 ms
39,168 KB
testcase_02 AC 69 ms
39,296 KB
testcase_03 AC 67 ms
39,296 KB
testcase_04 AC 68 ms
39,424 KB
testcase_05 AC 69 ms
39,424 KB
testcase_06 AC 66 ms
39,424 KB
testcase_07 AC 72 ms
39,552 KB
testcase_08 AC 69 ms
39,424 KB
testcase_09 AC 69 ms
39,296 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
    main(chunk.trim());
});
function main(chunk){
    // your code goes here
    chunk = chunk.replace(/[^t|r|e]/g,"");
    var t_num = 0;
    var r_num = 0;
    var e_num = 0;
    for(var i in chunk){
        switch(chunk[i]){
        case 't':
            t_num++;
            break;
        case 'r':
            r_num++;
            break;
        case 'e':
            e_num++;
            break;
        }
    }
    e_num=Math.floor(e_num/2);
    console.log(Math.min(Math.min(t_num,r_num),e_num));
}
0