結果
| 問題 |
No.123 カードシャッフル
|
| コンテスト | |
| ユーザー |
かぼちゃ
|
| 提出日時 | 2018-04-10 20:53:41 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 539 bytes |
| コンパイル時間 | 555 ms |
| コンパイル使用メモリ | 65,548 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 20:57:25 |
| 合計ジャッジ時間 | 1,770 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 RE * 1 |
| other | AC * 7 RE * 3 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i = 0;i < (n);i++)
#define PI 3.14159265359
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<int> num(n);
for(int i = 0;i <= n;i++)num[i] = i;
REP(i,m){
int a,s;
cin >> a;
s = num[a];
for(int j = a;j > 0;j--){
num[j] = num[j-1];
}
num[1] = s;
}
cout << num[1] << endl;
return 0;
}
かぼちゃ