Submission #3246103


Source Code Expand

R=[];n,*a=`dd`.split.map &:to_i;n.times{R<<1;(1...n).map{|i|a[i-1]>a[i]&&(R<<n-1;a[i-1],a[i]=a[i],a[i-1]);R<<1}};p R.size,*R

Submission Info

Submission Time
Task B - Many Swaps Sorting
User leafmoon
Language Ruby (2.3.3)
Score 900
Code Size 124 Byte
Status AC
Exec Time 43 ms
Memory 3844 KB

Compile Error

./Main.rb:1: warning: `&' interpreted as argument prefix

Judge Result

Set Name Sample Subtask1 Subtask2 All
Score / Max Score 0 / 0 300 / 300 400 / 400 200 / 200
Status
AC × 2
AC × 7
AC × 13
AC × 22
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
Subtask1 00_example_01.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt
Subtask2 00_example_01.txt, 00_example_02.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt, s2_07.txt, s2_08.txt, s2_09.txt, s2_10.txt, s2_11.txt
All 00_example_01.txt, 00_example_02.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt, s2_07.txt, s2_08.txt, s2_09.txt, s2_10.txt, s2_11.txt, s3_12.txt, s3_13.txt, s3_14.txt, s3_15.txt, s3_16.txt, s3_17.txt, s3_18.txt, s3_19.txt, s3_20.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 7 ms 2044 KB
00_example_02.txt AC 8 ms 2044 KB
s1_01.txt AC 8 ms 2044 KB
s1_02.txt AC 8 ms 2044 KB
s1_03.txt AC 8 ms 2044 KB
s1_04.txt AC 8 ms 2044 KB
s1_05.txt AC 8 ms 2044 KB
s1_06.txt AC 8 ms 2044 KB
s2_07.txt AC 8 ms 2044 KB
s2_08.txt AC 8 ms 2044 KB
s2_09.txt AC 8 ms 2044 KB
s2_10.txt AC 9 ms 2044 KB
s2_11.txt AC 9 ms 2044 KB
s3_12.txt AC 15 ms 2304 KB
s3_13.txt AC 22 ms 2812 KB
s3_14.txt AC 12 ms 2176 KB
s3_15.txt AC 12 ms 2052 KB
s3_16.txt AC 43 ms 3836 KB
s3_17.txt AC 37 ms 3204 KB
s3_18.txt AC 37 ms 3200 KB
s3_19.txt AC 43 ms 3844 KB
s3_20.txt AC 30 ms 3072 KB