Submission #171888


Source Code Expand

Copy
r, c, d = gets.chomp.split(" ").map(&:to_i)
board = []
r.times do
  board << gets.chomp.split(" ").map(&:to_i)
end


array = [[0,0]]
move = [[-1,0],[1,0],[0,1],[0,-1]]


d.times do
  n_array = []
  array.each do |cy, cx|
    move.each do |my, mx|
      y = my + cy
      next if not y.between?(0, r-1)
      x = mx + cx
      next if not x.between?(0, c-1)
      n_array << [y, x]
    end
  end
  array = n_array.uniq
end

result = 0
array.each do |y, x|
  result = [result, board[y][x]].max
end
puts result

Submission Info

Submission Time
Task B - 謎の人物X
User k242hd_akg
Language Ruby (1.9.3)
Score 0
Code Size 536 Byte
Status TLE
Exec Time 2039 ms
Memory 14472 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 0 / 60 0 / 40
Status
AC × 3
AC × 11
TLE × 7
AC × 12
TLE × 18
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
Subtask1 sample_01.txt, sample_02.txt, sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt
Subtask2 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt
Case Name Status Exec Time Memory
sample_01.txt AC 55 ms 4124 KB
sample_02.txt AC 63 ms 4268 KB
sample_03.txt AC 58 ms 4128 KB
subtask1_01.txt AC 53 ms 4132 KB
subtask1_02.txt AC 116 ms 4256 KB
subtask1_03.txt AC 88 ms 4256 KB
subtask1_04.txt AC 1986 ms 5788 KB
subtask1_05.txt AC 129 ms 4260 KB
subtask1_06.txt AC 77 ms 4256 KB
subtask1_07.txt TLE 2033 ms 5968 KB
subtask1_08.txt TLE 2033 ms 5832 KB
subtask1_09.txt AC 1253 ms 5788 KB
subtask1_10.txt TLE 2036 ms 5820 KB
subtask1_11.txt TLE 2035 ms 5976 KB
subtask1_12.txt TLE 2034 ms 5768 KB
subtask1_13.txt TLE 2032 ms 5924 KB
subtask1_14.txt AC 74 ms 4388 KB
subtask1_15.txt TLE 2033 ms 5832 KB
subtask2_01.txt AC 421 ms 4260 KB
subtask2_02.txt AC 1659 ms 4640 KB
subtask2_03.txt TLE 2038 ms 8588 KB
subtask2_04.txt TLE 2032 ms 5004 KB
subtask2_05.txt TLE 2033 ms 6084 KB
subtask2_06.txt TLE 2034 ms 7164 KB
subtask2_07.txt TLE 2038 ms 14364 KB
subtask2_08.txt AC 1783 ms 13580 KB
subtask2_09.txt TLE 2037 ms 14468 KB
subtask2_10.txt TLE 2038 ms 14336 KB
subtask2_11.txt TLE 2037 ms 14412 KB
subtask2_12.txt AC 1067 ms 13524 KB
subtask2_13.txt TLE 2039 ms 14276 KB
subtask2_14.txt TLE 2037 ms 14468 KB
subtask2_15.txt TLE 2038 ms 14472 KB