結果

問題 No.516 赤と青の風船
ユーザー 多賀悠人多賀悠人
提出日時 2021-06-13 16:32:26
言語 TypeScript
(5.4.3)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 1,074 bytes
コンパイル時間 9,993 ms
コンパイル使用メモリ 252,868 KB
実行使用メモリ 42,812 KB
最終ジャッジ日時 2023-08-24 19:29:20
合計ジャッジ時間 11,321 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
42,612 KB
testcase_01 AC 85 ms
42,704 KB
testcase_02 AC 87 ms
42,812 KB
testcase_03 AC 86 ms
42,648 KB
testcase_04 AC 87 ms
42,696 KB
testcase_05 AC 88 ms
42,532 KB
testcase_06 AC 85 ms
42,508 KB
testcase_07 AC 87 ms
42,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

export { }
let lines = [];
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', function (line) {
  lines.push(line);
});
reader.on('close', function () {
  
  const sum: number = lines.map( line => line.trim().length).reduce( (accumulator, currentValue) => {
    return accumulator + currentValue
 }) 
 
 if (sum > 10 ) {
	console.log('BLUE')
  } else {
  console.log('RED')
  }
 
  
  // ここに処理を書いていく
  // 最後に結果をconsole.log()する
  // 例
 // const hoge: number = parseInt(lines[0])
  // const result: number = hoge * 2
  // console.log(result)
});
// 実行方法
// 下記コマンドでtsファイルをコンパイル & ウォッチ。コンパイルのみで良いなら、-wいらない
// tsc ファイル名 -w
// 下記コマンドでjsファイルを実行
// node ファイル名
// 入力したら改行
// 入力後、ctr + cで出力できる
// 僕の環境だと、npm i @types/nodeしろって言われたので、する必要ある可能性あり
0