結果
| 問題 | No.123 カードシャッフル |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2020-06-03 13:19:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 19 ms / 5,000 ms |
| コード長 | 342 bytes |
| コンパイル時間 | 1,358 ms |
| コンパイル使用メモリ | 169,660 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-25 02:49:05 |
| 合計ジャッジ時間 | 1,946 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int N, M;
cin >> N >> M;
vector<int> a( N );
for( int i = 0; i < N; i++ ) a[i] = N - i;
for( int i = 0; i < M; i++ ) {
int A;
cin >> A;
int idx = N - A;
int n = a[idx];
a.erase( a.begin() + idx );
a.push_back( n );
}
int ans = a[N - 1];
cout << ans << endl;
}
forest3