結果

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

ソースコード

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) {
    console.log(numbers.length + 1);
  } else {
    console.log(res - 1);
  }
}

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