結果

問題 No.123 カードシャッフル
ユーザー 37zigen37zigen
提出日時 2016-03-11 20:08:48
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 602 bytes
コンパイル時間 3,644 ms
コンパイル使用メモリ 76,836 KB
実行使用メモリ 57,696 KB
最終ジャッジ日時 2023-10-25 05:28:30
合計ジャッジ時間 6,900 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
57,692 KB
testcase_01 AC 149 ms
57,192 KB
testcase_02 AC 151 ms
57,416 KB
testcase_03 AC 149 ms
57,220 KB
testcase_04 AC 150 ms
57,660 KB
testcase_05 AC 149 ms
57,696 KB
testcase_06 AC 146 ms
57,336 KB
testcase_07 AC 148 ms
56,256 KB
testcase_08 AC 150 ms
57,408 KB
testcase_09 AC 149 ms
57,476 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package 練習;

import java.util.Date;
import java.util.Scanner;
public class main{
	public static void main(String[] args){
		long exec_time=new Date().getTime();
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int[] a=new int[n];
		for(int i=0;i<m;i++){
			a[i]=sc.nextInt()-1;
		}
		int[] now=new int[n];
		for(int i=0;i<n;i++){
			now[i]=i+1;
		}
		for(int i=0;i<m;i++){
			int tmp=now[a[i]];
			for(int j=a[i];j>=1;j--){
				now[j]=now[j-1];
			}
			now[0]=tmp;
		}
		System.out.println(now[0]);
		System.err.println(new Date().getTime()-exec_time+"ms");

	}
}
0