Submission #3817437


Source Code Expand

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int MAX_M = (int)2e5 + 5;

int A[MAX_M];

int main()
{
	memset(A, 0, sizeof(A));
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int N, M, D; cin >> N >> M >> D;
	rep (i, M){
		int a; cin >> a;
		--a;
		A[i] = a;
	} // end rep

	if (D > 1000){
		exit(-1);
	} // end if

	vector<int> n(N, 0);
	rep (i, N) n[i] = i;
	rep (d, D){
		rep (j, M){
			swap (n[A[j]], n[A[j]+1]);
		} // end rep
	} // end rep
	vector<int> pos(N, 0);
	rep (i, N){
		pos[n[i]] = i;
	} // end rep
	
	rep (i, N){
		cout << pos[i] + 1 << endl;
	} // end rep

	return 0;
}

Submission Info

Submission Time
Task D - 阿弥陀
User ty70
Language C++14 (GCC 5.4.1)
Score 30
Code Size 760 Byte
Status RE
Exec Time 318 ms
Memory 2432 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 10 / 10 20 / 20 0 / 20 0 / 50
Status
AC × 9
AC × 18
AC × 2
RE × 16
AC × 3
RE × 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 163 ms 2432 KB
01_random01.txt AC 2 ms 1024 KB
01_random02.txt AC 2 ms 1024 KB
01_random03.txt AC 2 ms 1024 KB
01_random04.txt AC 7 ms 1024 KB
01_random05.txt AC 152 ms 2432 KB
01_random06.txt AC 164 ms 2432 KB
01_random07.txt AC 165 ms 2432 KB
02_i.txt AC 6 ms 1024 KB
02_p.txt AC 5 ms 1024 KB
02_random01.txt AC 1 ms 1024 KB
02_random02.txt AC 1 ms 1024 KB
02_random03.txt AC 4 ms 1024 KB
02_random04.txt AC 3 ms 1024 KB
02_random05.txt AC 11 ms 1024 KB
02_random06.txt AC 10 ms 1024 KB
02_random07.txt AC 318 ms 1024 KB
02_random08.txt AC 318 ms 1024 KB
02_rp01.txt AC 4 ms 1024 KB
02_rp02.txt AC 4 ms 1024 KB
02_rp03.txt AC 3 ms 1024 KB
02_rp04.txt AC 4 ms 1024 KB
02_rp05.txt AC 4 ms 1024 KB
03_i.txt RE 2 ms 1024 KB
03_random01.txt RE 2 ms 1024 KB
03_random02.txt RE 12 ms 1024 KB
03_random03.txt RE 10 ms 1024 KB
03_random04.txt RE 10 ms 1024 KB
03_random05.txt RE 3 ms 1024 KB
03_random06.txt RE 3 ms 1024 KB
03_random07.txt RE 4 ms 1024 KB
03_random08.txt RE 2 ms 1024 KB
03_random09.txt RE 5 ms 1024 KB
03_random10.txt RE 7 ms 1024 KB
03_random11.txt RE 12 ms 1024 KB
03_random12.txt RE 12 ms 1024 KB
03_random13.txt RE 9 ms 1024 KB
03_random14.txt RE 8 ms 1024 KB
03_random15.txt RE 4 ms 1024 KB
04_i.txt RE 17 ms 1024 KB
04_p1.txt RE 9 ms 1024 KB
04_p2.txt RE 7 ms 1024 KB
04_random01.txt RE 9 ms 1024 KB
04_random02.txt RE 5 ms 1024 KB
04_random03.txt RE 9 ms 1024 KB
04_random04.txt RE 15 ms 1024 KB
04_random05.txt RE 13 ms 1024 KB
04_random06.txt RE 8 ms 1024 KB
04_random07.txt RE 16 ms 1024 KB
04_random08.txt RE 14 ms 1024 KB
04_random09.txt RE 17 ms 1024 KB
04_random10.txt RE 6 ms 1024 KB
04_random11.txt RE 17 ms 1024 KB
04_random12.txt RE 17 ms 1024 KB
04_random13.txt RE 17 ms 1024 KB
04_rp01.txt RE 9 ms 1024 KB
04_rp02.txt RE 9 ms 1024 KB
04_rp03.txt RE 9 ms 1024 KB
04_rp04.txt RE 9 ms 1024 KB
04_rp05.txt RE 9 ms 1024 KB
04_rp06.txt RE 9 ms 1024 KB
04_rp07.txt RE 9 ms 1024 KB
04_rp08.txt RE 9 ms 1024 KB
04_rp09.txt RE 9 ms 1024 KB
04_rp10.txt RE 9 ms 1024 KB
sample_1.txt AC 2 ms 1024 KB
sample_2.txt AC 2 ms 1024 KB
sample_3.txt AC 2 ms 1024 KB