結果

問題 No.516 赤と青の風船
コンテスト
ユーザー T A
提出日時 2020-07-11 15:35:21
言語 TypeScript
(6.0.2)
コンパイル:
tsc.sh -p tsconfig.json
実行:
node main.js ONLINE_JUDGE
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 423 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,976 ms
コンパイル使用メモリ 347,144 KB
最終ジャッジ日時 2026-06-05 04:27:16
合計ジャッジ時間 5,827 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.ts(1,7): error TS7034: Variable 'lines' implicitly has type 'any[]' in some locations where its type cannot be determined.
main.ts(7,20): error TS7006: Parameter 'line' implicitly has an 'any' type.
main.ts(11,25): error TS7005: Variable 'lines' implicitly has an 'any[]' type.

ソースコード

diff #
raw source code

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

reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
  const arr: string[] = lines
  const redArr = arr.filter((value: string): boolean => {
    return value.length == 3
  })
  if (redArr.length >= 2) {
    console.log('RED');
  } else {
    console.log('BLUE');
  }
});
0