結果

問題 No.123 カードシャッフル
ユーザー TatsuDXTatsuDX
提出日時 2016-09-08 23:51:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 606 ms / 5,000 ms
コード長 446 bytes
コンパイル時間 3,395 ms
コンパイル使用メモリ 77,608 KB
実行使用メモリ 59,520 KB
最終ジャッジ日時 2024-04-27 18:09:26
合計ジャッジ時間 7,870 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
54,236 KB
testcase_01 AC 134 ms
54,036 KB
testcase_02 AC 136 ms
54,492 KB
testcase_03 AC 139 ms
54,328 KB
testcase_04 AC 145 ms
54,160 KB
testcase_05 AC 139 ms
53,732 KB
testcase_06 AC 134 ms
54,136 KB
testcase_07 AC 142 ms
54,272 KB
testcase_08 AC 136 ms
54,100 KB
testcase_09 AC 147 ms
54,312 KB
testcase_10 AC 574 ms
59,120 KB
testcase_11 AC 579 ms
59,372 KB
testcase_12 AC 558 ms
59,388 KB
testcase_13 AC 606 ms
59,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt(), m = sc.nextInt(), idx, tmp;
		int[] t = new int[n];
		for (int i = 0; i < n; i++) {
			t[i] = i + 1;
		}
		for (int i = 0; i < m; i++) {
			idx = sc.nextInt() - 1;
			tmp = t[idx];
			for (int j = idx; j > 0; j--) {
				t[j] = t[j - 1];
			}
			t[0] = tmp;
		}
		System.out.println(t[0]);
	}
}
0