結果

問題 No.123 カードシャッフル
ユーザー pyraninepyranine
提出日時 2020-12-16 13:58:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 331 bytes
コンパイル時間 1,667 ms
コンパイル使用メモリ 171,468 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-20 05:02:49
合計ジャッジ時間 4,047 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 RE * 2
other RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M + 1);
  for (int i = 1; i <= M; i++) cin >> A[i];
  for (int i = 0; i < M; i++) {
    int a; cin >> a; a--;
    int t = A[a];
    A.erase(A.begin() + a);
    A.insert(A.begin(), t);
  }
  cout << A[0] << endl;
  return 0;
}
0