結果
| 問題 |
No.123 カードシャッフル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-07 01:47:09 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 641 bytes |
| コンパイル時間 | 527 ms |
| コンパイル使用メモリ | 81,324 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-25 03:32:07 |
| 合計ジャッジ時間 | 1,146 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 3 WA * 7 |
ソースコード
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>
//#include<bits/stdc++.h>
using namespace std;
int main() {
int a,b;
cin>>a>>b;
int r[60]={};
for(int i=0;i<=55;i++)r[i]=i;
for(int i=0;i<b;i++){
int x;
cin>>x;
int t[60]={};
for(int j=x;j<=a;j++)
t[j-x+1]=r[j];
for(int j=1;j<x;j++)
t[a-x+j+1]=r[j];
for(int j=1;j<=a;j++)
r[j]=t[j];
}
//for(int i=1;i<=a;i++)cout<<r[i];
cout<<r[1]<<endl;
return 0;
}