結果
| 問題 | No.123 カードシャッフル |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-21 15:55:28 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 5,000 ms |
| コード長 | 495 bytes |
| 記録 | |
| コンパイル時間 | 753 ms |
| コンパイル使用メモリ | 90,192 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-05-12 08:22:39 |
| 合計ジャッジ時間 | 6,729 ms |
|
ジャッジサーバーID (参考情報) |
tmp-judge_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
#define whole(f,x,...) ([&](decltype((x)) y) { return (f)(begin(y), end(y), ## __VA_ARGS__); })(x)
using namespace std;
int main() {
int n, m; cin >> n >> m;
vector<int> b(n); whole(iota, b, 0);
repeat (i,m) {
int a; cin >> a; -- a;
rotate(b.begin(), b.begin()+a, b.begin()+a+1);
}
cout << b.front()+1 << endl;
return 0;
}