Contest Duration: - (local time) (120 minutes) Back to Home

Submission #215462

Source Code Expand

Copy
```#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))

#define MOD 1000000007

int dd[38][100010];

int main(){
int n,m,d;
vector<int> v;
cin >> n >> m >> d;

rep(i,0,m){
int a;
cin >> a;
v.pb(a);
}

rep(i,1,n+1){
dd[0][i]=i;
}

rep(i,0,m){
swap(dd[0][v[i]],dd[0][v[i]+1]);
}

rep(i,0,35){
rep(j,1,n+1){
dd[i+1][j] = dd[i][dd[i][j]];
}
}

int dd2[100010];

rep(i,1,n+1){
dd2[i]=i;
}

rep(i,0,35){
if(((d>>i)&1)==1){
int dd3[100010];
rep(j,1,n+1){
dd3[j] = dd2[dd[i][j]];
}
rep(j,1,n+1){
dd2[j] = dd3[j];
}
}
}

rep(i,1,n+1){
cout << dd2[i] << endl;
}

return 0;
}```

#### Submission Info

Submission Time 2014-08-17 20:50:02+0900 D - 阿弥陀 cls0001011 C++ (G++ 4.6.4) 0 1492 Byte WA 526 ms 17124 KB

#### Judge Result

Score / Max Score 0 / 10 0 / 20 0 / 20 0 / 50
Status
 AC × 4 WA × 5
 AC × 6 WA × 12
 AC × 9 WA × 9
 AC × 3 WA × 26
Set Name Test Cases
Subtask1 sample_1.txt, 01_i.txt, 01_random01.txt, 01_random02.txt, 01_random03.txt, 01_random04.txt, 01_random05.txt, 01_random06.txt, 01_random07.txt
Subtask2 sample_1.txt, sample_2.txt, sample_3.txt, 02_i.txt, 02_p.txt, 02_random01.txt, 02_random02.txt, 02_random03.txt, 02_random04.txt, 02_random05.txt, 02_random06.txt, 02_random07.txt, 02_random08.txt, 02_rp01.txt, 02_rp02.txt, 02_rp03.txt, 02_rp04.txt, 02_rp05.txt
Subtask3 sample_1.txt, sample_2.txt, 03_i.txt, 03_random01.txt, 03_random02.txt, 03_random03.txt, 03_random04.txt, 03_random05.txt, 03_random06.txt, 03_random07.txt, 03_random08.txt, 03_random09.txt, 03_random10.txt, 03_random11.txt, 03_random12.txt, 03_random13.txt, 03_random14.txt, 03_random15.txt
Subtask4 sample_1.txt, sample_2.txt, sample_3.txt, 04_i.txt, 04_p1.txt, 04_p2.txt, 04_random01.txt, 04_random02.txt, 04_random03.txt, 04_random04.txt, 04_random05.txt, 04_random06.txt, 04_random07.txt, 04_random08.txt, 04_random09.txt, 04_random10.txt, 04_random11.txt, 04_random12.txt, 04_random13.txt, 04_rp01.txt, 04_rp02.txt, 04_rp03.txt, 04_rp04.txt, 04_rp05.txt, 04_rp06.txt, 04_rp07.txt, 04_rp08.txt, 04_rp09.txt, 04_rp10.txt
Case Name Status Exec Time Memory
01_i.txt AC 520 ms 17036 KB
01_random01.txt AC 23 ms 876 KB
01_random02.txt AC 22 ms 928 KB
01_random03.txt AC 33 ms 1048 KB
01_random04.txt WA 38 ms 1556 KB
01_random05.txt WA 439 ms 16412 KB
01_random06.txt WA 492 ms 16920 KB
01_random07.txt WA 518 ms 17056 KB
02_i.txt AC 26 ms 1176 KB
02_p.txt WA 26 ms 1180 KB
02_random01.txt AC 23 ms 892 KB
02_random02.txt AC 21 ms 1056 KB
02_random03.txt WA 26 ms 1068 KB
02_random04.txt AC 25 ms 1068 KB
02_random05.txt WA 33 ms 1192 KB
02_random06.txt WA 62 ms 1628 KB
02_random07.txt WA 96 ms 1932 KB
02_random08.txt WA 96 ms 2012 KB
02_rp01.txt WA 26 ms 1184 KB
02_rp02.txt WA 26 ms 1180 KB
02_rp03.txt WA 25 ms 1056 KB
02_rp04.txt WA 25 ms 1044 KB
02_rp05.txt WA 28 ms 996 KB
03_i.txt AC 21 ms 1056 KB
03_random01.txt AC 27 ms 1120 KB
03_random02.txt AC 71 ms 1960 KB
03_random03.txt AC 66 ms 1956 KB
03_random04.txt WA 61 ms 1940 KB
03_random05.txt AC 29 ms 1192 KB
03_random06.txt WA 31 ms 1132 KB
03_random07.txt WA 32 ms 1180 KB
03_random08.txt AC 22 ms 928 KB
03_random09.txt AC 37 ms 1304 KB
03_random10.txt WA 49 ms 1444 KB
03_random11.txt WA 69 ms 1944 KB
03_random12.txt WA 71 ms 2064 KB
03_random13.txt WA 61 ms 1876 KB
03_random14.txt WA 52 ms 1444 KB
03_random15.txt AC 33 ms 1180 KB
04_i.txt AC 526 ms 17124 KB
04_p1.txt WA 477 ms 16676 KB
04_p2.txt WA 384 ms 13528 KB
04_random01.txt WA 293 ms 10008 KB
04_random02.txt WA 223 ms 7968 KB
04_random03.txt WA 105 ms 3032 KB
04_random04.txt WA 132 ms 3100 KB
04_random05.txt WA 140 ms 3732 KB
04_random06.txt WA 307 ms 10660 KB
04_random07.txt WA 252 ms 7148 KB
04_random08.txt WA 220 ms 6244 KB
04_random09.txt WA 178 ms 4364 KB
04_random10.txt WA 297 ms 10592 KB
04_random11.txt WA 525 ms 17056 KB
04_random12.txt WA 519 ms 17048 KB
04_random13.txt WA 516 ms 17048 KB
04_rp01.txt WA 474 ms 16728 KB
04_rp02.txt WA 475 ms 16660 KB
04_rp03.txt WA 476 ms 16668 KB
04_rp04.txt WA 474 ms 16660 KB
04_rp05.txt WA 474 ms 16660 KB
04_rp06.txt WA 488 ms 16724 KB
04_rp07.txt WA 479 ms 16672 KB
04_rp08.txt WA 477 ms 16672 KB
04_rp09.txt WA 477 ms 16668 KB
04_rp10.txt WA 477 ms 16668 KB
sample_1.txt WA 22 ms 860 KB
sample_2.txt AC 21 ms 924 KB
sample_3.txt AC 22 ms 932 KB