結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー ontama_12ontama_12
提出日時 2016-09-23 18:10:37
言語 JavaScript
(node v21.7.1)
結果
RE  
実行時間 -
コード長 1,614 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 6,940 KB
実行使用メモリ 47,224 KB
最終ジャッジ日時 2024-04-21 01:27:08
合計ジャッジ時間 2,607 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
39,552 KB
testcase_01 RE -
testcase_02 AC 64 ms
39,424 KB
testcase_03 AC 62 ms
39,296 KB
testcase_04 AC 64 ms
39,296 KB
testcase_05 RE -
testcase_06 AC 64 ms
39,168 KB
testcase_07 AC 65 ms
39,296 KB
testcase_08 AC 63 ms
39,040 KB
testcase_09 AC 65 ms
39,168 KB
testcase_10 AC 64 ms
39,168 KB
testcase_11 AC 64 ms
39,296 KB
testcase_12 AC 64 ms
39,040 KB
testcase_13 AC 64 ms
39,296 KB
testcase_14 WA -
testcase_15 AC 73 ms
43,648 KB
testcase_16 RE -
testcase_17 AC 76 ms
43,776 KB
testcase_18 RE -
testcase_19 WA -
testcase_20 RE -
testcase_21 AC 66 ms
39,424 KB
testcase_22 WA -
testcase_23 RE -
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

  ///////////////No.79 過小評価ダメ・ゼッタイ
    //入力文字読み取り
    process.stdin.resume();
    process.stdin.setEncoding('utf8');
    process.stdin.on('data', function (chunk) {

        //すべて受け取り改行で区切って格納
        var input = chunk.split("\n");
        
        //評価した人数
        var evaluationnumber = Number(input[0])
        //評価数字の一覧
        var evaluation = input[1].split(" ").map(Number)

        var one =0
        var two =0
        var three=0
        var four=0
        var five=0
        var six=0

        for (var i = 0; i < evaluation.length; i++) {
            if (evaluation[i] === 1) {
                one++
            }else if (evaluation[i] === 2) {
                two++
            }else  if (evaluation[i] === 3) {
                three++
            }else if (evaluation[i] === 4) {
                four++
            }else if (evaluation[i] === 5) {
                five++
            }else  if (evaluation[i] === 6) {
                six++
            }
        }
        //評価数が最も多い数字
        var max = Math.max(one, two, three, four, five, six);

        //同じ評価数のときはレベルの高い方順
        if (max == six) {
            console.log(6)
        } else if(max == five) {
            console.log(5)
        } else if (max == four) {
            console.log(4)
        }  else if (max == three) {
            console.log(3)
        } else if (max == two) {
            console.log(2)
        } else if (max == one) {
            console.log(1)
        }
    });
0