結果

問題 No.998 Four Integers
ユーザー nzn-m
提出日時 2020-03-21 21:01:14
言語 JavaScript
(node v23.5.0)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 36 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 42,552 KB
最終ジャッジ日時 2024-10-13 01:36:01
合計ジャッジ時間 2,543 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

process.stdin.resume();
process.stdin.setEncoding('utf8');

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

reader.on('line', (line) => {
    lines.push(line);
});

reader.on('close', () => {
    const arr = lines[0].split(' ').map(hoge=>parseInt(hoge, 10));
    arr.sort();
    if(arr[3] - arr[2] == 1 && arr[2] - arr[1] == 1 && arr[1] - arr[0] == 1){
        console.log('Yes');
    } else {
        console.log('No');
    }
});
0