結果

問題 No.516 赤と青の風船
ユーザー 多賀悠人多賀悠人
提出日時 2021-06-13 14:57:34
言語 TypeScript
(5.4.3)
結果
WA  
実行時間 -
コード長 1,114 bytes
コンパイル時間 8,945 ms
コンパイル使用メモリ 252,748 KB
実行使用メモリ 44,996 KB
最終ジャッジ日時 2023-08-24 17:58:08
合計ジャッジ時間 10,352 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
権限があれば一括ダウンロードができます

ソースコード

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 () {
  console.log('lines', lines)
  
  const sum = lines.map( line => line.trim().length).reduce( (accumulator, currentValue) => {
    return accumulator + currentValue
 }) 
 console.log('sum',sum)
 
 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