結果

問題 No.123 カードシャッフル
ユーザー ふう
提出日時 2015-01-11 23:41:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 760 ms
コンパイル使用メモリ 82,796 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-13 04:15:21
合計ジャッジ時間 1,953 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 3 WA * 4 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <map>
#include <list>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <iomanip>
#define INF 1050000000

using namespace std;

int main(void)
{
	int n, m;
	int x[50];
	int a, o;

	cin >> n >> m;

	for (int i = 1; i <= n; i++) {
		x[i] = i;

	}

	for (int i = 0; i < m; i++) {
		cin >> a;
		o = x[a];
		for (int j = a; j >= 2; j--) {
			x[j - 1] = x[j];
		}
		x[1] = o;
	}

	cout << x[1] << endl;

}
0