結果

問題 No.123 カードシャッフル
ユーザー zaichuzaichu
提出日時 2015-12-23 02:41:16
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 23 ms / 5,000 ms
コード長 327 bytes
コンパイル時間 1,841 ms
コンパイル使用メモリ 161,652 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-18 19:25:55
合計ジャッジ時間 2,607 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n,m;
	cin >> n >> m;
	vector<int> data(n);
	for(int i = 0; i < n; i++) data[i] = i+1;
	int x;
	while(cin >> x){
		data.insert(data.begin(),data[x-1]);
		data.erase(data.begin()+x);
	}
	//	for(auto a:data) cout << a << endl;
	cout << data[0] << endl;
	return 0;
}
0