Submission #233771


Source Code Expand

Copy
#include<iostream>
using namespace std;

int main(){
	int N,M;
	int D;
	cin >> N >> M >> D;
	
	int *A = new int[M];

	for(int i = 0;i < M;i++)
		cin >> A[i];


	int *temp = new int[M];
	int *result = new int[M];
	for(int i = 0;i < M;i++){
		temp[i] = A[i];
	}

	for(int i = 0;i < N;i++){
		result[i] = i + 1;
	}

	int t;
	for(int i = M - 1;i >= 0;i--){
		t = result[temp[i] - 1];
		result[temp[i] - 1] = result[temp[i]];
		result[temp[i]] = t;
	}


	int *tmpresult = new int[N];
	for(int i = 0;i < N;i++){
		tmpresult[i] = result[i];
	}

	for(int i = 1;i < D;i++){
		for(int j = 0;j < N;j++){
			result[j] = tmpresult[result[j] - 1];
		}
	}


	for(int i = 0;i < N;i++){
		cout << result[i] << endl;
	}

	return 0;
}

Submission Info

Submission Time
Task D - 阿弥陀
User doi_ken
Language C++ (G++ 4.6.4)
Score 0
Code Size 766 Byte
Status WA
Exec Time 4037 ms
Memory 3240 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 0 / 10 0 / 20 0 / 20 0 / 50
Status
AC × 8
RE × 1
AC × 12
WA × 5
RE × 1
AC × 10
TLE × 8
AC × 3
TLE × 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 409 ms 3040 KB
01_random01.txt AC 29 ms 924 KB
01_random02.txt AC 27 ms 672 KB
01_random03.txt AC 27 ms 924 KB
01_random04.txt AC 40 ms 800 KB
01_random05.txt RE 308 ms 1188 KB
01_random06.txt AC 381 ms 2728 KB
01_random07.txt AC 410 ms 3100 KB
02_i.txt AC 32 ms 808 KB
02_p.txt WA 30 ms 808 KB
02_random01.txt AC 28 ms 800 KB
02_random02.txt AC 25 ms 800 KB
02_random03.txt AC 33 ms 800 KB
02_random04.txt WA 30 ms 800 KB
02_random05.txt AC 38 ms 924 KB
02_random06.txt AC 71 ms 1568 KB
02_random07.txt AC 114 ms 2336 KB
02_random08.txt AC 115 ms 2276 KB
02_rp01.txt RE 297 ms 800 KB
02_rp02.txt WA 31 ms 800 KB
02_rp03.txt AC 31 ms 804 KB
02_rp04.txt WA 33 ms 796 KB
02_rp05.txt WA 33 ms 928 KB
03_i.txt TLE 4035 ms 800 KB
03_random01.txt AC 481 ms 924 KB
03_random02.txt AC 1652 ms 2220 KB
03_random03.txt AC 3405 ms 1960 KB
03_random04.txt AC 2131 ms 1956 KB
03_random05.txt TLE 4035 ms 1060 KB
03_random06.txt TLE 4035 ms 1056 KB
03_random07.txt TLE 4034 ms 1164 KB
03_random08.txt AC 696 ms 800 KB
03_random09.txt AC 1914 ms 1220 KB
03_random10.txt TLE 4035 ms 1700 KB
03_random11.txt TLE 4035 ms 2336 KB
03_random12.txt TLE 4036 ms 2336 KB
03_random13.txt AC 3450 ms 1944 KB
03_random14.txt AC 462 ms 1696 KB
03_random15.txt TLE 4035 ms 1164 KB
04_i.txt TLE 4035 ms 3240 KB
04_p1.txt TLE 4035 ms 2472 KB
04_p2.txt TLE 4033 ms 2084 KB
04_random01.txt TLE 4034 ms 2072 KB
04_random02.txt TLE 4035 ms 1500 KB
04_random03.txt TLE 4035 ms 1824 KB
04_random04.txt TLE 4035 ms 2472 KB
04_random05.txt TLE 4034 ms 2200 KB
04_random06.txt TLE 4036 ms 1960 KB
04_random07.txt TLE 4035 ms 2716 KB
04_random08.txt TLE 4035 ms 2336 KB
04_random09.txt TLE 4035 ms 2588 KB
04_random10.txt TLE 4035 ms 1832 KB
04_random11.txt TLE 4036 ms 3232 KB
04_random12.txt TLE 4034 ms 3236 KB
04_random13.txt TLE 4034 ms 3232 KB
04_rp01.txt TLE 4033 ms 2456 KB
04_rp02.txt TLE 4037 ms 2464 KB
04_rp03.txt TLE 4035 ms 2452 KB
04_rp04.txt TLE 4036 ms 2476 KB
04_rp05.txt TLE 4034 ms 2464 KB
04_rp06.txt TLE 4035 ms 2472 KB
04_rp07.txt TLE 4035 ms 2464 KB
04_rp08.txt TLE 4035 ms 2372 KB
04_rp09.txt TLE 4034 ms 2464 KB
04_rp10.txt TLE 4034 ms 2468 KB
sample_1.txt AC 27 ms 796 KB
sample_2.txt AC 27 ms 804 KB
sample_3.txt AC 30 ms 752 KB