Submission #2240446


Source Code Expand

#!/usr/bin/env perl

use strict;
use warnings;

my $input = <STDIN>;
chomp $input;
my ($n, $yoko_lines, $joint) = split(/\s/, $input);

$input = <STDIN>;
chomp $input;
my @branches = split(/\s/, $input);

my @numbers = (1..$n);
for my $branch (reverse(@branches)){
    my $tmp = $numbers[$branch - 1];
    $numbers[$branch - 1] = $numbers[$branch];
    $numbers[$branch] = $tmp;
}
my @change_table = @numbers;
my @new_numbers;
for (1..($joint - 1)){
    for my $n (0..(@numbers - 1)){
        $new_numbers[$n] = $change_table[$numbers[$n] - 1];
    }
    @numbers = @new_numbers;
}

for my $i (0..($n - 1)){
    print "$numbers[$i]\n";
}

Submission Info

Submission Time
Task D - 阿弥陀
User tomcha
Language Perl (v5.18.2)
Score 30
Code Size 669 Byte
Status TLE
Exec Time 4206 ms
Memory 40996 KB

Compile Error

./Main.pl syntax OK

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
TLE × 16
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 194 ms 40868 KB
01_random01.txt AC 4 ms 640 KB
01_random02.txt AC 4 ms 640 KB
01_random03.txt AC 4 ms 640 KB
01_random04.txt AC 12 ms 2432 KB
01_random05.txt AC 67 ms 18304 KB
01_random06.txt AC 152 ms 33956 KB
01_random07.txt AC 194 ms 40996 KB
02_i.txt AC 178 ms 1024 KB
02_p.txt AC 173 ms 896 KB
02_random01.txt AC 4 ms 640 KB
02_random02.txt AC 4 ms 640 KB
02_random03.txt AC 19 ms 1280 KB
02_random04.txt AC 177 ms 768 KB
02_random05.txt AC 55 ms 3968 KB
02_random06.txt AC 78 ms 16804 KB
02_random07.txt AC 329 ms 32932 KB
02_random08.txt AC 324 ms 32932 KB
02_rp01.txt AC 102 ms 896 KB
02_rp02.txt AC 92 ms 896 KB
02_rp03.txt AC 26 ms 896 KB
02_rp04.txt AC 94 ms 896 KB
02_rp05.txt AC 109 ms 896 KB
03_i.txt TLE 4203 ms 640 KB
03_random01.txt TLE 4203 ms 3456 KB
03_random02.txt TLE 4204 ms 33316 KB
03_random03.txt TLE 4205 ms 26020 KB
03_random04.txt TLE 4204 ms 27812 KB
03_random05.txt TLE 4204 ms 5632 KB
03_random06.txt TLE 4204 ms 4864 KB
03_random07.txt TLE 4204 ms 9856 KB
03_random08.txt TLE 4203 ms 1024 KB
03_random09.txt TLE 4204 ms 11904 KB
03_random10.txt TLE 4204 ms 17280 KB
03_random11.txt TLE 4205 ms 29860 KB
03_random12.txt TLE 4205 ms 31012 KB
03_random13.txt TLE 4205 ms 24100 KB
03_random14.txt TLE 4204 ms 21412 KB
03_random15.txt TLE 4204 ms 7808 KB
04_i.txt TLE 4206 ms 38052 KB
04_p1.txt TLE 4205 ms 23972 KB
04_p2.txt TLE 4204 ms 19236 KB
04_random01.txt TLE 4204 ms 22436 KB
04_random02.txt TLE 4204 ms 11300 KB
04_random03.txt TLE 4204 ms 17700 KB
04_random04.txt TLE 4205 ms 31524 KB
04_random05.txt TLE 4205 ms 25764 KB
04_random06.txt TLE 4204 ms 20388 KB
04_random07.txt TLE 4205 ms 33284 KB
04_random08.txt TLE 4205 ms 28580 KB
04_random09.txt TLE 4205 ms 33572 KB
04_random10.txt TLE 4204 ms 14500 KB
04_random11.txt TLE 4205 ms 40100 KB
04_random12.txt TLE 4206 ms 38052 KB
04_random13.txt TLE 4206 ms 38052 KB
04_rp01.txt TLE 4205 ms 24100 KB
04_rp02.txt TLE 4205 ms 24100 KB
04_rp03.txt TLE 4204 ms 26148 KB
04_rp04.txt TLE 4205 ms 24100 KB
04_rp05.txt TLE 4205 ms 24100 KB
04_rp06.txt TLE 4205 ms 24100 KB
04_rp07.txt TLE 4205 ms 24100 KB
04_rp08.txt TLE 4204 ms 26148 KB
04_rp09.txt TLE 4205 ms 24100 KB
04_rp10.txt TLE 4205 ms 24100 KB
sample_1.txt AC 4 ms 640 KB
sample_2.txt AC 4 ms 640 KB
sample_3.txt AC 4 ms 640 KB