結果

問題 No.998 Four Integers
ユーザー megane_ankomegane_anko
提出日時 2021-03-07 00:44:30
言語 TypeScript
(5.4.3)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 640 bytes
コンパイル時間 3,745 ms
コンパイル使用メモリ 145,008 KB
最終ジャッジ日時 2024-04-27 03:42:54
合計ジャッジ時間 4,141 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.ts(1,21): error TS2307: Cannot find module 'fs' or its corresponding type declarations.

ソースコード

diff #

import * as fs from 'fs';
const input = fs.readFileSync('/dev/stdin', 'utf8');

const ABCDarray = input.split(' ');
let nABCDarray = [];
nABCDarray = ABCDarray.map(Number);
const A = nABCDarray[0];
const B = nABCDarray[1];
const C = nABCDarray[2];
const D = nABCDarray[3];

nABCDarray.sort(
    function (a, b) {
        if (a < b) return -1;
        if (a > b) return 1;
        return 0;
    }
);
//console.log(nABCDarray);

const a = nABCDarray[0];
const b = nABCDarray[1];
const c = nABCDarray[2];
const d = nABCDarray[3];

if ((a + 1 === b) && (b + 1 === c) && (c + 1 === d)) {
    console.log('Yes');
} else {
    console.log('No');
}
0