結果

問題 No.481 1から10
ユーザー intercept6
提出日時 2020-09-10 15:58:38
言語 TypeScript
(5.7.2)
結果
RE  
実行時間 -
コード長 349 bytes
コンパイル時間 7,853 ms
コンパイル使用メモリ 228,584 KB
実行使用メモリ 39,808 KB
最終ジャッジ日時 2024-12-31 16:19:31
合計ジャッジ時間 9,017 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import { readFileSync } from 'fs';

function Main(input: string) {
  const data = input.split('\n');

  const numbers = data[0].split(' ').map(Number);

  const res = numbers.find((value, index) => value !== index + 1);
  if (res == null) {
    throw new Error('Not Found');
  }

  console.log(res - 1);
}

Main(readFileSync('/dev/stdin', 'utf8'));
0