結果

問題 No.516 赤と青の風船
ユーザー T AT A
提出日時 2020-07-11 15:35:21
言語 TypeScript
(5.4.3)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 423 bytes
コンパイル時間 4,400 ms
コンパイル使用メモリ 145,036 KB
最終ジャッジ日時 2024-04-27 03:16:52
合計ジャッジ時間 4,772 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.ts(2,16): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
main.ts(3,10): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
main.ts(4,11): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

ソースコード

diff #

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