結果
| 問題 | No.516 赤と青の風船 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-13 16:32:26 |
| 言語 | TypeScript (6.0.2) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,074 bytes |
| 記録 | |
| コンパイル時間 | 5,484 ms |
| コンパイル使用メモリ | 348,564 KB |
| 最終ジャッジ日時 | 2026-06-05 05:46:04 |
| 合計ジャッジ時間 | 6,131 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.ts(2,5): error TS7034: Variable 'lines' implicitly has type 'any[]' in some locations where its type cannot be determined. main.ts(7,29): error TS7006: Parameter 'line' implicitly has an 'any' type. main.ts(12,23): error TS7005: Variable 'lines' implicitly has an 'any[]' type.
ソースコード
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しろって言われたので、する必要ある可能性あり