Submission #214494


Source Code Expand

Copy
#open my $fh, "<", shift;
my $fh = STDIN;

chomp(my $l1 = <$fh>);
chomp(my $l2 = <$fh>);

my ($N, $M, $D) = split(/\s/, $l1);
my @A = split(/\s/, $l2);

my @S;
my @R;
for(my $n = 0; $n < $N; ++$n) {
    $S[$n] = $n;
    $R[$n] = $n;
}

foreach my $t (@A) {
    ($S[$t-1], $S[$t]) = ($S[$t], $S[$t-1]);
}

foreach my $d (1..($D % ($M + 1))) {
    for(my $n = 0; $n < $N; ++$n) {
        $R[$n] = $S[$R[$n]];
    }
}

my @Q;
for(my $n = 0; $n < $N; ++$n) {
    $Q[$R[$n]] = $n;
}

for(my $n = 0; $n < $N; ++$n) {
    my $r = $Q[$n] + 1;
    print "$r\n";
}

Submission Info

Submission Time
Task D - 阿弥陀
User ktnyt
Language Perl (5.14.2)
Score 10
Code Size 590 Byte
Status WA
Exec Time 4035 ms
Memory 39660 KB

Compile Error

./Main.pl syntax OK

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 10 / 10 0 / 20 0 / 20 0 / 50
Status
AC × 9
AC × 17
WA × 1
AC × 11
WA × 7
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 565 ms 39660 KB
01_random01.txt AC 26 ms 1056 KB
01_random02.txt AC 23 ms 920 KB
01_random03.txt AC 24 ms 932 KB
01_random04.txt AC 42 ms 2676 KB
01_random05.txt AC 245 ms 15932 KB
01_random06.txt AC 472 ms 32628 KB
01_random07.txt AC 555 ms 39608 KB
02_i.txt AC 240 ms 1320 KB
02_p.txt WA 38 ms 1180 KB
02_random01.txt AC 23 ms 932 KB
02_random02.txt AC 24 ms 996 KB
02_random03.txt AC 48 ms 1576 KB
02_random04.txt AC 24 ms 988 KB
02_random05.txt AC 102 ms 4256 KB
02_random06.txt AC 182 ms 17148 KB
02_random07.txt AC 552 ms 33212 KB
02_random08.txt AC 558 ms 33264 KB
02_rp01.txt AC 146 ms 1200 KB
02_rp02.txt AC 133 ms 1304 KB
02_rp03.txt AC 53 ms 1248 KB
02_rp04.txt AC 139 ms 1120 KB
02_rp05.txt AC 143 ms 1128 KB
03_i.txt AC 24 ms 912 KB
03_random01.txt AC 58 ms 3744 KB
03_random02.txt AC 407 ms 31600 KB
03_random03.txt AC 382 ms 26360 KB
03_random04.txt AC 410 ms 26104 KB
03_random05.txt AC 103 ms 5924 KB
03_random06.txt WA 84 ms 5284 KB
03_random07.txt AC 144 ms 8104 KB
03_random08.txt WA 30 ms 1444 KB
03_random09.txt WA 212 ms 10208 KB
03_random10.txt AC 371 ms 17636 KB
03_random11.txt WA 374 ms 30192 KB
03_random12.txt WA 454 ms 31272 KB
03_random13.txt WA 499 ms 24428 KB
03_random14.txt WA 332 ms 19692 KB
03_random15.txt AC 102 ms 8164 KB
04_i.txt TLE 4034 ms 35704 KB
04_p1.txt TLE 4032 ms 21752 KB
04_p2.txt TLE 4031 ms 17912 KB
04_random01.txt TLE 4033 ms 19188 KB
04_random02.txt TLE 4031 ms 10612 KB
04_random03.txt TLE 4033 ms 18160 KB
04_random04.txt TLE 4034 ms 32112 KB
04_random05.txt TLE 4032 ms 26088 KB
04_random06.txt TLE 4032 ms 16976 KB
04_random07.txt TLE 4033 ms 33852 KB
04_random08.txt TLE 4033 ms 28528 KB
04_random09.txt TLE 4033 ms 34040 KB
04_random10.txt TLE 4031 ms 12928 KB
04_random11.txt TLE 4035 ms 35700 KB
04_random12.txt TLE 4033 ms 35700 KB
04_random13.txt TLE 4034 ms 35756 KB
04_rp01.txt TLE 4033 ms 21748 KB
04_rp02.txt TLE 4033 ms 21872 KB
04_rp03.txt TLE 4033 ms 21748 KB
04_rp04.txt TLE 4032 ms 21748 KB
04_rp05.txt TLE 4032 ms 21872 KB
04_rp06.txt TLE 4032 ms 21752 KB
04_rp07.txt TLE 4033 ms 21768 KB
04_rp08.txt TLE 4033 ms 21736 KB
04_rp09.txt TLE 4033 ms 21880 KB
04_rp10.txt TLE 4032 ms 21752 KB
sample_1.txt AC 24 ms 988 KB
sample_2.txt AC 23 ms 940 KB
sample_3.txt AC 23 ms 1056 KB