Submission #214981


Source Code Expand

Copy
import std.stdio, std.string, std.conv
	,std.array,std.algorithm, std.range
	,std.math;

void main(){
	auto buf = readln().strip().split().map!(to!int)();
	immutable int N = buf[0];
	immutable int M = buf[1];
	immutable int D = buf[2];
	auto A = readln().strip().split().map!(to!int)();

	int[] amd = iota(0,N).array;
	int[] alln = amd.dup;

	foreach_reverse(int e; A) {
		swap(amd[e-1], amd[e]);
	}

	int ansn = 1;
	int[] ans = amd.dup;
	int[] tm;

	while(ansn*2 <= D) {
		tm = ans.dup;
		foreach(int j; 0 .. N) {
			ans[j] = tm[ans[j]];
		}
		ansn *= 2;
	}

	int tmn = ansn;
	while(ansn + tmn <= D) {
		foreach(int j; 0 .. N) {
			ans[j] = tm[ans[j]];
		}
		ansn += tmn;
	}

	foreach(int i; ansn .. D) {
		foreach(int j; 0 .. N) {
			ans[j] = amd[ans[j]];
		}
	}

	foreach(int i; 0 .. N) {
		writeln(ans[i]+1);
	}
}

Submission Info

Submission Time
Task D - 阿弥陀
User diginatu
Language D (DMD 2.060)
Score 30
Code Size 868 Byte
Status TLE
Exec Time 4034 ms
Memory 10396 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 × 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 124 ms 9768 KB
01_random01.txt AC 21 ms 928 KB
01_random02.txt AC 22 ms 924 KB
01_random03.txt AC 21 ms 800 KB
01_random04.txt AC 25 ms 1056 KB
01_random05.txt AC 56 ms 3364 KB
01_random06.txt AC 102 ms 7104 KB
01_random07.txt AC 132 ms 9816 KB
02_i.txt AC 26 ms 932 KB
02_p.txt AC 25 ms 940 KB
02_random01.txt AC 20 ms 796 KB
02_random02.txt AC 20 ms 800 KB
02_random03.txt AC 26 ms 988 KB
02_random04.txt AC 26 ms 804 KB
02_random05.txt AC 28 ms 1432 KB
02_random06.txt AC 51 ms 4376 KB
02_random07.txt AC 82 ms 7524 KB
02_random08.txt AC 82 ms 7476 KB
02_rp01.txt AC 23 ms 1056 KB
02_rp02.txt AC 24 ms 932 KB
02_rp03.txt AC 24 ms 924 KB
02_rp04.txt AC 23 ms 936 KB
02_rp05.txt AC 23 ms 932 KB
03_i.txt TLE 4030 ms 932 KB
03_random01.txt AC 166 ms 1176 KB
03_random02.txt AC 394 ms 7140 KB
03_random03.txt AC 933 ms 6816 KB
03_random04.txt AC 1201 ms 6768 KB
03_random05.txt TLE 4032 ms 1564 KB
03_random06.txt TLE 4029 ms 1436 KB
03_random07.txt TLE 4031 ms 1820 KB
03_random08.txt AC 1095 ms 868 KB
03_random09.txt AC 961 ms 2716 KB
03_random10.txt TLE 4031 ms 4772 KB
03_random11.txt TLE 4029 ms 6572 KB
03_random12.txt TLE 4034 ms 7276 KB
03_random13.txt TLE 4030 ms 6140 KB
03_random14.txt AC 556 ms 5544 KB
03_random15.txt AC 1944 ms 1692 KB
04_i.txt TLE 4031 ms 9700 KB
04_p1.txt TLE 4030 ms 6760 KB
04_p2.txt TLE 4030 ms 6236 KB
04_random01.txt TLE 4030 ms 5832 KB
04_random02.txt TLE 4031 ms 3612 KB
04_random03.txt TLE 4030 ms 6064 KB
04_random04.txt TLE 4031 ms 7188 KB
04_random05.txt TLE 4032 ms 8664 KB
04_random06.txt TLE 4031 ms 6712 KB
04_random07.txt TLE 4031 ms 10396 KB
04_random08.txt TLE 4030 ms 8088 KB
04_random09.txt TLE 4031 ms 10184 KB
04_random10.txt TLE 4033 ms 6616 KB
04_random11.txt TLE 4032 ms 9700 KB
04_random12.txt TLE 4031 ms 9692 KB
04_random13.txt TLE 4031 ms 9700 KB
04_rp01.txt TLE 4031 ms 6756 KB
04_rp02.txt TLE 4031 ms 6752 KB
04_rp03.txt TLE 4030 ms 6756 KB
04_rp04.txt TLE 4030 ms 6740 KB
04_rp05.txt TLE 4031 ms 6756 KB
04_rp06.txt TLE 4031 ms 6712 KB
04_rp07.txt TLE 4031 ms 6748 KB
04_rp08.txt TLE 4031 ms 6756 KB
04_rp09.txt TLE 4031 ms 6756 KB
04_rp10.txt TLE 4031 ms 6756 KB
sample_1.txt AC 22 ms 924 KB
sample_2.txt AC 23 ms 800 KB
sample_3.txt AC 21 ms 932 KB