結果
| 問題 | No.123 カードシャッフル |
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2021-10-26 22:41:35 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 5,000 ms |
| コード長 | 450 bytes |
| 記録 | |
| コンパイル時間 | 2,865 ms |
| コンパイル使用メモリ | 274,520 KB |
| 実行使用メモリ | 7,968 KB |
| 最終ジャッジ日時 | 2026-06-23 12:44:40 |
| 合計ジャッジ時間 | 4,015 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 |
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint1000000007;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000
int main(){
int n,m;
cin>>n>>m;
vector<int> ans(n);
rep(i,n)ans[i] = i+1;
rep(_,m){
int a;
cin>>a;
a--;
int t = ans[a];
ans.erase(ans.begin()+a);
ans.insert(ans.begin(),t);
}
cout<<ans[0]<<endl;
return 0;
}
沙耶花