結果

問題 No.481 1から10
ユーザー oyafusooyafuso
提出日時 2019-03-15 10:22:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 807 bytes
コンパイル時間 3,187 ms
コンパイル使用メモリ 73,032 KB
実行使用メモリ 56,424 KB
最終ジャッジ日時 2023-09-11 01:41:10
合計ジャッジ時間 4,183 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,632 KB
testcase_01 AC 119 ms
56,116 KB
testcase_02 AC 118 ms
55,824 KB
testcase_03 AC 118 ms
55,772 KB
testcase_04 AC 116 ms
55,792 KB
testcase_05 AC 118 ms
55,764 KB
testcase_06 AC 118 ms
56,228 KB
testcase_07 AC 121 ms
56,084 KB
testcase_08 AC 119 ms
56,424 KB
testcase_09 AC 119 ms
56,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {

	private static final String SPLIT_STR = " ";

	public static void main(String[] args) {
		// Scanner生成
		Scanner sc = new Scanner(System.in);
		// 入力設定
		String input = sc.nextLine();
		String[] split = input.split(SPLIT_STR);
		List<Integer> numList = new ArrayList<>(split.length);
		for (int i = 0; i < split.length; i++) {
			numList.add(Integer.parseInt(split[i]));
		}
		// Scannerクローズ
		sc.close();

		/* メイン処理開始 */
		// 変数初期化
		int result = 0;
		// 結果設定
		for (int i = 1; i <= numList.size(); i++) {
			if (i != numList.get(i - 1)) {
				result = i;
				break;
			}
		}
		if (result == 0) {
			result = numList.size() + 1;
		}
		/* メイン処理終了 */

		// 結果出力
		System.out.println(result);
	}
}
0