Submission #1099109


Source Code Expand

Copy
ENV[Z='RUBY_THREAD_VM_STACK_SIZE']||exec({Z=>?5*8},'ruby',$0);def f(i,c)(h=(H[i].map{|e|f e,i}.max||0)+1)>=K&&c!=1&&(h=0;$r+=1);h end;N,K,Q,*A=`dd`.split.map &:to_i;H=Hash.new{|h,k|h[k]=[]};2.upto(N){|i|H[A[i-$r=2]]<<i};f 1,1;p$r--~Q/Q

Submission Info

Submission Time
Task D - Teleporter
User leafmoon
Language Ruby (2.3.3)
Score 800
Code Size 235 Byte
Status
Exec Time 635 ms
Memory 225300 KB

Compile Error

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

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_00.txt, 0_01.txt, 0_02.txt
All 800 / 800 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt, 1_24.txt, 1_25.txt, 1_26.txt, 1_27.txt, 1_28.txt, 1_29.txt, 1_30.txt, 1_31.txt, 1_32.txt, 1_33.txt, 1_34.txt, 1_35.txt, 1_36.txt, 1_37.txt, 1_38.txt, 1_39.txt, 1_40.txt, 1_41.txt, 1_42.txt, 1_43.txt, 1_44.txt, 1_45.txt, 1_46.txt, 1_47.txt, 1_48.txt, 1_49.txt, 1_50.txt, 1_51.txt, 1_52.txt, 1_53.txt, 1_54.txt
Case Name Status Exec Time Memory
0_00.txt 51 ms 4300 KB
0_01.txt 52 ms 4300 KB
0_02.txt 53 ms 4308 KB
1_00.txt 51 ms 4304 KB
1_01.txt 51 ms 4300 KB
1_02.txt 633 ms 225292 KB
1_03.txt 635 ms 225300 KB
1_04.txt 633 ms 225300 KB
1_05.txt 627 ms 225240 KB
1_06.txt 627 ms 225296 KB
1_07.txt 626 ms 225292 KB
1_08.txt 622 ms 225252 KB
1_09.txt 626 ms 225236 KB
1_10.txt 415 ms 123476 KB
1_11.txt 416 ms 123532 KB
1_12.txt 491 ms 126364 KB
1_13.txt 234 ms 22608 KB
1_14.txt 239 ms 25520 KB
1_15.txt 235 ms 22556 KB
1_16.txt 222 ms 24728 KB
1_17.txt 219 ms 24684 KB
1_18.txt 218 ms 24736 KB
1_19.txt 203 ms 19924 KB
1_20.txt 199 ms 19904 KB
1_21.txt 198 ms 19848 KB
1_22.txt 244 ms 23720 KB
1_23.txt 244 ms 24100 KB
1_24.txt 242 ms 24104 KB
1_25.txt 232 ms 22952 KB
1_26.txt 225 ms 20892 KB
1_27.txt 232 ms 23528 KB
1_28.txt 224 ms 19596 KB
1_29.txt 220 ms 19548 KB
1_30.txt 219 ms 19616 KB
1_31.txt 233 ms 22100 KB
1_32.txt 236 ms 24104 KB
1_33.txt 243 ms 25324 KB
1_34.txt 247 ms 25124 KB
1_35.txt 236 ms 22420 KB
1_36.txt 233 ms 22420 KB
1_37.txt 232 ms 22488 KB
1_38.txt 240 ms 25372 KB
1_39.txt 238 ms 23768 KB
1_40.txt 236 ms 23644 KB
1_41.txt 235 ms 23652 KB
1_42.txt 235 ms 23704 KB
1_43.txt 264 ms 32472 KB
1_44.txt 280 ms 35372 KB
1_45.txt 261 ms 32592 KB
1_46.txt 261 ms 32336 KB
1_47.txt 383 ms 78176 KB
1_48.txt 384 ms 78424 KB
1_49.txt 384 ms 78996 KB
1_50.txt 391 ms 78476 KB
1_51.txt 604 ms 194976 KB
1_52.txt 610 ms 194832 KB
1_53.txt 599 ms 195092 KB
1_54.txt 600 ms 195480 KB