Submission #214349


Source Code Expand

a = gets.split(" ")
$n = a[0].to_i
$m = a[1].to_i
$d = a[2].to_i
a = gets.split(" ")
$a = a.collect {|e| e.to_i}

$amida = (1..$n).to_a

$a.each do |e|
    $amida[e-1],$amida[e] = $amida[e],$amida[e-1]
end

$array = (1..$n).collect {|e| $amida.index(e)+1}
cnt = 0
i = 1
$amida.each {|item|
    cnt = cnt + 1 if item == i
    i = i + 1
}
a = $n - cnt

$d %= a
$d = $d - 1

$d.times do
    $a.each do |e|
        $amida[e-1],$amida[e] = $amida[e],$amida[e-1]
    end
end

(1..$n).collect {|e| puts $amida.index(e)+1}

Submission Info

Submission Time
Task D - 阿弥陀
User odan
Language Ruby (1.9.3)
Score 0
Code Size 547 Byte
Status WA
Exec Time 4052 ms
Memory 21924 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 0 / 10 0 / 20 0 / 20 0 / 50
Status
AC × 4
TLE × 4
RE × 1
AC × 12
WA × 3
RE × 3
AC × 10
WA × 4
RE × 4
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 TLE 4051 ms 21868 KB
01_random01.txt RE 54 ms 4224 KB
01_random02.txt AC 53 ms 4204 KB
01_random03.txt AC 56 ms 4212 KB
01_random04.txt AC 579 ms 4724 KB
01_random05.txt TLE 4035 ms 7604 KB
01_random06.txt TLE 4052 ms 20804 KB
01_random07.txt TLE 4050 ms 21872 KB
02_i.txt RE 84 ms 4212 KB
02_p.txt WA 128 ms 4204 KB
02_random01.txt RE 57 ms 4212 KB
02_random02.txt AC 55 ms 4208 KB
02_random03.txt AC 283 ms 4468 KB
02_random04.txt RE 84 ms 4176 KB
02_random05.txt AC 2410 ms 5360 KB
02_random06.txt AC 334 ms 12792 KB
02_random07.txt WA 2161 ms 20460 KB
02_random08.txt WA 1149 ms 20456 KB
02_rp01.txt AC 410 ms 4208 KB
02_rp02.txt AC 379 ms 4192 KB
02_rp03.txt AC 184 ms 4240 KB
02_rp04.txt AC 385 ms 4208 KB
02_rp05.txt AC 398 ms 4220 KB
03_i.txt RE 59 ms 4208 KB
03_random01.txt RE 75 ms 5236 KB
03_random02.txt AC 275 ms 19944 KB
03_random03.txt RE 238 ms 19440 KB
03_random04.txt AC 235 ms 19304 KB
03_random05.txt RE 90 ms 6508 KB
03_random06.txt WA 81 ms 6388 KB
03_random07.txt AC 105 ms 8564 KB
03_random08.txt AC 59 ms 4260 KB
03_random09.txt WA 269 ms 8668 KB
03_random10.txt AC 227 ms 12776 KB
03_random11.txt AC 453 ms 19812 KB
03_random12.txt AC 459 ms 19944 KB
03_random13.txt AC 519 ms 19180 KB
03_random14.txt WA 184 ms 12908 KB
03_random15.txt WA 105 ms 8564 KB
04_i.txt TLE 4050 ms 21864 KB
04_p1.txt TLE 4041 ms 14004 KB
04_p2.txt TLE 4043 ms 13328 KB
04_random01.txt TLE 4040 ms 13744 KB
04_random02.txt TLE 4037 ms 9152 KB
04_random03.txt TLE 4037 ms 13156 KB
04_random04.txt TLE 4043 ms 20584 KB
04_random05.txt TLE 4048 ms 20036 KB
04_random06.txt TLE 4041 ms 13324 KB
04_random07.txt TLE 4047 ms 21176 KB
04_random08.txt TLE 4046 ms 20496 KB
04_random09.txt TLE 4049 ms 21096 KB
04_random10.txt TLE 4036 ms 9580 KB
04_random11.txt TLE 4048 ms 21860 KB
04_random12.txt TLE 4047 ms 21924 KB
04_random13.txt TLE 4049 ms 21872 KB
04_rp01.txt TLE 4043 ms 14004 KB
04_rp02.txt TLE 4044 ms 14004 KB
04_rp03.txt TLE 4042 ms 14008 KB
04_rp04.txt TLE 4041 ms 14024 KB
04_rp05.txt TLE 4041 ms 14008 KB
04_rp06.txt TLE 4041 ms 13984 KB
04_rp07.txt TLE 4042 ms 14004 KB
04_rp08.txt TLE 4040 ms 13980 KB
04_rp09.txt TLE 4040 ms 14008 KB
04_rp10.txt TLE 4040 ms 14008 KB
sample_1.txt AC 55 ms 4188 KB
sample_2.txt AC 54 ms 4208 KB
sample_3.txt AC 52 ms 4208 KB