結果

問題 No.123 カードシャッフル
ユーザー rf141rf141
提出日時 2015-08-09 21:28:38
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 612 bytes
コンパイル時間 3,348 ms
コンパイル使用メモリ 72,204 KB
実行使用メモリ 60,284 KB
最終ジャッジ日時 2023-09-25 07:38:15
合計ジャッジ時間 6,412 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 127 ms
56,144 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 463 ms
60,284 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class card{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int[] number = new int[n];
		for(int i = 0; i < n; i++){
			number[i] = i+1;
		}
		System.out.println(cardShuffle(number,m,scan));
	}
	public static int cardShuffle(int[] number,int m,Scanner scan){
		for(int i = 0; i < m; i++){
			int shuffle_number = scan.nextInt();
			int now = number[shuffle_number-1];
			for(int j = shuffle_number-1; 0 < j; j++){
				number[j] = number[j-1];
			}
			number[0] = now;
		}
		return number[0];
	}
}
0