結果

問題 No.123 カードシャッフル
ユーザー Mcpu3Mcpu3
提出日時 2018-06-21 23:16:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 483 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 2,194 ms
コンパイル使用メモリ 72,320 KB
実行使用メモリ 61,096 KB
最終ジャッジ日時 2023-09-13 07:42:58
合計ジャッジ時間 5,859 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,364 KB
testcase_01 AC 119 ms
55,964 KB
testcase_02 AC 119 ms
56,300 KB
testcase_03 AC 120 ms
56,296 KB
testcase_04 AC 119 ms
56,424 KB
testcase_05 AC 120 ms
56,320 KB
testcase_06 AC 121 ms
56,020 KB
testcase_07 AC 120 ms
56,084 KB
testcase_08 AC 119 ms
56,328 KB
testcase_09 AC 118 ms
55,712 KB
testcase_10 AC 445 ms
60,388 KB
testcase_11 AC 466 ms
60,772 KB
testcase_12 AC 483 ms
61,016 KB
testcase_13 AC 454 ms
61,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no123{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n,m,a,c[]=new int[50],i,j,t;
		n=stdIn.nextInt();
		m=stdIn.nextInt();
		for(i=0;i<n;i++) c[i]=i+1;
		for(i=0;i<m;i++) {
			a=stdIn.nextInt();
			t=c[a-1];
			for(j=a-1;j>0;j--) c[j]=c[j-1];
			c[0]=t;
		}
		System.out.print(c[0]);
	}
}
0