結果

問題 No.516 赤と青の風船
ユーザー T AT A
提出日時 2021-06-13 16:39:53
言語 TypeScript
(5.4.3)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 11,112 ms
コンパイル使用メモリ 254,624 KB
実行使用メモリ 44,352 KB
最終ジャッジ日時 2023-08-24 19:37:32
合計ジャッジ時間 9,140 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
42,336 KB
testcase_01 AC 83 ms
44,352 KB
testcase_02 AC 84 ms
42,224 KB
testcase_03 AC 83 ms
42,312 KB
testcase_04 AC 83 ms
42,728 KB
testcase_05 AC 83 ms
42,096 KB
testcase_06 AC 83 ms
42,120 KB
testcase_07 AC 83 ms
42,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

export { }

const lines = [];
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
})

reader.on('line', (line) => {
  lines.push(line)
})
reader.on('close', () => {
  const colors: string[] = lines

  const sumOfRed: number = colors.reduce((sum: number, color: string): number => {
    if (color !== 'RED') return sum 
    return sum + 1
  }, 0)

  const result = (sumOfRed >= 2) ? 'RED' : 'BLUE'

  console.log(result)
  
})
0