結果

問題 No.123 カードシャッフル
ユーザー yuyu_106
提出日時 2019-06-06 15:39:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 301 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 56,932 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-25 09:56:31
合計ジャッジ時間 1,509 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(){
	int a[50];
	int n,m;
	cin >> n >> m;
	int i;
	for(i=0;i<=n;i++) {
		a[i] = i;
	}
	int x;
	for(i=0; i<m; i++){
		cin >> x;
		a[0]=a[x];
		for(;x>0;x--){
			a[x]=a[x-1];
		}
	}
	cout << a[1] << endl;
	return 0;
}
0