Submission #34192


Source Code Expand

Copy
  inp=STDIN.readlines
inp=inp.map(&:to_i)
box=inp[1,inp[0]]
bl=box.size
def d(boxs,remain,bl)
  if remain.size==0 
    if boxs.flatten.size==bl
      return 100
    end
  return p(boxs).size
  end

  ret=100
  t=remain.shift()
  boxs.each_with_index{|n,i|
    if n[-1]>=t
      boxs[i]<<t
      c=d(boxs,remain,bl)
      ret=c if ret>c
      boxs[i].pop()
    end
  }
      boxs<<[t]
      c=d(boxs,remain,bl)
      ret=c if ret>c
      boxs.pop()
  return c
end

puts d([],box,bl)

Submission Info

Submission Time
Task A - 宝くじ
User wass80
Language Ruby (1.9.3)
Score 0
Code Size 512 Byte
Status WA
Exec Time 98 ms
Memory 4328 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 51
Set Name Test Cases
All 00_1_01.txt, 00_1_02.txt, 00_2_01.txt, 00_2_02.txt, 00_3_01.txt, 00_3_02.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 01_rand_11.txt, 01_rand_12.txt, 01_rand_13.txt, 01_rand_14.txt, 01_rand_15.txt, 01_rand_16.txt, 01_rand_17.txt, 01_rand_18.txt, 01_rand_19.txt, 01_rand_20.txt, 01_rand_21.txt, 01_rand_22.txt, 01_rand_23.txt, 01_rand_24.txt, 01_rand_25.txt, 01_rand_26.txt, 01_rand_27.txt, 01_rand_28.txt, 01_rand_29.txt, 01_rand_30.txt, 01_rand_31.txt, 01_rand_32.txt, 01_rand_33.txt, 01_rand_34.txt, 01_rand_35.txt, 01_rand_36.txt, 01_rand_37.txt, 01_rand_38.txt, 01_rand_39.txt
Case Name Status Exec Time Memory
00_1_01.txt WA 57 ms 4172 KB
00_1_02.txt WA 56 ms 4212 KB
00_2_01.txt WA 56 ms 4216 KB
00_2_02.txt WA 55 ms 4212 KB
00_3_01.txt WA 56 ms 4224 KB
00_3_02.txt WA 59 ms 4228 KB
00_sample_01.txt WA 55 ms 4212 KB
00_sample_02.txt WA 56 ms 4208 KB
00_sample_03.txt WA 53 ms 4212 KB
00_sample_04.txt WA 57 ms 4308 KB
00_sample_05.txt WA 54 ms 4216 KB
01_rand_00.txt WA 55 ms 4216 KB
01_rand_01.txt WA 57 ms 4220 KB
01_rand_02.txt WA 53 ms 4208 KB
01_rand_03.txt WA 52 ms 4212 KB
01_rand_04.txt WA 57 ms 4220 KB
01_rand_05.txt WA 54 ms 4176 KB
01_rand_06.txt WA 55 ms 4220 KB
01_rand_07.txt WA 54 ms 4216 KB
01_rand_08.txt WA 54 ms 4216 KB
01_rand_09.txt WA 55 ms 4212 KB
01_rand_10.txt WA 55 ms 4216 KB
01_rand_11.txt WA 72 ms 4220 KB
01_rand_12.txt WA 55 ms 4220 KB
01_rand_13.txt WA 98 ms 4216 KB
01_rand_14.txt WA 55 ms 4216 KB
01_rand_15.txt WA 55 ms 4216 KB
01_rand_16.txt WA 55 ms 4220 KB
01_rand_17.txt WA 55 ms 4216 KB
01_rand_18.txt WA 56 ms 4224 KB
01_rand_19.txt WA 55 ms 4216 KB
01_rand_20.txt WA 55 ms 4216 KB
01_rand_21.txt WA 54 ms 4164 KB
01_rand_22.txt WA 54 ms 4216 KB
01_rand_23.txt WA 54 ms 4224 KB
01_rand_24.txt WA 54 ms 4216 KB
01_rand_25.txt WA 55 ms 4220 KB
01_rand_26.txt WA 55 ms 4220 KB
01_rand_27.txt WA 55 ms 4220 KB
01_rand_28.txt WA 55 ms 4228 KB
01_rand_29.txt WA 55 ms 4216 KB
01_rand_30.txt WA 55 ms 4212 KB
01_rand_31.txt WA 56 ms 4228 KB
01_rand_32.txt WA 54 ms 4212 KB
01_rand_33.txt WA 67 ms 4172 KB
01_rand_34.txt WA 57 ms 4328 KB
01_rand_35.txt WA 51 ms 4208 KB
01_rand_36.txt WA 57 ms 4224 KB
01_rand_37.txt WA 54 ms 4216 KB
01_rand_38.txt WA 54 ms 4216 KB
01_rand_39.txt WA 58 ms 4224 KB