結果

問題 No.123 カードシャッフル
ユーザー TatsuDXTatsuDX
提出日時 2016-09-08 23:49:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 3,219 ms
コンパイル使用メモリ 75,196 KB
実行使用メモリ 59,552 KB
最終ジャッジ日時 2024-04-27 18:09:16
合計ジャッジ時間 7,526 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
54,108 KB
testcase_01 WA -
testcase_02 AC 127 ms
54,068 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 129 ms
54,000 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 130 ms
54,060 KB
testcase_09 WA -
testcase_10 AC 541 ms
59,112 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 564 ms
59,512 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[idx] = t[idx - 1];
			}
			t[0] = tmp;
		}
		System.out.println(t[0]);
	}
}
0