結果

問題 No.998 Four Integers
ユーザー T AT A
提出日時 2020-07-25 17:11:31
言語 TypeScript
(5.4.3)
結果
AC  
実行時間 88 ms / 1,000 ms
コード長 526 bytes
コンパイル時間 11,029 ms
コンパイル使用メモリ 254,484 KB
実行使用メモリ 44,748 KB
最終ジャッジ日時 2023-09-09 17:19:52
合計ジャッジ時間 14,311 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
42,584 KB
testcase_01 AC 84 ms
42,556 KB
testcase_02 AC 86 ms
42,712 KB
testcase_03 AC 86 ms
42,796 KB
testcase_04 AC 84 ms
42,640 KB
testcase_05 AC 86 ms
42,848 KB
testcase_06 AC 84 ms
42,484 KB
testcase_07 AC 87 ms
44,536 KB
testcase_08 AC 83 ms
42,576 KB
testcase_09 AC 86 ms
42,540 KB
testcase_10 AC 85 ms
42,612 KB
testcase_11 AC 88 ms
42,780 KB
testcase_12 AC 86 ms
42,576 KB
testcase_13 AC 84 ms
42,588 KB
testcase_14 AC 88 ms
44,748 KB
testcase_15 AC 87 ms
44,592 KB
testcase_16 AC 88 ms
42,636 KB
testcase_17 AC 85 ms
42,812 KB
testcase_18 AC 84 ms
42,672 KB
testcase_19 AC 84 ms
42,596 KB
testcase_20 AC 83 ms
42,680 KB
testcase_21 AC 84 ms
42,644 KB
testcase_22 AC 84 ms
44,580 KB
testcase_23 AC 84 ms
42,756 KB
testcase_24 AC 83 ms
42,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

const lines = [];
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
  const input: string = lines[0]
  const arr: number[] = input.split(' ').map(str => parseInt(str, 10))
  const sortArr = arr.sort((a, b) => a - b)
  if (sortArr[1] - sortArr[0] === 1 && sortArr[2] - sortArr[1] === 1 && sortArr[3] - sortArr[2] === 1) {
    console.log('Yes');
  }else{
    console.log('No');
  }



});
0