結果

問題 No.481 1から10
ユーザー intercept6intercept6
提出日時 2020-09-16 09:41:52
言語 TypeScript
(5.4.3)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 7,780 ms
コンパイル使用メモリ 254,140 KB
実行使用メモリ 42,408 KB
最終ジャッジ日時 2023-09-04 03:23:47
合計ジャッジ時間 9,377 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
42,280 KB
testcase_01 AC 83 ms
42,256 KB
testcase_02 AC 81 ms
42,208 KB
testcase_03 AC 82 ms
42,408 KB
testcase_04 AC 82 ms
42,212 KB
testcase_05 AC 82 ms
42,400 KB
testcase_06 AC 81 ms
42,224 KB
testcase_07 AC 81 ms
42,336 KB
testcase_08 AC 83 ms
42,344 KB
testcase_09 AC 81 ms
42,232 KB
権限があれば一括ダウンロードができます

ソースコード

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