結果
問題 | No.123 カードシャッフル |
ユーザー |
|
提出日時 | 2016-09-21 15:55:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 5,000 ms |
コード長 | 495 bytes |
コンパイル時間 | 820 ms |
コンパイル使用メモリ | 73,088 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 10:24:20 |
合計ジャッジ時間 | 1,733 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;}