結果

問題 No.123 カードシャッフル
ユーザー r2en_r2en_
提出日時 2017-07-10 18:56:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 890 ms
コンパイル使用メモリ 74,400 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 12:32:06
合計ジャッジ時間 1,645 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i = 1; i < (n); i++)

int main(){
    int n; cin >> n;
    vector<int>s(n);
    rep(i,n){ s[i] = i; }

    int m; cin >> m;
    int a;
    rep(i,m){
        cin >> a;
        s.erase(s.begin() + (a+1));
        s.insert(s.begin(),a);
    }
    cout << s[0] << endl;

    return 0;
}
0