Submission #4025703


Source Code Expand

h, w = gets.split(" ").map{|n| n.to_i }
ans = h.times.map{
  gets.strip.split("")
}.reject{|row|
  row.all?{|d| d == "." }
}.transpose.reject{|col|
  col.all?{|d| d == "." }
}.transpose.each{|line|
  puts line.join
}

Submission Info

Submission Time
Task B - Grid Compression
User kumagi
Language Ruby (2.3.3)
Score 200
Code Size 227 Byte
Status AC
Exec Time 17 ms
Memory 2556 KB

Compile Error

./Main.rb:1: warning: assigned but unused variable - w
./Main.rb:2: warning: assigned but unused variable - ans

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 12
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 0_03.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
Case Name Status Exec Time Memory
0_00.txt AC 9 ms 2044 KB
0_01.txt AC 7 ms 1788 KB
0_02.txt AC 7 ms 1788 KB
0_03.txt AC 7 ms 1788 KB
1_00.txt AC 7 ms 1788 KB
1_01.txt AC 16 ms 2556 KB
1_02.txt AC 17 ms 2556 KB
1_03.txt AC 15 ms 2428 KB
1_04.txt AC 16 ms 2556 KB
1_05.txt AC 16 ms 2556 KB
1_06.txt AC 17 ms 2556 KB
1_07.txt AC 16 ms 2428 KB