結果

問題 No.123 カードシャッフル
ユーザー 練習生練習生
提出日時 2015-08-22 11:43:06
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 525 bytes
コンパイル時間 4,092 ms
コンパイル使用メモリ 72,176 KB
実行使用メモリ 60,848 KB
最終ジャッジ日時 2023-09-25 16:00:39
合計ジャッジ時間 8,551 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,716 KB
testcase_01 AC 125 ms
56,072 KB
testcase_02 AC 123 ms
55,868 KB
testcase_03 AC 124 ms
54,168 KB
testcase_04 AC 124 ms
56,052 KB
testcase_05 AC 124 ms
55,952 KB
testcase_06 WA -
testcase_07 AC 124 ms
56,252 KB
testcase_08 AC 124 ms
55,692 KB
testcase_09 AC 123 ms
55,404 KB
testcase_10 AC 504 ms
60,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Template {
	public static void main(String[] args) {
		List<Integer> cardList = new ArrayList<Integer>();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		for(int i = 0; i < n; i++){
			cardList.add(i + 1);
		}
		for(int i = 0; i < m; i++){
			int a = sc.nextInt();
			cardList.add(0, cardList.get(a - 1));
			cardList.remove(a - 1);
		}
		sc.close();
		System.out.println(cardList.get(0));
	}
}
0