結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
ontama_12
|
| 提出日時 | 2016-09-23 18:06:36 |
| 言語 | JavaScript (node v23.5.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,606 bytes |
| コンパイル時間 | 50 ms |
| コンパイル使用メモリ | 6,692 KB |
| 実行使用メモリ | 47,188 KB |
| 最終ジャッジ日時 | 2024-10-12 23:47:22 |
| 合計ジャッジ時間 | 3,343 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 3 RE * 7 |
ソースコード
///////////////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)
}
});
ontama_12