結果

問題 No.123 カードシャッフル
ユーザー 練習生
提出日時 2015-08-22 11:43:06
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 525 bytes
コンパイル時間 2,885 ms
コンパイル使用メモリ 75,520 KB
実行使用メモリ 59,216 KB
最終ジャッジ日時 2024-07-18 12:38:34
合計ジャッジ時間 6,410 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6 WA * 4
権限があれば一括ダウンロードができます

ソースコード

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