結果

問題 No.780 オフ会
コンテスト
ユーザー 多賀悠人
提出日時 2021-06-13 22:51:41
言語 TypeScript
(6.0.2)
コンパイル:
tsc.sh -p tsconfig.json
実行:
node main.js ONLINE_JUDGE
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 737 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,604 ms
コンパイル使用メモリ 346,604 KB
最終ジャッジ日時 2026-06-05 05:48:34
合計ジャッジ時間 5,430 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.ts(7,29): error TS7006: Parameter 'line' implicitly has an 'any' type.

ソースコード

diff #
raw source code

export { }
let lines = '';
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', function (line) {
  //lines.push(line);
  lines = line
});
reader.on('close', function () {
  //console.log('lines', lines)

  const hoge = lines.split(" ")
  

  const man: number = parseInt(hoge[0])
  const woman: number = parseInt(hoge[1])

  
  

  if (woman > man) {
    console.log('YES')
  } else {
    console.log('NO')
  }

  if (woman === man + 1) {
    console.log('0')
  } else if (woman > man) {
    const surplus: number = Math.abs(woman - man) - 1
    console.log(surplus)
  } else {
    const surplus: number = Math.abs(woman - man) + 1
    console.log(surplus)
  }

});
0