結果

問題 No.481 1から10
コンテスト
ユーザー intercept6
提出日時 2020-09-16 09:40:20
言語 TypeScript
(6.0.2)
コンパイル:
tsc.sh -p tsconfig.json
実行:
node main.js ONLINE_JUDGE
結果
RE  
実行時間 -
コード長 349 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,513 ms
コンパイル使用メモリ 347,716 KB
実行使用メモリ 53,616 KB
最終ジャッジ日時 2026-06-05 04:43:51
合計ジャッジ時間 7,130 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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