Submission #233785


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];
	}
	int count = 0;

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

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

	D = D % count;
 
	for(int i = 0;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 939 Byte
Status WA
Exec Time 4037 ms
Memory 3316 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 0 / 10 0 / 20 0 / 20 0 / 50
Status
AC × 6
RE × 3
AC × 8
WA × 7
RE × 3
AC × 12
WA × 2
RE × 4
AC × 3
WA × 12
TLE × 13
RE × 1
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 RE 370 ms 3184 KB
01_random01.txt RE 274 ms 800 KB
01_random02.txt AC 27 ms 808 KB
01_random03.txt AC 27 ms 796 KB
01_random04.txt AC 39 ms 928 KB
01_random05.txt RE 276 ms 1276 KB
01_random06.txt AC 332 ms 2780 KB
01_random07.txt AC 359 ms 3160 KB
02_i.txt RE 269 ms 884 KB
02_p.txt WA 28 ms 876 KB
02_random01.txt RE 261 ms 800 KB
02_random02.txt AC 54 ms 840 KB
02_random03.txt AC 31 ms 856 KB
02_random04.txt WA 29 ms 800 KB
02_random05.txt AC 35 ms 984 KB
02_random06.txt AC 71 ms 1652 KB
02_random07.txt WA 102 ms 2416 KB
02_random08.txt WA 103 ms 2416 KB
02_rp01.txt RE 267 ms 860 KB
02_rp02.txt WA 30 ms 916 KB
02_rp03.txt AC 30 ms 888 KB
02_rp04.txt WA 30 ms 884 KB
02_rp05.txt WA 30 ms 864 KB
03_i.txt RE 265 ms 796 KB
03_random01.txt RE 269 ms 1012 KB
03_random02.txt AC 76 ms 2336 KB
03_random03.txt RE 299 ms 2024 KB
03_random04.txt AC 65 ms 2032 KB
03_random05.txt RE 274 ms 1000 KB
03_random06.txt AC 32 ms 996 KB
03_random07.txt AC 37 ms 1256 KB
03_random08.txt AC 26 ms 924 KB
03_random09.txt WA 44 ms 1248 KB
03_random10.txt AC 54 ms 1644 KB
03_random11.txt AC 75 ms 2260 KB
03_random12.txt AC 77 ms 2284 KB
03_random13.txt AC 70 ms 1968 KB
03_random14.txt WA 60 ms 1772 KB
03_random15.txt AC 39 ms 1124 KB
04_i.txt RE 358 ms 3112 KB
04_p1.txt WA 1779 ms 2444 KB
04_p2.txt TLE 4033 ms 2148 KB
04_random01.txt WA 2698 ms 2032 KB
04_random02.txt WA 1265 ms 1520 KB
04_random03.txt WA 135 ms 1760 KB
04_random04.txt WA 191 ms 2404 KB
04_random05.txt WA 371 ms 2160 KB
04_random06.txt TLE 4035 ms 2032 KB
04_random07.txt WA 1501 ms 2672 KB
04_random08.txt WA 440 ms 2280 KB
04_random09.txt WA 455 ms 2544 KB
04_random10.txt WA 3466 ms 1708 KB
04_random11.txt WA 3077 ms 3168 KB
04_random12.txt TLE 4034 ms 3308 KB
04_random13.txt TLE 4037 ms 3316 KB
04_rp01.txt TLE 4034 ms 2520 KB
04_rp02.txt WA 2412 ms 2416 KB
04_rp03.txt TLE 4033 ms 2540 KB
04_rp04.txt TLE 4034 ms 2540 KB
04_rp05.txt TLE 4034 ms 2440 KB
04_rp06.txt TLE 4034 ms 2528 KB
04_rp07.txt TLE 4035 ms 2540 KB
04_rp08.txt TLE 4035 ms 2480 KB
04_rp09.txt TLE 4036 ms 2532 KB
04_rp10.txt TLE 4035 ms 2444 KB
sample_1.txt AC 30 ms 828 KB
sample_2.txt AC 27 ms 796 KB
sample_3.txt AC 26 ms 800 KB