結果

問題 No.780 オフ会
ユーザー 多賀悠人多賀悠人
提出日時 2021-06-13 22:51:41
言語 TypeScript
(5.4.3)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 737 bytes
コンパイル時間 7,462 ms
コンパイル使用メモリ 253,572 KB
実行使用メモリ 42,708 KB
最終ジャッジ日時 2023-08-25 01:59:36
合計ジャッジ時間 10,782 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
42,344 KB
testcase_01 AC 85 ms
42,644 KB
testcase_02 AC 84 ms
42,536 KB
testcase_03 AC 84 ms
42,464 KB
testcase_04 AC 83 ms
42,448 KB
testcase_05 AC 86 ms
42,344 KB
testcase_06 AC 85 ms
42,556 KB
testcase_07 AC 85 ms
42,464 KB
testcase_08 AC 83 ms
42,348 KB
testcase_09 AC 84 ms
42,488 KB
testcase_10 AC 84 ms
42,408 KB
testcase_11 AC 83 ms
42,344 KB
testcase_12 AC 83 ms
42,352 KB
testcase_13 AC 84 ms
42,356 KB
testcase_14 AC 83 ms
42,544 KB
testcase_15 AC 84 ms
42,396 KB
testcase_16 AC 84 ms
42,548 KB
testcase_17 AC 84 ms
42,356 KB
testcase_18 AC 83 ms
42,504 KB
testcase_19 AC 84 ms
42,708 KB
testcase_20 AC 83 ms
42,396 KB
testcase_21 AC 83 ms
42,448 KB
testcase_22 AC 84 ms
42,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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