結果
問題 |
No.123 カードシャッフル
|
ユーザー |
|
提出日時 | 2020-09-16 00:31:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 5,000 ms |
コード長 | 409 bytes |
コンパイル時間 | 1,802 ms |
コンパイル使用メモリ | 194,692 KB |
最終ジャッジ日時 | 2025-01-14 15:08:15 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; void solve() { int N, M, x; cin >> N >> M; vector<int> v(N); rep(i, 0, N) v[i] = i + 1; rep(i, 0, M) { cin >> x; x--; for (int j = x; j > 0; --j) swap(v[j], v[j - 1]); } cout << v.front() << endl; } int main() { ios::sync_with_stdio(false); cin.tie(0); solve(); getchar(); }