結果

問題 No.123 カードシャッフル
ユーザー ふうふう
提出日時 2015-01-11 23:41:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 79,892 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-03 23:43:07
合計ジャッジ時間 1,520 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 15 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

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