Submission #1191471


Source Code Expand

#include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;

LL N, M, D;
LL tmp[212345], T[30][212345];

int main()
{
	in >> N >> M >> D;

	rep(i, N) { tmp[i] = i; }
	rep(i, M)
	{
		LL a; in >> a;
		std::swap(tmp[a - 1], tmp[a]);
	}
	rep(i, N) { T[0][tmp[i]] = i; }
	rep(i, 29)
	{
		rep(j, N) { T[i + 1][j] = T[i][T[i][j]]; }
	}
	rep(i, N)
	{
		LL ans = i;
		rep(j, 30)
		{
			if (D & 1 << j) { ans = T[j][ans]; }
		}
		out << ans + 1 << std::endl;
	}
	return 0;
}

Submission Info

Submission Time
Task D - 阿弥陀
User Bwambocos
Language C++14 (GCC 5.4.1)
Score 100
Code Size 617 Byte
Status AC
Exec Time 235 ms
Memory 51200 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 10 / 10 20 / 20 20 / 20 50 / 50
Status
AC × 9
AC × 18
AC × 18
AC × 29
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 222 ms 51200 KB
01_random01.txt AC 11 ms 49408 KB
01_random02.txt AC 11 ms 49408 KB
01_random03.txt AC 11 ms 49408 KB
01_random04.txt AC 18 ms 49408 KB
01_random05.txt AC 175 ms 51200 KB
01_random06.txt AC 208 ms 51200 KB
01_random07.txt AC 220 ms 51072 KB
02_i.txt AC 13 ms 49408 KB
02_p.txt AC 12 ms 49408 KB
02_random01.txt AC 11 ms 49408 KB
02_random02.txt AC 11 ms 49408 KB
02_random03.txt AC 13 ms 49408 KB
02_random04.txt AC 12 ms 49408 KB
02_random05.txt AC 16 ms 49408 KB
02_random06.txt AC 33 ms 49408 KB
02_random07.txt AC 53 ms 49408 KB
02_random08.txt AC 54 ms 49408 KB
02_rp01.txt AC 12 ms 49408 KB
02_rp02.txt AC 12 ms 49408 KB
02_rp03.txt AC 12 ms 49536 KB
02_rp04.txt AC 12 ms 49408 KB
02_rp05.txt AC 12 ms 49408 KB
03_i.txt AC 11 ms 49408 KB
03_random01.txt AC 13 ms 49408 KB
03_random02.txt AC 40 ms 49408 KB
03_random03.txt AC 34 ms 49408 KB
03_random04.txt AC 34 ms 49408 KB
03_random05.txt AC 15 ms 49408 KB
03_random06.txt AC 15 ms 49408 KB
03_random07.txt AC 17 ms 49408 KB
03_random08.txt AC 11 ms 49408 KB
03_random09.txt AC 19 ms 49408 KB
03_random10.txt AC 26 ms 49408 KB
03_random11.txt AC 39 ms 49408 KB
03_random12.txt AC 39 ms 49408 KB
03_random13.txt AC 33 ms 49408 KB
03_random14.txt AC 28 ms 49408 KB
03_random15.txt AC 17 ms 49408 KB
04_i.txt AC 227 ms 51200 KB
04_p1.txt AC 209 ms 51072 KB
04_p2.txt AC 172 ms 50816 KB
04_random01.txt AC 129 ms 50560 KB
04_random02.txt AC 102 ms 50304 KB
04_random03.txt AC 52 ms 49664 KB
04_random04.txt AC 69 ms 49536 KB
04_random05.txt AC 71 ms 49664 KB
04_random06.txt AC 136 ms 50560 KB
04_random07.txt AC 123 ms 50176 KB
04_random08.txt AC 106 ms 50048 KB
04_random09.txt AC 93 ms 49792 KB
04_random10.txt AC 126 ms 50560 KB
04_random11.txt AC 230 ms 51072 KB
04_random12.txt AC 235 ms 51200 KB
04_random13.txt AC 224 ms 51072 KB
04_rp01.txt AC 205 ms 51200 KB
04_rp02.txt AC 203 ms 51072 KB
04_rp03.txt AC 202 ms 51072 KB
04_rp04.txt AC 206 ms 51072 KB
04_rp05.txt AC 204 ms 51200 KB
04_rp06.txt AC 212 ms 51072 KB
04_rp07.txt AC 205 ms 51200 KB
04_rp08.txt AC 209 ms 51072 KB
04_rp09.txt AC 208 ms 51200 KB
04_rp10.txt AC 212 ms 51072 KB
sample_1.txt AC 11 ms 49408 KB
sample_2.txt AC 11 ms 49408 KB
sample_3.txt AC 11 ms 49408 KB