結果

問題 No.123 カードシャッフル
ユーザー a2011404a2011404
提出日時 2017-03-06 16:25:30
言語 C90
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 361 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 24,648 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 15:53:07
合計ジャッジ時間 1,409 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>


int main(void){

int N,M,A[51]={},Mn[51]={},i,j,temp=0;

	scanf("%d %d",&N,&M);

for(i=1;i<=N;i++){
	A[i]=i;
}



for(j=1;j<=M;j++){
	scanf("%d",&Mn[j]);
	temp=A[Mn[j]];

	for(i=Mn[j];i>1;i--){
		A[i]=A[i-1];
	}
	A[1]=temp;
			//for(i=1;i<=N;i++){途中経過
			//printf("A[%d]=%d\n",i,A[i]);
			//}
}

printf("%d\n",A[1]);

return 0;



}
0