結果

問題 No.123 カードシャッフル
ユーザー rinrinta121rinrinta121
提出日時 2019-05-23 18:29:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 597 bytes
コンパイル時間 726 ms
コンパイル使用メモリ 86,144 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 11:33:56
合計ジャッジ時間 3,404 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;

int main()
{
    int n,m;
    cin >> n >> m;
    vector<int> a;
    for(int i = 0; i < n; i++){
        a[i] = (i+1);
    }
    for(int i = 0; i < m; i++){
        int k;
        cin >> k;
        k--;
        int tmp = a[k];
        a.erase(a.begin()+k);
        a.insert(a.begin(),tmp);
    }
    cout << a[0] << endl;
}
0