problem_id
stringlengths 6
6
| user_id
stringlengths 10
10
| time_limit
float64 1k
8k
| memory_limit
float64 262k
1.05M
| problem_description
stringlengths 48
1.55k
| codes
stringlengths 35
98.9k
| status
stringlengths 28
1.7k
| submission_ids
stringlengths 28
1.41k
| memories
stringlengths 13
808
| cpu_times
stringlengths 11
610
| code_sizes
stringlengths 7
505
|
---|---|---|---|---|---|---|---|---|---|---|
p03272 | u887207211 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['a, b = map(int, input().split())\nprint(a - b - 1)', 'a, b = map(int, input().split())\nprint(a - b + 1)\n'] | ['Wrong Answer', 'Accepted'] | ['s722207504', 's472240176'] | [2940.0, 2940.0] | [17.0, 17.0] | [49, 50] |
p03272 | u888512581 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['N, i = map(int, input().split())\nprint(N - i +\u30001)', 'N, i = map(int, input().split())\nprint(N - i + 1)'] | ['Runtime Error', 'Accepted'] | ['s756840556', 's376203642'] | [3188.0, 2940.0] | [20.0, 17.0] | [51, 49] |
p03272 | u894694822 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['a, b=map(int, input().split())\nprint(a+b-1)', 'a, b=map(int, input().split())\nprint(a-b+1)'] | ['Wrong Answer', 'Accepted'] | ['s737721580', 's600528077'] | [2940.0, 2940.0] | [17.0, 17.0] | [43, 43] |
p03272 | u895515293 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['i,j=map(int, input())\nprint(i-j+1)', 'i,j=map(int, input().split())\nprint(i-j+1)'] | ['Runtime Error', 'Accepted'] | ['s576279866', 's335095439'] | [2940.0, 2940.0] | [17.0, 17.0] | [34, 42] |
p03272 | u898967808 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['n,i = (map,int(input()))\nprint(n-i+1)\n', 'n,i = map(int,input().split())\nprint(n-i+1)'] | ['Runtime Error', 'Accepted'] | ['s463711459', 's829634205'] | [3316.0, 2940.0] | [19.0, 17.0] | [38, 43] |
p03272 | u905715926 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['a,b = map(int,input().split())\nprint(b-a+1)', 'a,b = map(int,input().split())\nprint(a-b+1)\n'] | ['Wrong Answer', 'Accepted'] | ['s005456201', 's263990823'] | [2940.0, 2940.0] | [17.0, 21.0] | [43, 44] |
p03272 | u921773161 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['s = input()\ns_list = list(s)\nprint(s_list)\nl = len(s_list) - 2\na = s_list[0] + str(l) + s_list[-1]\nprint(a)\n', 'd = list(map(int, input().split()))\nN = d[0]\ni = d[1]\nprint(N-i+1)'] | ['Wrong Answer', 'Accepted'] | ['s063320784', 's832748107'] | [2940.0, 2940.0] | [17.0, 19.0] | [108, 66] |
p03272 | u923077302 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['def main():\n N = int(input())\n i = int(input())\n output = solve(N, i)\n print(output)\n return\n\n#________________________________________\n# Solve\n#________________________________________\ndef solve(N, i):\n \n return N - i + 1\n#________________________________________\n\n\nif __name__ == "__main__":\n main()', 'def main():\n N, i = list(map(int, input().split(" ")))\n output = solve(N, i)\n print(output)\n return\n\n#________________________________________\n# Solve\n#________________________________________\ndef solve(N, i):\n \n return N - i + 1\n#________________________________________\n\n\nif __name__ == "__main__":\n main()'] | ['Runtime Error', 'Accepted'] | ['s939453557', 's156753960'] | [2940.0, 2940.0] | [18.0, 17.0] | [360, 364] |
p03272 | u933129390 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['n, k = map(int, input().split())\nif n%k:\n print(1)\nelse:\n print(0)\n', 'n, i = map(int, input().split())\nprint(n-i+1)\n'] | ['Wrong Answer', 'Accepted'] | ['s891663294', 's006998844'] | [2940.0, 2940.0] | [17.0, 20.0] | [73, 46] |
p03272 | u933622697 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['# WIP (WA: 1_01.txt, 1_06.txt, 1_07.txt)\nimport sys\ninput_s = sys.stdin.readline\n\nN, K = map(int, input_s().split())\nxxx = list(map(int, input_s().split()))\n\nmin_elapsed_time = float("inf")\nfor left, right in zip(xxx, xxx[K - 1:]):\n elapsed_time = right - left + min(abs(left), abs(right))\n """\n right - left : a section distance\n min(abs(left), abs(right)) : a start point to move the section\n """\n min_elapsed_time = \\\n elapsed_time if elapsed_time < min_elapsed_time else min_elapsed_time\n\nprint(min_elapsed_time)\n', 'n, i = map(int, input().split())\nprint(n-i+1)'] | ['Wrong Answer', 'Accepted'] | ['s937938403', 's430223602'] | [3064.0, 2940.0] | [17.0, 17.0] | [543, 45] |
p03272 | u946969297 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['a,b = map(int,input().split())\nreturn a - b + 1', 'a,b = map(int,input().split())\nprint(a-b+1)'] | ['Runtime Error', 'Accepted'] | ['s413864179', 's394009930'] | [9016.0, 9148.0] | [27.0, 29.0] | [47, 43] |
p03272 | u950376354 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['N,i = map(int,input(),split())\n\nprint(N-i+1)', 'N,i = map(int,input().split())\n\nprint(N-i+1)'] | ['Runtime Error', 'Accepted'] | ['s677822134', 's593976849'] | [2940.0, 2940.0] | [17.0, 18.0] | [44, 44] |
p03272 | u956547804 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['n,i=map(int,input(),split())\nprint(n-i+1)', 'n,i=map(int,input().split())\nprint(n-i+1)'] | ['Runtime Error', 'Accepted'] | ['s446623022', 's481941922'] | [2940.0, 2940.0] | [17.0, 17.0] | [41, 41] |
p03272 | u962718741 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['print(1 - eval(input().replace(" ", "-")))', 'print(1 + eval(input().replace(" ", "-")))'] | ['Wrong Answer', 'Accepted'] | ['s200265914', 's948347034'] | [9020.0, 9052.0] | [26.0, 25.0] | [42, 42] |
p03272 | u967835038 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['n,i=map(int、input().split())\nprint(n-i+1)\n', 'n,i=map(int,input().split())\nprint(n-i+1)'] | ['Runtime Error', 'Accepted'] | ['s453276342', 's771069876'] | [2940.0, 2940.0] | [17.0, 17.0] | [44, 41] |
p03272 | u970197315 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['# ABC107 A - Train \nn,i = map(int,input().split())\nprint(n-1+1)', '# ABC107 A - Train \nn,i = map(int,input().split())\nprint(n-i+1)'] | ['Wrong Answer', 'Accepted'] | ['s377640094', 's750796088'] | [2940.0, 2940.0] | [17.0, 18.0] | [63, 63] |
p03272 | u972892985 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['n i = map(int,input().split())\nprint(n - i + 1)', 'n i = map(int,input().split())\nprint((n - i) + 1)\n', 'n, i = map(int,input().split())\nprint((n - i) + 1)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s010413257', 's401186692', 's752470968'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [47, 50, 51] |
p03272 | u975481854 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['h, w = map(int, input().split())\na = [input() for w in range(h)]\n\nfor i in range(h)[::-1]:\n if "#" not in a[i]:\n del a[i]\n h -= 1\n\nn = []\nfor j in range(w):\n m = ["".join(t[j] for t in a)]\n if "#" in m[0]:\n n += m\n\nfor k in range(h):\n print("".join(u[k] for u in n))\n', 'n,i = input().split()\nprint(int(n)-int(i)+1)\n'] | ['Runtime Error', 'Accepted'] | ['s674715615', 's243523122'] | [3064.0, 2940.0] | [18.0, 17.0] | [300, 45] |
p03272 | u977642052 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ["\n\n\ndef main(n, i):\n print(n - i + 1)\n\n\nif __name__ == '__main__':\n main(map(int, input().split(' ')))\n", "\n\n\ndef main(n, i):\n print(n - i + 1)\n\n\nif __name__ == '__main__':\n n, i = map(int, input().split(' '))\n main(n, i)\n"] | ['Runtime Error', 'Accepted'] | ['s902876921', 's001077602'] | [2940.0, 2940.0] | [17.0, 17.0] | [227, 243] |
p03272 | u978313283 | 2,000 | 1,048,576 | There is an N-car train. You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back." | ['N=int(input())\nA=list(map(int,input().split()))\nmedian_len=N*(N+1)//2\nmedian=median_len//2+1\na=1\nmedin_rank=1\nfor i in range(1,N):\n a=i*(i+1)//2\n b=(i+2)*(i+1)//2\n if a<=median and b>median:\n medin_rank=i\n break\nrank_index=median-a\nmedian_list=[]\nl=medin_rank//2\nfor i in range(N-medin_rank):\n median_list.append(A[l+i])\nprint(median_list[rank_index])\n', 'N,i=map(int,input().split())\nprint(N-i+1)'] | ['Runtime Error', 'Accepted'] | ['s933826275', 's531337832'] | [3064.0, 2940.0] | [17.0, 18.0] | [378, 41] |
p03273 | u001024152 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h, w = map(int, input().split())\n\nnewGrid = []\nfor i in range(h):\n a = list(input())\n for j,a_j in enumerate(a):\n if a_j == "#":\n newGrid.append(a)\n break\n else:\n continue\n\nans = []\nfor j in range(w):\n for i in range(len(newGrid)):\n if newGrid[i][j] == "#":\n ans.append([newGrid[k][j] for k in range(len(newGrid))])\n break\n else:\n continue\n \nprint(ans)', 'h, w = map(int, input().split())\n\nnewGrid = []\nfor i in range(h):\n a = list(input())\n for j,a_j in enumerate(a):\n if a_j == "#":\n newGrid.append(a)\n break\n else:\n continue\n\nans = []\nfor j in range(w):\n for i in range(len(newGrid)):\n if newGrid[i][j] == "#":\n ans.append([newGrid[k][j] for k in range(len(newGrid))])\n break\n else:\n continue\n \nfor ansi in ans:\n print("".join(ansi))', 'h, w = map(int, input().split())\n\nnewGrid = []\nfor i in range(h):\n a = list(input())\n for j,a_j in enumerate(a):\n if a_j == "#":\n newGrid.append(a)\n break\n else:\n continue\n\nans = []\nfor j in range(w):\n for i in range(len(newGrid)):\n if newGrid[i][j] == "#":\n ans.append([newGrid[k][j] for k in range(len(newGrid))])\n break\n else:\n continue\n \nfor ansi in list(zip(*ans)):\n print("".join(ansi))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s670111154', 's799505894', 's487544783'] | [3316.0, 3188.0, 3316.0] | [20.0, 19.0, 19.0] | [466, 497, 509] |
p03273 | u007263493 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h , w = map(int,input().split())\na = [''] * h \nfor i in range(n):\n a[i] = input()\n\nrow = [False]*h\ncol = [False]*w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j] =='#':\n row[i] = True\n col[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j],end='')\n print()", "h , w = map(int,input().split())\na = [''] * h \nfor i in range(h):\n a[i] = input()\n\nrow = [False]*h\ncol = [False]*w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j] =='#':\n row[i] = True\n col[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j],end='')\n print()\n"] | ['Runtime Error', 'Accepted'] | ['s408436379', 's465366203'] | [3064.0, 4468.0] | [18.0, 31.0] | [379, 380] |
p03273 | u010110540 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h, w = map(int, input().split())\n\na = [''] * h\n\nfor i in range(h):\n a[i] = input()\n \nrow = [False] * h\ncol = [False] * w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j] == '#':\n row[i] = True\n col[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j])\n print()", "h, w = map(int, input().split())\n \na = [''] * h\n \nfor i in range(h):\n a[i] = input()\n \nrow = [False] * h\ncol = [False] * w\n \nfor i in range(h):\n for j in range(w):\n if a[i][j] == '#':\n row[i] = True\n col[j] = True\n \nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j], end='')\n print()"] | ['Wrong Answer', 'Accepted'] | ['s586566325', 's811553274'] | [3700.0, 4468.0] | [26.0, 31.0] | [380, 392] |
p03273 | u013408661 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w=map(int,input().split())\ngrid=[]\nfor i in range(h):\n grid.append(list(map(int,input().split())))\nfor i in range(grid):\n if grid[i].count('.')==len(grid[i]):\n grid.pop(i)\nfor j in range(grid[0]):\n for i in range(len(grid)):\n if grid[i][j]!='#':\n break\n for i in range(len(grid)):\n grid[i].pop(j)\nfor i in grid:\n print(' '.join(map(str,i)))", 'h,w=map(int,input().split())\ngrid=[]\ngrid2=[]\ngrid3=[]\nfor i in range(h):\n grid.append(list(input().replace(" ","")))\nfor i in range(len(grid)):\n if grid[i].count(\'.\')==len(grid[i]):\n pass\n else:\n grid2.append(grid[i])\nfor i in grid2:\n grid3.append([])\nfor j in range(len(grid2[0])):\n for i in range(len(grid2)):\n if grid2[i][j]==\'#\':\n for k in range(len(grid3)):\n grid3[k].append(grid2[k][j])\n break\nfor i in grid3:\n print(\'\'.join(i))'] | ['Runtime Error', 'Accepted'] | ['s179609888', 's943389749'] | [3064.0, 3188.0] | [18.0, 21.0] | [361, 467] |
p03273 | u013756322 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h, w = map(int, input().split())\nA = [None] * h\nfor i in range(h):\n A[i] = list(input())\n\nwhile ('.' * w in A):\n A.remove('.' * w)\n\nB = [''.join(col) for col in zip(*A)]\n\nwhile ('.' * len(A) in B):\n B.remove('.' * len(A))\n\nA = [''.join(col) for col in zip(*B)]\n\nfor a in A:\n print(''.join(a))\n", "h, w = map(int, input().split())\nA = [None] * h\nfor i in range(h):\n A[i] = input()\n\nwhile ('.' * w in A):\n A.remove('.' * w)\n\nB = [''.join(col) for col in zip(*A)]\n\nwhile ('.' * len(A) in B):\n B.remove('.' * len(A))\n\n\nA = [''.join(col) for col in zip(*B)]\n\nfor a in A:\n print(''.join(a))\n"] | ['Wrong Answer', 'Accepted'] | ['s362538841', 's556780839'] | [3060.0, 3064.0] | [19.0, 19.0] | [297, 292] |
p03273 | u017415492 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['import numpy as np\nh,w=map(int,input().split())\na=np.array([ list(input()) for i in range(h)])\ncount=0\nd_w=[]\nd_h=[]\nfor i in range(0,h):\n count=0\n for j in range(0,w):\n if a[i][j]==".":\n count+=1\n if count==w:\n d_w.append(i)\nfor i in range(0,w):\n count=0\n for j in range(0,h):\n if a[j][i]==".":\n count+=1\n if count==h:\n d_h.append(i)\na=np.delete(a,d_w,0)\na=np.delete(a,d_h,1)\nfor i in a:\n print(*i)', 'import numpy as np\nh,w=map(int,input().split())\na=np.array([ list(input()) for i in range(h)])\ncount=0\nd_w=[]\nd_h=[]\nfor i in range(0,h):\n count=0\n for j in range(0,w):\n if a[i][j]==".":\n count+=1\n if count==w:\n d_w.append(i)\nfor i in range(0,w):\n count=0\n for j in range(0,h):\n if a[j][i]==".":\n count+=1\n if count==h:\n d_h.append(i)\na=np.delete(a,d_w,0)\na=np.delete(a,d_h,1)\nfor i in a:\n print(*i)', 'import numpy as np\nh,w=map(int,input().split())\na=np.array([ list(input()) for i in range(h)])\ncount=0\nd_w=[]\nd_h=[]\nfor i in range(0,h):\n count=0\n for j in range(0,w):\n if a[i][j]==".":\n count+=1\n if count==w:\n d_w.append(i)\nfor i in range(0,w):\n count=0\n for j in range(0,h):\n if a[j][i]==".":\n count+=1\n if count==h:\n d_h.append(i)\na=np.delete(a,d_w,0)\na=np.delete(a,d_h,1)\nfor i in a:\n print("".join(i))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s151397328', 's843931920', 's159158290'] | [13056.0, 13136.0, 12528.0] | [165.0, 168.0, 164.0] | [428, 428, 436] |
p03273 | u026155812 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H, W = map(int, input().split())\na = []\nfor i in range(H):\n s = input()\n if s != '.'*W:\n a.append(s)\nls = []\nfor i in range(W):\n b = ''\n for j in range(len(a)):\n b += a[j][i]\n if b == '.'*len(a):\n ls.append(i)\nans = []\nfor i in range(W):\n s = ''\n for j in range(len(a)):\n if i in ls:\n continu\n else:\n s += a[j][i]\n ans.append(s)\nprint(*ans, sep='\\n')", "H, W = map(int, input().split())\na = []\nfor i in range(H):\n s = input()\n if s != '.'*W:\n a.append(s)\nls = []\nfor i in range(W):\n b = ''\n for j in range(len(a)):\n b += a[j][i]\n if b == '.'*len(a):\n ls.append(i)\nans = []\nfor i in range(W):\n s = ''\n for j in range(len(a)):\n if i in ls:\n continue\n else:\n s += a[j][i]\n ans.append(s)\nprint(*ans, sep='\\n')", "vH, W = map(int, input().split())\na = []\nfor i in range(H):\n s = input()\n if s != '.'*W:\n a.append(s)\nls = []\nfor i in range(W):\n b = ''\n for j in range(len(a)):\n b += a[j][i]\n if b == '.'*len(a):\n ls.append(i)\nans = []\nfor i in range(W):\n s = ''\n for j in range(len(a)):\n if i in ls:\n continue\n else:\n s += a[j][i]\n ans.append(s)\nprint(*ans, sep='\\n')", "H, W = map(int, input().split())\na = []\nfor i in range(H):\n s = input()\n if s != '.'*W:\n a.append(s)\nls = []\nfor i in range(W):\n cur = 0\n for j in range(len(a)):\n if a[j][i] == '.':\n cur += 1\n if cur == len(a):\n ls.append(i)\nans = a\nfor i in ls:\n for s in a:\n ans.append(s[:i] + s[i+1:])\nprint(*ans, sep='\\n')", "H, W = map(int, input().split())\na = []\nfor i in range(H):\n s = input()\n if s != '.'*W:\n a.append(input())\nls = []\nfor i in range(W):\n cur = 0\n for j in range(len(a)):\n if a[j][i] == '.':\n cur += 1\n if cur == len(a):\n ls.append(i)\nans = []\nfor i in ls:\n for s in a:\n ans.append(s[:i] + s[i+1:])\nprint(*ans, sep='\\n')", "H, W = map(int, input().split())\na = []\nfor i in range(H):\n s = input()\n if s != '.'*W:\n a.append(s)\nls = []\nfor i in range(W):\n b = ''\n for j in range(len(a)):\n b += a[j][i]\n if b == '.'*len(a):\n ls.append(i)\nans = []\nfor i in range(len(a)):\n s = ''\n for j in range(W):\n if j in ls:\n continue\n else:\n s += a[i][j]\n ans.append(s)\nprint(*ans, sep='\\n')"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Accepted'] | ['s136415172', 's730866041', 's741332823', 's921595543', 's957276121', 's966704207'] | [3064.0, 3064.0, 3064.0, 79896.0, 3064.0, 3064.0] | [22.0, 22.0, 17.0, 2108.0, 17.0, 22.0] | [431, 432, 435, 366, 373, 432] |
p03273 | u038027079 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w = map(int, input().split())\na = [''] * h\nprint(a)\nfor i in range(h):\n a[i] = input()\n\nrow = [False] * h\ncol = [False] * w\nfor i in range(h):\n for j in range(w):\n if a[i][j] == '#':\n row[i] = True\n col[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j], end = '')\n print()", "h,w = map(int, input().split())\na = [''] * h\nfor i in range(h):\n a[i] = input()\n\nrow = [False] * h\ncol = [False] * w\nfor i in range(h):\n for j in range(w):\n if a[i][j] == '#':\n row[i] = True\n col[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j], end = '')\n print()"] | ['Wrong Answer', 'Accepted'] | ['s829080543', 's493729271'] | [4468.0, 4468.0] | [30.0, 30.0] | [391, 382] |
p03273 | u039189422 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w=map(int,input().split())\na=[list(input().split()) for _ in range(h)]\n\n\nfor i in range(w):\n\ttmp=0\n\tfor j in range(h):\n\t\tif a[j][i]=="#":\n\t\t\ttmp=1\n\tif tmp==0:\n\t\tfor j in range(h):\n\t\t\ta[j][i]="0"\n\n\nfor i in range(h):\n\tif not "#" in a[i][:]:\n\t\ta[i][:]=[0]*w\n\nfor i in range(h):\n\ttmpl=[]\n\tfor j in range(w):\n\t\tif not a[i][j]=="0":\n\t\t\ttmpl.append(a[i][j])\n\tif "#" in tmpl or "." in tmpl:\n\t\tprint(" ".join(tmpl))\t\t', 'h,w=map(int,input().split())\na=[list(input().split()) for _ in range(h)]\n\n\nfor i in range(w):\n\ttmp=0\n\tfor j in range(h):\n\t\tif a[j][i]=="#":\n\t\t\ttmp=1\n\tif tmp==0:\n\t\tfor j in range(h):\n\t\t\ta[j][i]="0"\n\n\nfor i in range(h):\n\tif not "#" in a[i][:]:\n\t\ta[i][:]=[0]*w\n\nfor i in range(h):\n\ttmpl=[]\n\tfor j in range(w):\n\t\tif not a[i][j]=="0":\n\t\t\ttmpl.append(a[i][j])\n\tif "#" in tmpl or "." in tmpl:\n\t\tprint(" ".join(tmpl))', 'h,w=map(int,input().split())\na=[list(input().split()) for _ in range(h)]\n\n\nfor i in range(w):\n\ttmp=0\n\tfor j in range(h):\n\t\tif a[j][i]=="#":\n\t\t\ttmp=1\n\tif tmp==0:\n\t\tfor j in range(h):\n\t\t\ta[j][i]="0"\n\n\nfor i in range(h):\n\tif not "#" in a[i][:]:\n\t\ta[i][:]=[0]*w\n\nfor i in range(h):\n\ttmpl=[]\n\tfor j in range(w):\n\t\tif not a[i][j]=="0":\n\t\t\ttmpl.append(a[i][j])\n\tif "#" in tmpl or "." in tmpl:\n\t\tprint("".join(tmpl))\t\t', 'h,w=map(int,input().split())\na=[]\nfor _ in range(h):\n\tb=[]\n\ts=input()\n\tfor i in range(w):\n\t\tb.append(s[i])\n\ta.append(b)\n\t\n\nfor i in range(w):\n\ttmp=0\n\tfor j in range(h):\n\t\tif a[j][i]=="#":\n\t\t\ttmp=1\n\tif tmp==0:\n\t\tfor j in range(h):\n\t\t\ta[j][i]="0"\n\n\nfor i in range(h):\n\tif not "#" in a[i][:]:\n\t\ta[i][:]=[0]*w\n\nfor i in range(h):\n\ttmpl=[]\n\tfor j in range(w):\n\t\tif not a[i][j]=="0":\n\t\t\ttmpl.append(a[i][j])\n\tif "#" in tmpl or "." in tmpl:\n\t\tprint("".join(tmpl))\t\t'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s294626577', 's648028464', 's844294583', 's381375566'] | [3064.0, 3064.0, 3064.0, 3192.0] | [18.0, 18.0, 18.0, 25.0] | [455, 453, 477, 525] |
p03273 | u059262067 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['import numpy as np\n\na1, a2 = map(int, input().split())\nmx = [[list(i) for i in input().split()] for i in range(a1)]\nmx = np.reshape(mx,-1)\nmx = [0 if i == \'.\' else 1 for i in mx]\nmx = np.reshape(mx,[a1,a2])\n\nw = min(np.append(sum(mx,1),sum(mx,0)))\n\nwhile w == 0:\n mx = mx[np.sum(mx,1) > 0]\n mx = mx.T[np.sum(mx.T,1) > 0].T\n w = min(np.append(sum(mx,1),sum(mx,0)))\n\nres = np.where(mx == 0 ,".","#")\n\nprint(res)', 'import numpy as np\n\na1, a2 = map(int, input().split())\nmx = [[list(i) for i in input().split()] for i in range(a1)]\nmx = np.reshape(mx,-1)\nmx = [0 if i == \'.\' else 1 for i in mx]\nmx = np.reshape(mx,[a1,a2])\n\nw = min(np.append(sum(mx,1),sum(mx,0)))\n\nwhile w == 0:\n mx = mx[np.sum(mx,1) > 0]\n mx = mx.T[np.sum(mx.T,1) > 0].T\n w = min(np.append(sum(mx,1),sum(mx,0)))\n\nres = np.where(mx == 0 ,".","#")\n\nfor x in zip(*res):\n print(\'\'.join(x))', 'import numpy as np\n\na1, a2 = map(int, input().split())\nmx = [[list(i) for i in input().split()] for i in range(a1)]\nmx = np.reshape(mx,-1)\nmx = [0 if i == \'.\' else 1 for i in mx]\nmx = np.reshape(mx,[a1,a2])\n\nw = min(np.append(sum(mx,1),sum(mx,0)))\n\nwhile w == 0:\n mx = mx[np.sum(mx,1) > 0]\n mx = mx.T[np.sum(mx.T,1) > 0].T\n w = min(np.append(sum(mx,1),sum(mx,0)))\n\nres = np.where(mx == 0 ,".","#")\n\nfor x in res:\n print(\'\'.join(x))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s267398998', 's837156902', 's367301859'] | [12672.0, 12700.0, 12692.0] | [163.0, 158.0, 162.0] | [418, 449, 443] |
p03273 | u064408584 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w=map(int, input().split())\ns = [list(input()) for i in range(h)]\nfor i in s:print(i)\ns=[i for i in s if '#' in i]\ncount=0\nwhile count<len(s[0]):\n check=0\n for i in s:\n if i[count]=='#':\n check=1\n if check==0:\n for i in s:\n i.pop(count)\n else:count+=1\nfor i in s:print(''.join(i))", "h,w=map(int, input().split())\ns = [list(input()) for i in range(h)]\ns=[i for i in s if '#' in i]\ncount=0\nwhile count<len(s[0]):\n check=0\n for i in s:\n if i[count]=='#':\n check=1\n if check==0:\n for i in s:\n i.pop(count)\n else:count+=1\nfor i in s:print(''.join(i))"] | ['Wrong Answer', 'Accepted'] | ['s161197290', 's033343256'] | [3188.0, 3064.0] | [22.0, 18.0] | [330, 310] |
p03273 | u064434060 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w=map(int,input().split())\na=[input() for _ in range(h)]\n\nres=[]\nfor i in range(h):\n if "#" not in a[i]:\n res.append(i)\nfor i in res:\n a.pop(i)\nres=[]\nh=len(a)\nfor i in range(w):\n for j in range(len(a)):\n if a[j][i]=="#":\n break\n else:\n res.append(j)\nfor i in res:\n for j in range(len(a)):\n a[j]=a[j][:i]+a[j][i+1:]\nfor i in a:\n print(*i)', 'h,w=map(int,input().split())\na=[input() for _ in range(h)]\nres=[]\nfor i in range(h):\n if "#" not in a[i]:\n res.append(i)\n\nresh=[]\nh=len(a)\nfor i in range(w):\n for j in range(len(a)):\n if a[j][i]=="#":\n break\n else:\n resh.append(i)\nfor i in range(h):\n for j in range(w):\n if i not in res and j not in resh:\n print(a[i][j],end="")\n if i not in res:\n print("")'] | ['Runtime Error', 'Accepted'] | ['s930497085', 's080294976'] | [3700.0, 4468.0] | [23.0, 29.0] | [377, 401] |
p03273 | u066551652 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h, w = map(int,input().split())\n\nA = [list(input()) for _ in range(h)]\n\nrow = [False] * h\ncol = [False] * w\n\nfor i in range(h):\n for j in range(w):\n if A[i][j] == '#':\n row[i] = True\n col[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(A[i][j], end = '')", "h, w = map(int, input().split())\na = [''] * h\nfor i in range(h):\n\ta[i] = input()\n\nrow = [False] * h\ncol = [False] * w\nfor i in range(h):\n\tfor j in range(w):\n\t\tif a[i][j] == '#':\n\t\t\trow[i] = True\n\t\t\tcol[j] = True\n\nfor i in range(h):\n\tif row[i]:\n\t\tfor j in range(w):\n\t\t\tif col[j]:\n\t\t\t\tprint(a[i][j], end = '')\n\t\tprint()\n"] | ['Wrong Answer', 'Accepted'] | ['s578917917', 's778158126'] | [9324.0, 9304.0] | [33.0, 33.0] | [355, 318] |
p03273 | u076512055 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["def transpose(A):\n B = []\n for j in range(len(A[0])):\n C = [A[i][j] for i in range(len(A))]\n B.append(C)\n return B\n\nH, W = map(int, input().split())\nA = [list(input()) for _ in range(H)]\n\nfor i in reversed(range(H)):\n if A[i] == ['.']*W:\n A.pop(i)\n \nH = len(A) \nA = transpose(A)\nfor j in reversed(range(W)):\n if A[j] == ['.']*H:\n A.pop(j)\n\nA = transpose(A)\nfor i in range(len(A)):\n \tprint(*A[i])", "def transpose(A):\n B = []\n for j in range(len(A[0])):\n C = [A[i][j] for i in range(len(A))]\n B.append(C)\n return B\n\nH, W = map(int, input().split())\nA = [list(input()) for _ in range(H)]\n\nfor i in reversed(range(H)):\n if A[i] == ['.']*W:\n A.pop(i)\n \nH = len(A) \nA = transpose(A)\nfor j in reversed(range(W)):\n if A[j] == ['.']*H:\n A.pop(j)\n\nA = transpose(A)\nfor i in range(len(A)):\n \tprint(*A[i], sep='')"] | ['Wrong Answer', 'Accepted'] | ['s163026008', 's624896907'] | [3828.0, 4596.0] | [22.0, 23.0] | [452, 460] |
p03273 | u077019541 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H,W = map(int,input().split())\nahw = [strlist for strlist in [[s for s in input()] for i in range(H)] if "#" in strlist]\ntenti = []\nfor h in range(H-1):\n m = [ah for ah in ahw[h]]\n if "#" in m:\n tenti.append(m)\nfor ahwnum in range(len(ahw)):\n print("".join([num for num in tenti[ahwnum]]))', 'H,W = map(int,input().split())\nahw = [strlist for strlist in [[s for s in input()] for i in range(H)] if "#" in strlist]\ntenti = []\nfor h in range(W):\n m = [ah[h] for ah in ahw]\n if "#" in m:\n tenti.append(m)\nfor ahwnum in range(len(ahw)):\n print("".join([num[ahwnum] for num in tenti]))'] | ['Runtime Error', 'Accepted'] | ['s872911436', 's097630252'] | [3188.0, 3188.0] | [20.0, 21.0] | [303, 301] |
p03273 | u084357428 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w = map(int,input().split())\na = [list(input()) for i in range(h)]\nb = [x for x in a if '#' in x]\nc = zip(*[y for y in zip(*b) if '#' in y])\nfor d in c:\n print(d)", "h,w = map(int,input().split())\na = [list(input()) for i in range(h)]\nb = [x for x in a if '#' in x]\nc = zip(*[y for y in zip(*b) if '#' in y])\nfor d in c:\n print(''.join(d))"] | ['Wrong Answer', 'Accepted'] | ['s643683954', 's728488864'] | [3188.0, 3188.0] | [19.0, 18.0] | [167, 176] |
p03273 | u094191970 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['N = int(input())\nans = 0\nfor i in range(1,N+1,2):\n cnt = 0\n for n in range(1,N+1,2):\n if n%i == 0:\n cnt += 1\n if cnt == 8:\n ans += 1\nprint(ans)', ",w=input().split()\na=[list(input()) for i in range(int(h))]\n\nl1=[i for i in a if '#' in i]\nl2=[i for i in zip(*l1) if '#' in i]\nfor i in zip(*l2):\n print(''.join(i))", "h,w=map(int,input().split())\nfor i in zip(*[i for i in zip(*[i for i in [input() for i in range(h)] if '#' in i]) if '#' in i]):\n print(''.join(i))"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s319975514', 's436822752', 's336137244'] | [3060.0, 2940.0, 9136.0] | [17.0, 17.0, 32.0] | [177, 168, 148] |
p03273 | u095021077 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["import numpy as np\n\nH, W=map(int, input().split())\nmatrix=np.zeros((H, W))\n\nfor i in range(H):\n s=input()\n for j in range(W):\n if s[j]=='#':\n matrix[i, j]=1\n \nfor i in range(H):\n if np.sum(matrix[i, :]==0)==W:\n matrix[i, :]=-1\n \nfor i in range(W):\n if np.sum(matrix[:, i]==0)==H:\n matrix[:, i]=-1\n \ni=0\nfor i in range(H):\n if np.sum(matrix[i, :]==-1)==W:\n pass\n else:\n for j in range(W):\n if matrix[i, j]==0:\n print('.', end='')\n elif matrix[i, j]==1:\n print('#', end='')\n else:\n pass\n print('\\n', end='')", "import numpy as np\n \nH, W=map(int, input().split())\nmatrix=np.zeros((H, W))\n \nfor i in range(H):\n s=input()\n for j in range(W):\n if s[j]=='#':\n matrix[i, j]=1\n \nfor i in range(H):\n if np.sum(matrix[i, :]==0)==W:\n matrix[i, :]=-1\n \nfor i in range(W):\n if np.sum(matrix[:, i]<=0)==H:\n matrix[:, i]=-1\n \ni=0\nfor i in range(H):\n if np.sum(matrix[i, :]==-1)==W:\n pass\n else:\n for j in range(W):\n if matrix[i, j]==0:\n print('.', end='')\n elif matrix[i, j]==1:\n print('#', end='')\n else:\n pass\n print()"] | ['Wrong Answer', 'Accepted'] | ['s761807466', 's784596512'] | [13904.0, 21432.0] | [190.0, 294.0] | [581, 571] |
p03273 | u095756391 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H, W = map(int, input().split())\n\na = [input() for i in range(H)]\n\nrow = [False] * H\ncol = [False] * W\n\nfor i in range(H):\n for j in range(W):\n if a[i][j] == '#':\n row[i] = True\n col[j] = True\n\n \nfor i in range(H):\n if row[i]:\n for j in range(W):\n if col[j]:\n print(a[i][j], end='')\n ", "H, W = map(int, input().split())\n\na = [input() for i in range(H)]\n\nrow = [False] * H\ncol = [False] * W\n\nfor i in range(H):\n for j in range(W):\n if a[i][j] == '#':\n row[i] = True\n col[j] = True\n\n \nfor i in range(H):\n if row[i]:\n for j in range(W):\n if col[j]:\n print(a[i][j], end='')\n print()\n "] | ['Wrong Answer', 'Accepted'] | ['s328727745', 's297068418'] | [4468.0, 4468.0] | [30.0, 31.0] | [319, 331] |
p03273 | u098012509 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H, W = [int(x) for x in input().split()]\nA = [input().strip() for _ in range(H)]\n\nB = []\nfor i in range(H):\n if "#" in A[i]:\n B.append(A[i])\n\nans = []\nfor j in range(W):\n for i in range(len(B)):\n if "#" == B[i][j]:\n ans.append(j)\n break\n\nfor i in range(len(B)):\n for j in range(len(ans)):\n print(B[i][j], end="")\n print()\n\n\n\n\n', 'H, W = [int(x) for x in input().split()]\nA = [input().strip() for _ in range(H)]\n\nB = []\nfor i in range(H):\n if "#" in A[i]:\n B.append(A[i])\n\nans = []\nfor j in range(W):\n for i in range(len(B)):\n if "#" == B[i][j]:\n ans.append(j)\n break\n\nfor i in range(len(B)):\n for j in ans:\n print(B[i][j], end="")\n print()\n\n\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s978310952', 's485096093'] | [9172.0, 9088.0] | [31.0, 28.0] | [382, 370] |
p03273 | u103902792 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w = map(int,input().split())\nmaze = []\nfor _ in range(h):\n s = input()\n if s != '.'*w:\n maze.append(s)\nh = len(maze)\nskip = []\nfor j in range(w):\n for i in raneg(h):\n if maze[i][j] == '#':\n break\n else:\n skip.append(j)\n\nfor i in range(h):\n for j in range(w):\n if j not in skip:\n print(maze[i][j],end= '')\n print()", "h,w = map(int,input().split())\nmaze = []\nfor _ in range(h):\n s = input()\n if s != '.'*w:\n maze.append(s)\nh = len(maze)\nskip = []\nfor j in range(w):\n for i in range(h):\n if maze[i][j] == '#':\n break\n else:\n skip.append(j)\n\nfor i in range(h):\n for j in range(w):\n if j not in skip:\n print(maze[i][j],end= '')\n print()\n\n"] | ['Runtime Error', 'Accepted'] | ['s050648884', 's805158826'] | [3064.0, 4468.0] | [17.0, 29.0] | [343, 345] |
p03273 | u107269063 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['import numpy as np\n\nh, w = map(int,input().split())\ngrid = np.array([list(input()) for _ in range(h)], dtype="U1") \n\nrow = []\ncol = []\n\nfor i in range(h):\n if (grid[i] != ".").any():\n row.append(i)\n\ntrans_grid = np.transpose(grid)\n\nfor i in range(w):\n if (trans_grid != ".").any():\n col.append(i)\n\nG = grid[row][:,col] \n\nfor g in G:\n print("".join(g))', 'import numpy as np\n\nh, w = map(int,input().split())\ngrid = np.array([list(input()) for _ in range(h)], dtype="U1") \n\nrow = []\ncol = []\n\nfor i in range(h):\n if (grid[i] != ".").any():\n row.append(i)\n\ntrans_grid = np.transpose(grid)\n\nfor i in range(w):\n if (trans_grid[i] != ".").any():\n col.append(i)\n\nG = grid[row][:,col] \n\nfor g in G:\n print("".join(g))'] | ['Wrong Answer', 'Accepted'] | ['s098122455', 's413092737'] | [15272.0, 12540.0] | [169.0, 155.0] | [527, 530] |
p03273 | u111508936 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["import numpy as np\nimport math\n\n\nH, W = map(int, input().split())\n\nA = np.zeros((H, W), dtype=int)\n\nfor h in range(H):\n ah = input()\n for w in range(W):\n if ah[w] == '.':\n A[h][w] = 0\n else:\n A[h][w] = 1\n\n# print(A)\nremH = []\nremW = []\n \nfor h in range(H):\n if all(A[h] == 0):\n remH.append(h)\nfor w in range(W):\n if all(A[:,w] == 0):\n remW.append(w)\n\n# print(remH, remW)\n \nret = []\n\nfor h in range(H):\n if h in remH:\n continue\n hlist = []\n for w in range(W):\n if w in remW:\n continue\n # print(h)\n # print(w)\n # print(A[h][w])\n hlist.append(A[h][w])\n ret.append(hlist)\n\n# print(ret)\n\nretH = H - len(remH)\nretW = W - len(remW)\n\nprint(retH, retW)\nfor x in range(retH):\n for y in range(retW):\n if ret[x][y] == 0:\n print('.', end='')\n else:\n print('#', end='') \n print()\n", "import numpy as np\nimport math\n\n\nH, W = map(int, input().split())\n\nA = np.zeros((H, W), dtype=int)\n\nfor h in range(H):\n ah = input()\n for w in range(W):\n if ah[w] == '.':\n A[h][w] = 0\n else:\n A[h][w] = 1\n\n# print(A)\nremH = []\nremW = []\n \nfor h in range(H):\n if all(A[h] == 0):\n remH.append(h)\nfor w in range(W):\n if all(A[:,w] == 0):\n remW.append(w)\n\n# print(remH, remW)\n \nret = []\n\nfor h in range(H):\n if h in remH:\n continue\n hlist = []\n for w in range(W):\n if w in remW:\n continue\n # print(h)\n # print(w)\n # print(A[h][w])\n hlist.append(A[h][w])\n ret.append(hlist)\n\n# print(ret)\n\nretH = H - len(remH)\nretW = W - len(remW)\n\n# print(retH, retW)\nfor x in range(retH):\n for y in range(retW):\n if ret[x][y] == 0:\n print('.', end='')\n else:\n print('#', end='') \n print()\n"] | ['Wrong Answer', 'Accepted'] | ['s721554171', 's853518540'] | [21640.0, 14280.0] | [1291.0, 180.0] | [964, 966] |
p03273 | u128740947 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h, w = map(int, input().split())\na = []\nfor i in range(h):\n A = list(map(str,input().split()))\n a.append(A)\nkesu = []\nfor i in range(h):\n b = str(a[i])\n ten = 0\n for l in range(w):\n if b[l+2] == ",":\n ten += 1\n if w == ten :\n kesu.append(i)\nfor i in range(len(kesu)):\n K = int(kesu[i])\n a.pop(K-i)\nhi = []\nfor i in range(w):\n hkari = ""\n for l in range(len(a)):\n h = str(a[l])\n hz = str(h[i+2])\n hkari += str(hz)\n hi.append(hkari)\nkesu = []\nfor i in range(len(hi)):\n b = str(hi[i])\n ten = 0\n for l in range(len(b)):\n if b[l] == ",":\n ten += 1\n if len(b) == ten:\n kesu.append(i)\nfor i in range(len(kesu)):\n K = int(kesu[i])\n hi.pop(K-i)\nb = len(str(hi[0]))\nans = []\nfor i in range(b):\n hkari = ""\n for l in range(len(hi)):\n h = str(hi[l])\n hz = str(h[i])\n hkari += str(hz)\n ans.append(hkari)\nfor i in range(len(ans)):\n print(ans[i])\n', 'h, w = map(int, input().split())\na = []\nfor i in range(h):\n A = list(map(str,input().split()))\n a.append(A)\nkesu = []\nfor i in range(h):\n b = str(a[i])\n ten = 0\n for l in range(w):\n if b[l+2] == ",":\n ten += 1\n if w == ten :\n kesu.append(i)\nfor i in range(len(kesu)):\n K = int(kesu[i])\n a.pop(K-i)\nhi = []\nfor i in range(w):\n hkari = ""\n for l in range(len(a)):\n h = str(a[l])\n hz = str(h[i+2])\n hkari += str(hz)\n hi.append(hkari)\nkesu = []\nfor i in range(len(hi)):\n b = str(hi[i])\n ten = 0\n for l in range(len(b)):\n if b[l] == ",":\n ten += 1\n if len(b) == ten:\n kesu.append(i)\nfor i in range(len(kesu)):\n K = int(kesu[i])\n hi.pop(K-i)\nb = len(str(hi[0]))\nans = []\nfor i in range(b):\n hkari = ""\n for l in range(len(hi)):\n h = str(hi[l])\n hz = str(h[i])\n hkari += str(hz)\n ans.append(hkari)\nprint(ans)', 'h, w = map(int, input().split())\na = []\nfor i in range(h):\n A = list(map(str,input().split()))\n a.append(A)\nkesu = []\nfor i in range(h):\n b = str(a[i])\n ten = 0\n for l in range(w):\n if b[l+2] == ".":\n ten += 1\n if w == ten :\n kesu.append(i)\nfor i in range(len(kesu)):\n K = int(kesu[i])\n a.pop(K-i)\nhi = []\nfor i in range(w):\n hkari = ""\n for l in range(len(a)):\n h = str(a[l])\n hz = str(h[i+2])\n hkari += str(hz)\n hi.append(hkari)\nkesu = []\nfor i in range(len(hi)):\n b = str(hi[i])\n ten = 0\n for l in range(len(b)):\n if b[l] == ".":\n ten += 1\n if len(b) == ten:\n kesu.append(i)\nfor i in range(len(kesu)):\n K = int(kesu[i])\n hi.pop(K-i)\nb = len(str(hi[0]))\nans = []\nfor i in range(b):\n hkari = ""\n for l in range(len(hi)):\n h = str(hi[l])\n hz = str(h[i])\n hkari += str(hz)\n ans.append(hkari)\nfor i in range(len(ans)):\n print(ans[i])'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s004781812', 's314010964', 's767573217'] | [3188.0, 3188.0, 3188.0] | [41.0, 41.0, 42.0] | [987, 952, 986] |
p03273 | u136843617 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H,W = map(int, input().split())\nmap =[]\nfor _ in range(H):\n a = list(input())\n map.append([int(x !=\'.\') for x in a ])\nmemo = []\nfor i in range(H):\n if sum(map[i]) == 0:\n memo.append(i)\nwhile memo:\n del map[memo[-1]]\n del memo[-1]\n H -= 1\nfor j in range(W):\n color = [map[x][j] for x in range(H)]\n if sum(color) == 0:\n memo.append(j)\nwhile memo:\n for k in range(H):\n del map[k][memo[-1]]\n del memo[-1]\n W = -1\nfor j in map:\n a = ["." if ab == 0 else "#" for ab in j]\n print(*a)', 'H,W = map(int, input().split())\nmap =[]\nfor _ in range(H):\n a = list(input())\n map.append([int(x !=\'.\') for x in a ])\nmemo = []\nfor i in range(H):\n if sum(map[i]) == 0:\n memo.append(i)\nwhile memo:\n del map[memo[-1]]\n del memo[-1]\n H -= 1\nfor j in range(W):\n color = [map[x][j] for x in range(H)]\n if sum(color) == 0:\n memo.append(j)\nwhile memo:\n for k in range(H):\n del map[k][memo[-1]]\n del memo[-1]\n W = -1\nfor j in map:\n a = ["." if ab == 0 else "#" for ab in j]\n print("".join(a))'] | ['Wrong Answer', 'Accepted'] | ['s394496529', 's516024469'] | [3828.0, 3188.0] | [24.0, 21.0] | [538, 546] |
p03273 | u139880922 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w= map(int,input().split())\nl = list()\nm = 0\nfor i in range(h):\n c = input()\n if "#" in c:\n b = [ w for w in range(len(c)) if c[w] == "#" ]\n l.append(b)\n if m < max(b) : m = max(b)\np = list()\nfor i in range(m) :\n for j in l:\n if i in j: break\n else:\n p.append(i)\nfor j in range(len(l)):\n for e in range(len(l[j])):\n cnt = 0\n for q in p:\n if l[j][e] > q : cnt += 1\n l[j][e] = l[j][e] - cnt\nprint(l)\nm = 0\nfor i in l:\n if m < max(i) : m = max(i)\nfor i in l:\n t = ""\n for j in range(m+1):\n if j in i : t = t + "#"\n else: t = t + "."\n print(t)', 'h,w= map(int,input().split())\nl = list()\nm = 0\nfor i in range(h):\n c = input()\n if "#" in c:\n b = [ w for w in range(len(c)) if c[w] == "#" ]\n l.append(b)\n if m < max(b) : m = max(b)\np = list()\nfor i in range(m) :\n for j in l:\n if i in j: break\n else:\n p.append(i)\nfor j in range(len(l)):\n for e in range(len(l[j])):\n cnt = 0\n for q in p:\n if l[j][e] > q : cnt += 1\n l[j][e] = l[j][e] - cnt\nm = 0\nfor i in l:\n if m < max(i) : m = max(i)\nfor i in l:\n t = ""\n for j in range(m+1):\n if j in i : t = t + "#"\n else: t = t + "."\n print(t)'] | ['Wrong Answer', 'Accepted'] | ['s972012791', 's243869101'] | [3316.0, 3188.0] | [30.0, 30.0] | [587, 578] |
p03273 | u151625340 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["import numpy as np\nH, W = map(int, input().split())\na = []\nfor i in range(H):\n a_l = input()\n a.append([c for c in a_l])\n\n\nfor i in range(H):\n for j in range(W):\n if a[i][j] == '.':\n a[i][j] = 1\n elif a[i][j] == '#':\n a[i][j] = 0\n else:\n pass\na = np.array(a)\nv = []\nh = []\nfor i in range(H):\n if np.sum(a[i,:]) == 0 or np.sum(a[i,:]) == W:\n h.append(i)\nfor j in range(W):\n if np.sum(a[:,j]) == 0 or np.sum(a[:,j]) == H:\n v.append(j)\n\na_del = np.delete(np.delete(a, v, 1), h, 0)\na_del = list(a_del)\n\nfor i in range(len(a_del)):\n for j in range(len(a_del[i])):\n if a_del[i][j] == 1:\n print('.', end='')\n elif a_del[i][j] == 0:\n print('#', end='')\n print('\\n')\n", "import numpy as np\nH, W = map(int, input().split())\na = []\nfor i in range(H):\n a_l = input()\n a.append([c for c in a_l])\n\n\nfor i in range(H):\n for j in range(W):\n if a[i][j] == '.':\n a[i][j] = 1\n elif a[i][j] == '#':\n a[i][j] = 0\n else:\n pass\na = np.array(a)\nv = []\nh = []\nfor i in range(H):\n if np.sum(a[i,:]) == W:\n h.append(i)\nfor j in range(W):\n if np.sum(a[:,j]) == H:\n v.append(j)\n\na_del = np.delete(np.delete(a, v, 1), h, 0)\na_del = list(a_del)\n\nfor i in range(len(a_del)):\n for j in range(len(a_del[i])):\n if a_del[i][j] == 1:\n print('.', end='')\n elif a_del[i][j] == 0:\n print('#', end='')\n print('')"] | ['Wrong Answer', 'Accepted'] | ['s405492674', 's313883294'] | [14048.0, 14052.0] | [186.0, 184.0] | [783, 734] |
p03273 | u152638361 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H, W = map(int,input().split())\na=[list(input()) for i in range(H)]\n#yoko\nfor i in range(1,H):\n if a[-i]==["."]*W:\n a.pop(-i)\na_t = tenchi(a)\nfor i in range(1,len(a_t)):\n if a_t[-i]==["."]*len(a):\n a_t.pop(-i)\nans = tenchi(a_t)\nfor i in range(len(ans)):\n ansa = "".join(ans[i])\n print(ansa)\n\ndef tenchi(gr):\n gr_t=[[0]*len(gr) for i in range(len(gr[0]))]\n for i in range(len(gr)):\n for j in range(len(gr[i])):\n gr_t[j][i] = gr[i][j]\n return gr_t', 'H, W = map(int,input().split())\na=[list(input()) for i in range(H)]\n#yoko\nwhile a.count(["."]*len(a[0]))>0:\n a.remove(["."]*len(a[0]))\n\na_t = tenchi(a)\nwhile a_t.count(["."]*len(a_t[0]))>0:\n a_t.remove(["."]*len(a_t[0]))\nans = tenchi(a_t)\nfor i in range(len(ans)):\n ansa = "".join(ans[i])\n print(ansa)\n\ndef tenchi(gr):\n gr_t=[[0]*len(gr) for i in range(len(gr[0]))]\n for i in range(len(gr)):\n for j in range(len(gr[i])):\n gr_t[j][i] = gr[i][j]\n return gr_t', 'H, W = map(int,input().split())\na=[list(input()) for i in range(H)]\nfor i in range(1,H):\n if a[-i]==["."]*W:\n a.pop(-i)\na_t = tenchi(a)\nfor i in range(1,len(a_t)):\n if a_t[-i]==["."]*len(a):\n a_t.pop(-i)\nans = tenchi(a_t)\nfor i in range(len(ans)):\n ansa = "".join(ans[i])\n print(ansa)\n\ndef tenchi(gr):\n gr_t=[[0]*len(gr) for i in range(len(gr[0]))]\n for i in range(len(gr)):\n for j in range(len(gr[i])):\n gr_t[j][i] = gr[i][j]\n return gr_t', 'def tenchi(gr):\n gr_t=[[0]*len(gr) for i in range(len(gr[0]))]\n for i in range(len(gr)):\n for j in range(len(gr[i])):\n gr_t[j][i] = gr[i][j]\n return gr_t\n\nH, W = map(int,input().split())\na=[list(input()) for i in range(H)]\n#yoko\nwhile a.count(["."]*len(a[0]))>0:\n a.remove(["."]*len(a[0]))\n\na_t = tenchi(a)\nwhile a_t.count(["."]*len(a_t[0]))>0:\n a_t.remove(["."]*len(a_t[0]))\nans = tenchi(a_t)\nfor i in range(len(ans)):\n ansa = "".join(ans[i])\n print(ansa)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s255862285', 's454685268', 's990557242', 's930219158'] | [3064.0, 3188.0, 3064.0, 3316.0] | [18.0, 20.0, 18.0, 21.0] | [498, 495, 492, 495] |
p03273 | u155687575 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["import numpy as np\nh, w = map(int, input().split())\nfield = []\nfor _ in range(h):\n row = list(input())\n field.append(row)\nfield = np.array(field)\n\n\ndeleterow = []\ndeleteline = []\nfor i in range(field.shape[0]):\n if len(set(field[i,:]))==1:\n deleterow.append(i)\nfor j in range(field.shape[1]):\n if len(set(field[:,j]))==1:\n deleteline.append(j)\n\nfor i, row in enumerate(field):\n if i in deleterow:\n continue\n for j, val in enumerate(row):\n if j in deleteline:\n continue\n print(val, end='')\n print('\\n')", "import numpy as np\nh, w = map(int, input().split())\nfield = []\nfor _ in range(h):\n row = list(input())\n field.append(row)\nfield = np.array(field)\n\n\ndeleterow = []\ndeleteline = []\nfor i in range(field.shape[0]):\n if set(field[i,:])=={'.'}:\n deleterow.append(i)\nfor j in range(field.shape[1]):\n if set(field[:,j])=={'.'}:\n deleteline.append(j)\n\nfor i, row in enumerate(field):\n if i in deleterow:\n continue\n for j, val in enumerate(row):\n if j in deleteline:\n continue\n print(val, end='')\n print('')"] | ['Wrong Answer', 'Accepted'] | ['s284625692', 's340866561'] | [13688.0, 13692.0] | [172.0, 174.0] | [568, 564] |
p03273 | u155828990 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['import numpy as np\n\nh,w=map(int,input().split())\ntmp=[]\nfor i in range(h):\n a=list(input())\n tmp.append(a)\nans1=[]\nif(w!=1):\n for i in range(h):\n if(len(set(tmp[i]))==1):\n ans1.append(i)\nans2=[]\ntmp=list(map(list,zip(*tmp)))\nif(h!=1)\n for i in range(w):\n if(len(set(tmp[i]))==1):\n ans2.append(i)\n# print(ans1,ans2)\ntmp=list(map(list,zip(*tmp)))\ntmp=np.delete(tmp,ans1,axis=0)\ntmp=np.delete(tmp,ans2,axis=1)\nfor i in range(len(tmp)):\n for j in range(len(tmp[0])):\n print(tmp[i][j],end="")\n print()', 'import numpy as np\n\nh,w=map(int,input().split())\ntmp=[]\nfor i in range(h):\n a=list(input())\n tmp.append(a)\nans1=[]\nif(w!=1):\n for i in range(h):\n if(len(set(tmp[i]))==1):\n ans1.append(i)\nans2=[]\ntmp=list(map(list,zip(*tmp)))\nif(h!=1)\n for i in range(w):\n if(len(set(tmp[i]))==1):\n ans2.append(i)\n# print(ans1,ans2)\ntmp=list(map(list,zip(*tmp)))\ntmp=np.delete(tmp,ans1,axis=0)\ntmp=np.delete(tmp,ans2,axis=1)\nfor i in range(len(tmp)):\n for j in range(len(tmp[0])):\n print(tmp[i][j],end="")\n print()', '\\import numpy as np\n\nh,w=map(int,input().split())\ntmp=[]\nfor i in range(h):\n a=list(input())\n tmp.append(a)\nans1=[]\nif(w!=1):\n for i in range(h):\n if(len(set(tmp[i]))==1 and tmp[i][0]!="#"):\n ans1.append(i)\nans2=[]\ntmp=list(map(list,zip(*tmp)))\nif(h!=1):\n for i in range(w):\n if(len(set(tmp[i]))==1 and tmp[i][0]!="#"):\n ans2.append(i)\n# print(ans1,ans2)\ntmp=list(map(list,zip(*tmp)))\ntmp=np.delete(tmp,ans1,axis=0)\ntmp=np.delete(tmp,ans2,axis=1)\nfor i in range(len(tmp)):\n for j in range(len(tmp[0])):\n print(tmp[i][j],end="")\n print()', 'import numpy as np\n\nh,w=map(int,input().split())\ntmp=[]\nfor i in range(h):\n a=list(input())\n tmp.append(a)\nans1=[]\nif(w!=1):\n for i in range(h):\n if(len(set(tmp[i]))==1 and tmp[i][0]!="#"):\n ans1.append(i)\nans2=[]\ntmp=list(map(list,zip(*tmp)))\nif(h!=1):\n for i in range(w):\n if(len(set(tmp[i]))==1 and tmp[i][0]!="#"):\n ans2.append(i)\n# print(ans1,ans2)\ntmp=list(map(list,zip(*tmp)))\ntmp=np.delete(tmp,ans1,axis=0)\ntmp=np.delete(tmp,ans2,axis=1)\nfor i in range(len(tmp)):\n for j in range(len(tmp[0])):\n print(tmp[i][j],end="")\n print()'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s096171451', 's138042170', 's777390729', 's463941555'] | [3060.0, 3060.0, 2940.0, 13880.0] | [18.0, 17.0, 17.0, 170.0] | [565, 565, 605, 604] |
p03273 | u174434198 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H, W = map(int, input().split())\na = [list(input()) for i in range(H)]\nfor i in range(H):\n for j in range(W):\n print(a[i][j], end='')\n print('')\ncntH = 0\nfor i in range(H-1, 0, -1):\n flag = True\n for j in range(W):\n if a[i][j] == '#':\n flag = False\n break\n if flag:\n a.pop(i)\n cntH+=1\n\nfor j in range(W-1, 0, -1):\n flag = True\n for i in range(H-cntH):\n if a[i][j] == '#':\n flag = False\n if(flag):\n for i in range(H-cntH):\n a[i].pop(j)\n\nfor i in range(H-cntH):\n for j in range(len(a[i])):\n print(a[i][j], end='')\n print('')", "H, W = map(int, input().split())\na = [list(input()) for i in range(H)]\n\ncntH = 0\nfor i in range(H-1, -1, -1):\n flag = True\n for j in range(W):\n if a[i][j] == '#':\n flag = False\n break\n if flag:\n a.pop(i)\n cntH+=1\n\nfor j in range(W-1, -1, -1):\n flag = True\n for i in range(H-cntH):\n if a[i][j] == '#':\n flag = False\n if(flag):\n for i in range(H-cntH):\n a[i].pop(j)\n\nfor i in range(H-cntH):\n for j in range(len(a[i])):\n print(a[i][j], end='')\n print('')"] | ['Wrong Answer', 'Accepted'] | ['s374285639', 's359722901'] | [4724.0, 4596.0] | [41.0, 29.0] | [645, 561] |
p03273 | u175590965 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w = map(int,input().split())\na = [[i for i in input()] for _ in range(h)]\nb = [x for in a if "#" in x]\nc = zip(*[x for x in zip(*b) if "#"in x])\nfor d in c:\n print("".join(d))', 'h,w = map(int,input().split())\na = [[i for i in input()] for _ in range(h)]\nb = [x for x in a if "#" in x]\nc = zip(*[x for x in zip(*b) if "#"in x])\nfor d in c:\n print("".join(d))'] | ['Runtime Error', 'Accepted'] | ['s389472688', 's059527416'] | [2940.0, 3188.0] | [18.0, 18.0] | [180, 182] |
p03273 | u185037583 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w=map(int,input().split())\na=[]\nfor i in range(h):\n tmp=input()\n if len(tmp)!=tmp.count('.'):\n a.append(tmp)\n else:\n h-=1\n \na=list(zip(*a))\nfor i in range(w):\n if len(a[i])==a[i].count('.'):\n del a[i]\n w-=1\n i-=1\n \na=list(zip(*a))\nfor i in range(h):\n print(a[i])\n \n", "h,w=map(int,input().split())\na=[]\nfor i in range(h):\n tmp=input()\n if len(tmp)!=tmp.count('.'):\n a.append(tmp)\n else:\n h-=1\n\nb=[]\nfor i in range(w):\n cnt=0\n for j in range(h):\n if a[j][i]=='.':\n cnt+=1\n if cnt==h:\n b.append(0)\n else:\n b.append(1)\n\nfor i in range(h):\n for j in range(w):\n if b[j]:\n print(a[i][j], end='')\n print()\n "] | ['Runtime Error', 'Accepted'] | ['s462558093', 's121018714'] | [3188.0, 4468.0] | [19.0, 30.0] | [298, 373] |
p03273 | u186838327 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h, w = map(int, input().split())\na = ['']*h\nfor i in range(h):\n a[i] = input()\n \nrow = [False] * h\ncol = [False] * w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j] == '#':\n row[i] = True\n col[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j], end = ' ')", "h, w = map(int, input().split())\nl = []\nfor i in range(h):\n a = str(input())\n if a == '.'*w:\n continue\n l.append(a)\n\nskip = []\nfor i in range(w):\n for j in range(len(l)):\n if l[j][i] == '#':\n break\n else:\n skip.append(i)\n\nskip = set(skip)\nl_ = [0]*len(l)\nfor i in range(len(l)):\n temp = ''\n for j in range(w):\n if j not in skip:\n temp += l[i][j]\n l_[i] = temp\n \nfor i in range(len(l_)):\n print(l_[i])"] | ['Wrong Answer', 'Accepted'] | ['s373234520', 's243597648'] | [3700.0, 3064.0] | [31.0, 20.0] | [371, 432] |
p03273 | u192541825 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w=map(int,input().split())\na=[\'\']*h\nfor i in range(h):\n a[i]=input()\n\nrow=[False]*h\ncol=[False]*w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j]=="#":\n raw[i]=True\n col[j]=True;\n\nfor i in range(h):\n if raw[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j],end="")\n print()\n', 'h,w=map(int,input().split())\na=[\'\']*h\nfor i in range(h):\n a[i]=input()\n\nrow=[False]*h\ncol=[False]*w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j]=="#":\n raw[i]=true\n col[j]=true;\n\nfor i in range(h):\n if raw[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j],end="")\n print()\n', 'h,w=map(int,input().split())\na=[\'\']*h\nfor i in range(h):\n a[i]=input()\n\nrow=[False]*h\ncol=[False]*w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j]=="#":\n raw[i]=True\n col[j]=True;\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j],end="")\n print()\n', 'h,w=map(int,input().split())\na=[\'\']*h\nfor i in range(h):\n a[i]=input()\n\nrow=[False]*h\ncol=[False]*w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j]=="#":\n row[i]=True\n col[j]=True;\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j],end="")\n print()\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s192097242', 's299095089', 's466299024', 's126535765'] | [3064.0, 3064.0, 3064.0, 4468.0] | [19.0, 19.0, 19.0, 30.0] | [359, 359, 359, 359] |
p03273 | u199290844 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w = [int(i) for i in input().split(' ')]\na = [list(input()) for i in range(h)]\n\n\nb = [i for i in a if not i.count('.') == w]\nfor i in b:\n print(''.join(i))\n\nh2 = len(b)\nw2 = len(b[0])\nret = []\nfor i in range(w2):\n for x in range(h2):\n if b[x][i] == '#':\n ax = [b[xx][i] for xx in range(h2)]\n ret += [ax]\n break\n else:\n continue\n\nfor i in range(len(ret[0])):\n print(''.join([ret[x][i] for x in range(len(ret))]))\n", "h,w = [int(i) for i in input().split(' ')]\na = [list(input()) for i in range(h)]\n\n\nb = [i for i in a if not i.count('.') == w]\n\nh2 = len(b)\nw2 = len(b[0])\nret = []\nfor i in range(w2):\n for x in range(h2):\n if b[x][i] == '#':\n ax = [b[xx][i] for xx in range(h2)]\n ret += [ax]\n break\n else:\n continue\n\nfor i in range(len(ret[0])):\n print(''.join([ret[x][i] for x in range(len(ret))]))\n"] | ['Wrong Answer', 'Accepted'] | ['s823431967', 's496865229'] | [3316.0, 3188.0] | [21.0, 20.0] | [495, 461] |
p03273 | u202570162 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['l = [int(i) for i in input().split()]\nprint(l[0]-l[1]+1)', "h,w = map(int,input().split())\n\nm = []\n\nfor i in range(h):\n m.append(list(input()))\n\n\n\ndl = []\n\nfor i in range(h):\n if all(j =='_' for j in m[i]):\n dl.append(int(i))\n\nfor i in dl:\n del m[i]\n\n\n\nm = list(zip(*m)) \n\ndl = []\nfor i in range(w):\n if all(j =='_' for j in m[i]):\n dl.append(int(i))\n\nfor i in dl:\n del m[i]\n\n\n\nm = list(zip(*m))\n\n\n\nfor i in range(len(m)):\n m[i] = ''.join(m[i])\n print(m[i])", "h,w = map(int,input().split())\n\nm = []\n\nfor i in range(h):\n m.append(list(input()))\n\n\n\ndl = []\n\nfor i in range(h):\n if all(j =='_' for j in m[i]):\n dl.append(int(i))\n\nif dl:\n for i in range(len(dl)):\n del m[dl[len(dl)-i-1]]\n\n\n\nm = list(zip(*m)) \nif m:\n dl = []\n for i in range(w):\n if all(j =='_' for j in m[i]):\n dl.append(int(i))\n\n if dl:\n for i in range(len(dl)):\n del m[dl[len(dl)-i-1]]\n \n\n\n\nm = list(zip(*m))\n\n\n\nfor i in range(len(m)):\n m[i] = ''.join(m[i])\n print(m[i])", "h,w = map(int,input().split())\nm = []\n\nfor i in range(h):\n m.append(list(input()))\n\n\n\ndl = []\n\nfor i in range(h):\n if all(j =='.' for j in m[i]):\n dl.append(int(i))\n# print(dl)\nif dl:\n for i in dl:\n del m[i-dl.index(i)]\nh = len(m)\n# print(m)\n\ndl = []\nfor i in range(w):\n s = ''\n for j in range(h):\n s = s + m[j][i]\n if all(j == '.' for j in list(s)):\n dl.append(int(i))\n# print(dl)\nif dl:\n for i in range(h):\n for j in dl:\n del m[i][j-dl.index(j)]\n\n# print(m)\nfor i in range(h):\n print(''.join(m[i]))\n\n\n# m = list(zip(*m)) \n# if m:\n# dl = []\n\n# if all(j =='.' for j in m[i]):\n# dl.append(int(i))\n\n\n\n\n \n\n\n\n# m = list(zip(*m))\n\n\n\n\n# m[i] = ''.join(m[i])\n# print(m[i])"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s176076243', 's675961743', 's717176054', 's623140161'] | [2940.0, 3188.0, 3188.0, 3188.0] | [17.0, 18.0, 21.0, 21.0] | [56, 496, 624, 977] |
p03273 | u204616996 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H,W=map(int,input().split())\nA=[list(input())for i in range(H)]\nww=set()\nhh=set()\nfor h in range(H):\n for w in range(W):\n if A[h][w]=='#':\n ww.add(w)\n hh.add(h)\nprint(ww,hh)\nww=sorted(list(ww))\nfor h in sorted(list(hh)):\n _=''\n for w in ww:\n _+=A[h][w]\n print(_)", "H,W=map(int,input().split())\nA=[list(input())for i in range(H)]\nww=set()\nhh=set()\nfor h in range(H):\n for w in range(W):\n if A[h][w]=='#':\n ww.add(w)\n hh.add(h)\nww=sorted(list(ww))\nfor h in sorted(list(hh)):\n _=''\n for w in ww:\n _+=A[h][w]\n print(_)"] | ['Wrong Answer', 'Accepted'] | ['s987575788', 's055875162'] | [3188.0, 3188.0] | [23.0, 23.0] | [282, 269] |
p03273 | u207799478 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['import math\n\n\ndef readints():\n return list(map(int, input().split()))\n\n\ndef nCr(n, r):\n return math.factorial(n)//math.factorial(n-r)*math.factorial(r)\n\n\nh, w = map(int, input().split())\na = [None]*h\nprint(a)\nfor i in range(h):\n a[i] = str(input())\nprint(a)\nx = [None]*h\ny = [None]*w\nprint(x)\nprint(y)\nfor i in range(h):\n for j in range(w):\n if a[i][j] == "#":\n x[i] = True\n y[j] = True\nprint(x)\nprint(y)\nfor i in range(h):\n if x[i] == True:\n for j in range(w):\n if y[j] == True:\n print(a[i][j], end="")\n print()\n', 'import math\n\n\ndef readints():\n return list(map(int, input().split()))\n\n\ndef nCr(n, r):\n return math.factorial(n)//math.factorial(n-r)*math.factorial(r)\n\n\nh, w = map(int, input().split())\na = [None]*h\nprint(a)\nfor i in range(h):\n a[i] = input()\nprint(a)\nx = [None]*h\ny = [None]*w\nprint(x)\nprint(y)\nfor i in range(h):\n for j in range(w):\n if a[i][j] == "#":\n x[i] = True\n y[j] = True\nprint(x)\nprint(y)\nfor i in range(h):\n if x[i] == True:\n for j in range(w):\n if y[j] == True:\n print(a[i][j], end="")\n print()\n', 'import math\n\n\ndef readints():\n return list(map(int, input().split()))\n\n\ndef nCr(n, r):\n return math.factorial(n)//math.factorial(n-r)*math.factorial(r)\n\n\nh, w = map(int, input().split())\na = [None]*h\n# print(a)\nfor i in range(h):\n a[i] = input()\n# print(a)\nx = [None]*h\ny = [None]*w\n# print(x)\n# print(y)\nfor i in range(h):\n for j in range(w):\n if a[i][j] == "#":\n x[i] = True\n y[j] = True\n# print(x)\n# print(y)\nfor i in range(h):\n if x[i] == True:\n for j in range(w):\n if y[j] == True:\n print(a[i][j], end="")\n print()\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s078960449', 's127273941', 's552724165'] | [4084.0, 4084.0, 4468.0] | [32.0, 31.0, 31.0] | [597, 592, 604] |
p03273 | u216289806 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['HW = input()\nmasu = "none"\nhw = HW.split()\n\nAdata = []\nfor lop in range(int(hw[0])):\n A = input()\n Adata.append(A)\n\nx = []\ny = []\nbuf = ""\nfor lop in range(int(hw[0])):\n if str(Adata[lop]).find(".") == -1 or str(Adata[lop]).find("#") == -1:\n x.append(lop)\n \nfor lop in range(int(hw[1])):\n for lop2 in range(int(hw[0])):\n buf = buf + str(Adata[lop2][lop])\n if str(buf).find(".") == -1:\n y.append(lop)\n buf = ""\n\nfor lop in range(len(x)-1,-1,-1):\n Adata.pop(x[lop])\n\n\nans = []\nfor lop in range(len(Adata)):\n buf = list(Adata[lop])\n for lop2 in range(len(y)-1,-1,-1):\n buf.pop(y[lop2])\n ans.append(buf)\n\nfor lop in range(len(ans)):\n ANS = ""\n for lop2 in range(len(ans[0])):\n ANS += ans[lop][lop2]\n print(ANS)\n', 'HW = input()\nmasu = "none"\nhw = HW.split()\n\nAdata = []\nfor lop in range(int(hw[0])):\n A = input()\n Adata.append(A)\n\nx = []\ny = []\nbuf = ""\nfor lop in range(int(hw[0])):\n if str(Adata[lop]).find("#") == -1:\n x.append(lop)\n \nfor lop in range(int(hw[1])):\n for lop2 in range(int(hw[0])):\n buf = buf + str(Adata[lop2][lop])\n if str(buf).find("#") == -1:\n y.append(lop)\n buf = ""\n\nfor lop in range(len(x)-1,-1,-1):\n Adata.pop(x[lop])\n\n\nans = []\nfor lop in range(len(Adata)):\n buf = list(Adata[lop])\n for lop2 in range(len(y)-1,-1,-1):\n buf.pop(y[lop2])\n ans.append(buf)\n\nfor lop in range(len(ans)):\n ANS = ""\n for lop2 in range(len(ans[0])):\n ANS += ans[lop][lop2]\n print(ANS)\n'] | ['Wrong Answer', 'Accepted'] | ['s716723793', 's764109110'] | [3188.0, 3188.0] | [24.0, 23.0] | [784, 749] |
p03273 | u218843509 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h, w = map(int, input().split())\na = [input() for _ in range(h)]\nans_w = []\nans_h = []\nfor i in range(h):\n for j in range(w):\n if a[i][j] == "#":\n break\n else:\n ans_h.append(i)\nfor j in range(w):\n for i in range(h):\n if a[i][j] == "#":\n break\n else:\n ans_w.append(j)\n\nfor i in ans_h:\n print(*[a[i][j] for j in ans_w], sep="")', 'h, w = map(int, input().split())\na = [input() for _ in range(h)]\nans_w = []\nans_h = []\nfor i in range(h):\n for j in range(w):\n if a[i][j] == "#":\n ans_h.append(i)\n break\nfor j in range(w):\n for i in range(h):\n if a[i][j] == "#":\n ans_w.append(j)\n break\nfor i in ans_h:\n print(*[a[i][j] for j in ans_w], sep="")'] | ['Wrong Answer', 'Accepted'] | ['s582433984', 's770242155'] | [4468.0, 4340.0] | [24.0, 25.0] | [352, 339] |
p03273 | u223646582 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H,W=map(int,input().split())\na=[list(map(str, input())) for _ in range(H)]\n\nc=[]\nfor li in a:\n print(li)\n if li!=['.']*len(li):\n c.append(li)\n\nb=[]\nfor lc in zip(*c):\n if lc!=('.',)*len(lc):\n b.append(lc)\n\nfor ld in zip(*b):\n print(''.join(ld))\n\n\n\n\n", "H,W=map(int,input().split())\na=[list(map(str, input())) for _ in range(H)]\n\nc=[]\nfor li in a:\n if li!=['.']*len(li):\n c.append(li)\n\nb=[]\nfor lc in zip(*c):\n if lc!=('.',)*len(lc):\n b.append(lc)\n\nfor ld in zip(*b):\n print(''.join(ld))\n\n\n\n\n"] | ['Wrong Answer', 'Accepted'] | ['s986316064', 's213937341'] | [3316.0, 3188.0] | [20.0, 21.0] | [275, 261] |
p03273 | u223904637 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w=map(int,input().split())\nl=[]\nfor i in range(h):\n l.append(list(input()))\nwl=[]\nfor i in range(h):\n wf=0\n for j in range(w):\n if l[i][j]=='.':\n wf+=1\n if wf<w:\n wl.append(i)\n \nhl=[]\nfor i in range(w):\n hf=0\n for j in range(h):\n if l[j][i]=='.':\n hf+=1\n if hf<h:\n hl.append(i)\nfor i in hl:\n for j in wl:\n print(l[i][j],end='')\n print(/n)", "h,w=map(int,input().split())\nl=[]\nfor i in range(h):\n l.append(list(input()))\nwl=[]\nfor i in range(h):\n wf=0\n for j in range(w):\n if l[i][j]=='.':\n wf+=1\n if wf<w:\n wl.append(i)\n \nhl=[]\nfor i in range(w):\n hf=0\n for j in range(h):\n if l[j][i]=='.':\n hf+=1\n if hf<h:\n hl.append(i)\nfor i in hl:\n for j in wl:\n print(l[i][j],end='')\n print()\n", "h,w=map(int,input().split())\nl=[]\nfor i in range(h):\n l.append(list(input()))\nwl=[]\nfor i in range(h):\n wf=0\n for j in range(w):\n if l[i][j]=='.':\n wf+=1\n if wf<w:\n wl.append(i)\n \nhl=[]\nfor i in range(w):\n hf=0\n for j in range(h):\n if l[j][i]=='.':\n hf+=1\n if hf<h:\n hl.append(i)\nfor i in wl:\n for j in hl:\n print(l[i][j],end='')\n print()\n"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s410062918', 's750980425', 's817393387'] | [3064.0, 4596.0, 4596.0] | [17.0, 31.0, 43.0] | [427, 426, 426] |
p03273 | u224554402 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["p,q= input().split()\na,b =(int(p), int(q))\na_list = []\ncount_row = 0\nfor i in range(a):\n c = input()\n \n if c == '.'*b:\n count_row+=1\n else:\n a_list.append(c)\nfor i in range(b):\n count_clm = 0\n \n for j in range(a-count):\n if a_list[j][i] == '.':\n count_clm+=1\n else:\n break\n if count_clm == (b-count_clm):\n for j in range(a-count_row):\n a_list[j].pop(i)\n \n \nfor i in range(a-count_row):\n print(a_list[i])", "p,q= input().split()\na,b =(int(p), int(q))\na_list = []\ncount_row = 0\nb_h ='.'*b\n\nfor i in range(a):\n c = input()\n \n if c == b_h:\n count_row+=1\n else:\n a_list.append(c)\n\nans_list=[]\nfor i in range(b):\n count_clm = 0\n \n for j in range(a-count_row):\n if a_list[j][i] == '.':\n count_clm+=1\n \n \n if count_clm == b: \n ans_list.append(i)\n\n\n\nfor j in range(a-count_row):\n total=''\n for i in range(b):\n if i in ans_list:\n ds = 0\n else:\n total +=a_list[j][i]\n \n print(total)", "p,q= input().split()\na,b =(int(p), int(q))\na_list = []\ncount_row = 0\nb_h ='.'*b\n\nfor i in range(a):\n c = input()\n \n if c == b_h:\n count_row+=1\n else:\n a_list.append(c)\n\nans_list=[]\nfor i in range(b):\n count_clm = 0\n \n for j in range(a-count_row):\n if a_list[j][i] == '.':\n count_clm+=1\n \n \n if count_clm == (a-count_row): \n ans_list.append(i)\n\n\n\nfor j in range(a-count_row):\n total=''\n for i in range(b):\n if i in ans_list:\n ds = 0\n else:\n total +=a_list[j][i]\n \n print(total)"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s279804925', 's715232575', 's585536318'] | [3064.0, 3064.0, 3064.0] | [18.0, 22.0, 23.0] | [520, 596, 616] |
p03273 | u227082700 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w=map(int,input().split());b=[input()for i in range(h)];a=[]\nfor i in b:\n if i!="."*w:a.append(i)\nb=[]\nfor i in range(w):\n s=""\n for j in a:s+=j[i]\n if s!="."*len(a):b.append(s)\nfor i in b:print(i)', 'h,w=map(int,input().split());b=[input()for i in range(h)];a=[]\nfor i in b:\n if i!="."*w:a.insert(0,i)\nb=[]\nfor i in range(w):\n s=""\n for j in a:s=j[i]+s\n if s!="."*len(a):b.insert(0,s)\nc=[]\nfor i in range(len(a)):\n s=""\n for j in b:\n s=j[i]+s\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s400178465', 's730336370'] | [3064.0, 3064.0] | [20.0, 20.0] | [203, 262] |
p03273 | u227085629 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w = map(int,input().split())\na_list = [input() for nesya in range(h)]\n\ngyo = [False]*h\nretsu = [False]*w\nfor i in range(h):\n for j in range(w):\n if a_list[i][j] == '#':\n gyo[i] = True\n retsu[j] = True\nfor k range(h):\n if gyo[k]:\n for l in range(w):\n if retsu[l]:\n print(a_list[k][l], end='')\n print()", "h,w = map(int,input().split())\na_list = [input() for nesya in range(h)]\n\ngyo = [False]*h\nretsu = [False]*w\nfor i in range(h):\n for j in range(w):\n if a_list[i][j] == '#':\n gyo[i] = True\n retsu[j] = True\nfor k in range(h):\n if gyo[k]:\n for l in range(w):\n if retsu[l]:\n print(a_list[k][l], end='')\n print()"] | ['Runtime Error', 'Accepted'] | ['s412351040', 's744214148'] | [2940.0, 4468.0] | [17.0, 31.0] | [335, 338] |
p03273 | u230117534 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H, W = map(int, input().strip().split(" "))\n\nrow = []\nfor i in range(H):\n line = input()\n if line.count(".") == W:\n continue\n row.append(line)\n\nprint(row)\nrow_count = len(row)\nans = [[] for i in range(row_count)]\nfor i in range(W):\n tmp = []\n for j in range(row_count):\n tmp.append(row[j][i])\n if tmp.count(".") == row_count:\n continue\n else:\n for index, c in enumerate(tmp):\n ans[index].append(c)\nfor i in ans:\n print("".join(i))\n', 'H, W = map(int, input().strip().split(" "))\n\nrow = []\nfor i in range(H):\n line = input()\n if line.count(".") == W:\n continue\n row.append(line)\n\nrow_count = len(row)\nans = [[] for i in range(row_count)]\nfor i in range(W):\n tmp = []\n for j in range(row_count):\n tmp.append(row[j][i])\n if tmp.count(".") == row_count:\n continue\n else:\n for index, c in enumerate(tmp):\n ans[index].append(c)\nfor i in ans:\n print("".join(i))\n'] | ['Wrong Answer', 'Accepted'] | ['s100628208', 's557142380'] | [3188.0, 3064.0] | [21.0, 22.0] | [494, 483] |
p03273 | u238084414 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H, W = map(int, input().split())\nX = []\nres = []\nF = [True] * W\n\nfor i in range(H):\n x = list(input())\n \n if x.count("#") != 0:\n X.append(x)\n\n for j in range(W):\n if x[j] == "#":\n F[j] = False\n break\n\nfor k in range(len(X)):\n r = ""\n for l in range(W):\n if not F[l]:\n r += (X[k][l])\n print(r)', 'H, W = map(int, input().split())\nX = []\nres = []\nF = [True] * W\n\nfor i in range(H):\n x = list(input())\n \n if x.count("#") != 0:\n X.append(x)\n\n for j in range(W):\n if x[j] == "#":\n F[j] = False\n\nfor k in range(len(X)):\n r = ""\n for l in range(W):\n if not F[l]:\n r += (X[k][l])\n print(r)'] | ['Wrong Answer', 'Accepted'] | ['s634861817', 's447979964'] | [3064.0, 3064.0] | [21.0, 22.0] | [324, 312] |
p03273 | u249727132 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H, W = map(int, input().split())\na = [""] * H\nfor i in range(H):\n a[i] = input()\nrow = [False] * H\ncol = [False] * W\nfor i in range(H):\n for j in range(W):\n if a[i][j] == "#":\n row[i] = True\n col[i] = True\nfor i in range(H):\n if row[i]:\n for j in range(W):\n if col[j]:\n print(a[i][j], end = "")\n print()', "h, w = map(int, input().split())\na = [''] * h\nfor i in range(h):\n\ta[i] = input()\n \nrow = [False] * h\ncol = [False] * w\nfor i in range(h):\n\tfor j in range(w):\n\t\tif a[i][j] == '#':\n\t\t\trow[i] = True\n\t\t\tcol[j] = True\n \nfor i in range(h):\n\tif row[i]:\n\t\tfor j in range(w):\n\t\t\tif col[j]:\n\t\t\t\tprint(a[i][j], end = '')\n\t\tprint()"] | ['Runtime Error', 'Accepted'] | ['s581631726', 's548344078'] | [4468.0, 4468.0] | [31.0, 31.0] | [381, 319] |
p03273 | u252828980 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['import numpy as np\nH,W = map(int,input().split())\nL = []\nfor i in range(H):\n L.append(list(input()))\nL = np.array(L)\nL = [x for x in L if "#" in x]\nL = np.rot90(L)\nL = [x for x in L if "#" in x]\nL = np.rot90(L,3)\n\nfor i in range(len(L)):\n print(*L[i])', 'h,w = map(int,input().split())\nL = []\nfor i in range(h):\n L.append(list(input()))\nL = [x for x in L if "#" in x]\nL = [x for x in zip(*L)]\nL = [x for x in L if "#" in x]\nL = [x for x in zip(*L)]\nfor i in range(len(L)):\n print(*L[i],sep = "")'] | ['Wrong Answer', 'Accepted'] | ['s568635450', 's562781637'] | [13160.0, 4596.0] | [162.0, 22.0] | [257, 246] |
p03273 | u252964975 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['def rotate(mat):\n mat2 = []\n for i in range(len(mat[0])):\n s = ""\n for k in range(len(mat)):\n s = s + mat[k][i]\n mat2.append(s)\n return mat2\n\nH,W=map(int, input().split())\nmat = []\nfor i in range(H):\n a = input()\n if "#" in a:\n mat.append(a)\n\nfor count in range(H+W):\n for i in range(len(mat)-1, 0, -1):\n if not "#" in mat[i]:\n del mat[i]\n rotate(mat)\n for i in range(len(mat)-1, 0, -1):\n if not "#" in mat[i]:\n del mat[i]\n rotate(mat)\n \nfor i in range(len(mat)):\n print(mat[i])', 'def strCut(s,n):\n return s[0:n] + s[n+1:len(s)]\n\nH,W=map(int, input().split())\ns_list = []\nfor i in range(H):\n s = input()\n if "#" in s: s_list.append(s)\n\n \n', "H,W=map(int, input().split())\nmasu_list = []\nfor i in range(H):\n S=str(input())\n if S.count('#') != 0:\n masu_list.append(S)\n\nyet = True\nwhile yet:\n for i in range(len(masu_list[0])):\n if masu_list[i].count('#') == 0:\n masu_list.delete(i,1)", 'def oneCol(mat,n):\n ans = ""\n for i in range(len(mat)):\n ans = ans + mat[i][n]\n return ans\n\ndef strCut(s,n):\n return s[0:n] + s[n+1:len(s)]\n\ndef lowCut(mat):\n for i in range(len(mat)):\n if not "#" in mat[len(mat)-i-1]:\n delete mat[len(mat)-i-1]\n return mat\n\ndef colCut(mat):\n for i in range(len(mat[0])):\n if not "#" in oneCol(mat,len(mat[0])-i-1):\n mat2 = []\n for k in range(len(mat)):\n mat2.append(strCut(mat[k],len(mat[0])-i-1))\n return mat\n \n\nH,W=map(int, input().split())\ns_list = []\nfor i in range(H):\n s = input()\n if "#" in s: s_list.append(s)\n\n \nwhile True:\n lowCut(mat)\n colCut(mat)\n print(mat)', 'def rotate(mat):\n mat2 = []\n for i in range(len(mat[0])):\n s = ""\n for k in range(len(mat)):\n s = s + mat[k][i]\n mat2.append(s)\n return mat2\n\nH,W=map(int, input().split())\nmat = []\nfor i in range(H):\n a = input()\n if "#" in a:\n mat.append(a)\n\nfor count in range(H+W):\n for i in range(len(mat)-1, 0, -1):\n if not "#" in mat[i]:\n del mat[i]\n rotate(mat)\n for i in range(len(mat)-1, 0, -1):\n if not "#" in mat[i]:\n del mat[i]\n rotate(mat)\n \n\nprint(mat)', 'def rotate(mat):\n mat2 = []\n for i in range(len(mat[0])):\n s = ""\n for k in range(len(mat)):\n s = s + mat[k][i]\n mat2.append(s)\n return mat2\n\nH,W=map(int, input().split())\nmat = []\nfor i in range(H):\n a = input()\n if "#" in a:\n mat.append(a)\n\nfor count in range(H+W):\n for i in range(len(mat)-1, -1, -1):\n if not "#" in mat[i]:\n del mat[i]\n mat = rotate(mat)\n for i in range(len(mat)-1, -1, -1):\n if not "#" in mat[i]:\n del mat[i]\n mat = rotate(mat)\n \nfor i in range(len(mat)):\n print(mat[i])\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s121898299', 's236663893', 's251473932', 's700042128', 's852391309', 's515512918'] | [3188.0, 3060.0, 3060.0, 2940.0, 3064.0, 3064.0] | [401.0, 17.0, 2104.0, 17.0, 395.0, 391.0] | [522, 163, 253, 656, 492, 537] |
p03273 | u274644863 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h, w = map(int, input().split())\n\na = [list(input()) for i in range(h)]\n\nrow = [False]*h\ncol = [False]*w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j] == '#':\n row[i] = True\n col[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j], end='')\n print()\n", "h, w = map(int, input().split())\n\na = [input() for i in range(h)]\n\nrow = [False]*h\ncol = [False]*w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j] == '#':\n row[i] = True\n col[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n print(a[i][j], end='')\n print()\n\n"] | ['Wrong Answer', 'Accepted'] | ['s755403949', 's858382235'] | [4212.0, 4468.0] | [33.0, 31.0] | [371, 362] |
p03273 | u281303342 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H,W = map(int,input().split())\nA = []\nfor i in range(H):\n a = input()\n A.append(a)\n\nansW,ansH = [],[]\nfor hi in range(H):\n for wi in range(W):\n if A[hi][wi] == "#":\n break\n else:\n ansH.append(hi)\nfor wi in range(W):\n for hi in range(H):\n if A[hi][wi] == "#":\n break\n else:\n ansW.append(wi)\n\nAns = []\nfor hi in range(H):\n if hi not in ansH:\n ans = ""\n for wi in range(W):\n if wi not in ansW:\n ans += A[hi][wi]\n Ans.append(ans)\n\nprint(Ans)\n\n', 'H,W = map(int,input().split())\nA = []\nfor i in range(H):\n a = input()\n A.append(a)\n\nansW,ansH = [],[]\nfor hi in range(H):\n for wi in range(W):\n if A[hi][wi] == "#":\n break\n else:\n ansH.append(hi)\nfor wi in range(W):\n for hi in range(H):\n if A[hi][wi] == "#":\n break\n else:\n ansW.append(wi)\n\nAns = []\nfor hi in range(H):\n if hi not in ansH:\n ans = ""\n for wi in range(W):\n if wi not in ansW:\n ans += A[hi][wi]\n Ans.append(ans)\n\nfor ans in Ans:\n print(ans)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s846953849', 's870215527'] | [3064.0, 3064.0] | [22.0, 22.0] | [557, 577] |
p03273 | u288430479 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w = map(int,input().split())\nl = list(list(input()) for i in range(h))\nfor i in l:\n if i.count(\'.\') ==w:\n i.clear()\n l.remove([])\nt = len(l)\n#print(l)\nfor i in range(w):\n if all (l[q][i]=="." for q in range(t)):\n for q in range(t):\n l[q][i] =""\nfor z in range(t):\n l[z].remove("")\nprint(l)\n ', 'h,w = map(int,input().split())\nl = list(list(input()) for i in range(h))\nfor i in l:\n if i.count(\'.\') ==w:\n i.clear()\nl= [i for i in l if i!=[]]\n#print(l)\nt = len(l)\nfor i in range(w):\n if all (l[q][i]=="." for q in range(t)):\n for q in range(t):\n l[q][i] =""\nif "" in l:\n for z in l:\n z.remove("")\nfor m in l:\n print("".join(m))\n\n'] | ['Runtime Error', 'Accepted'] | ['s957848144', 's231049780'] | [3188.0, 3064.0] | [20.0, 18.0] | [311, 349] |
p03273 | u294385082 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['import numpy as np\nh,w = map(int,input().split())\na = [input() for i in range(h)]\nd = "."\nc = 0\n\nfor i in range(h):\n if len(set(a[i])) == 1 and a[i][0] == d:\n a.remove(a[i])\n\nat = np.array(a)\ntr = at.T\n\nfor i in range(w):\n if len(set(tr[i])) == 1 and tr[i][0] == d:\n a.remove(tr[i])\n \natt = np.array(tr)\ntrr = att.T\n\nfor j in range(len(trr)):\n print("".join(trr[j]))\n', "import numpy as np\n\nh,w = map(int,input().split())\na = [list(input()) for i in range(h)]\nans1 = []\nans2 = []\n\nfor i in a:\n if '#' in i:\n ans1.append(i)\n \ngyouretu = np.array(ans1)\ngyouretuT = gyouretu.T\n\nfor i in gyouretuT:\n if '#' in i:\n ans2.append(i)\n \nans = np.array(ans2)\nanswer = ans.T\n\nfor i in answer:\n print(''.join(i))\n"] | ['Runtime Error', 'Accepted'] | ['s375231760', 's836485798'] | [12520.0, 12540.0] | [151.0, 155.0] | [379, 344] |
p03273 | u300968187 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H, W = map(int, input().split())\nmat = [list(map(lambda x: 0 if x == '#' else 1, input())) for _ in range(H)]\nprint((H - sum(all(row) for row in mat)) * (W - sum(all(row) for row in zip(*mat))))", "h, k = map(int, input().split())\nmat = [input() for _ in range(h)]\nfor _ in range(2):\n poplist = []\n for i, row in enumerate(mat):\n for x in row:\n if x == '#':\n break\n else:\n poplist.append(i)\n poplist.reverse()\n for i in poplist:\n mat.pop(i)\n poplist = []\n mat = [x for x in zip(*mat)]\nfor row in mat:\n print(''.join(row))"] | ['Wrong Answer', 'Accepted'] | ['s165722605', 's616740024'] | [3060.0, 3188.0] | [19.0, 18.0] | [194, 403] |
p03273 | u305965165 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H, W = (int(i) for i in input().split())\ne = [input() for i in range(H)] \n\nnew_e = []\nfor row in e:\n if row.count("#") > 0:\n new_e.append(row)\n\nnot_use_col = list(range(W))\nuse_col = []\nfor row in new_e:\n for col in not_use_col:\n if row[col] == "#":\n use_col.append(not_use_col.pop(col))\n break\n\nfor row in new_e:\n x=""\n for col in use_col:\n x += row[col]\n print(x)\n\n', 'H, W = (int(i) for i in input().split())\ne = [input() for i in range(H)] \n\nnew_e = []\nfor row in e:\n if row.count("#") > 0:\n new_e.append(row)\n\nuse_col = []\nfor row in new_e:\n for col in range(W):\n if row[col] == "#" and col not in use_col:\n use_col.append(col)\n \nfor row in new_e:\n x=""\n for col in sorted(use_col):\n x += row[col]\n print(x)\n\n'] | ['Runtime Error', 'Accepted'] | ['s756153108', 's182056776'] | [3060.0, 3064.0] | [19.0, 27.0] | [425, 401] |
p03273 | u306033313 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['/* ex5_3\n Graku */\n#include<stdio.h>\n\nint main(void) {\n int height, width;\n scanf("%d %d", &height, &width);\n char matrix[height][width];\n for (int row = 0; row < height; ++row) {\n for (int col = 0; col < width; ++col) {\n scanf(" %c", &matrix[row][col]); //don\'t read "\\n"\n }\n }\n\n int blank_rows[height], blank_cols[width]; //blank -> 0, not blank -> 1\n for (int row = 0; row < height; ++row) { //find blank rows\n int flag = 0;\n for (int col = 0; col < width; ++col) {\n if (\'#\' == matrix[row][col]) { //not blank\n flag = 1;\n break;\n }\n }\n blank_rows[row] = flag;\n }\n for (int col = 0; col < width; ++col) { //find blank columns\n int flag = 0;\n for (int row = 0; row < height; ++row) {\n if (\'#\' == matrix[row][col]) { //not blank\n flag = 1;\n break;\n }\n }\n blank_cols[col] = flag;\n }\n\n for (int row = 0; row < height; row++) {\n if (blank_rows[row]) { //if row is not blank\n for (int col = 0; col < width; ++col) {\n if (blank_cols[col]) { //if column is not blank\n printf("%c", matrix[row][col]);\n }\n }\n printf("\\n");\n }\n }\n\n return 0;\n}', 'height, width = map(int, input().split())\nlis = [[0 for i in range(width)] for i in range(height)]\nfor i in range(height):\n lis[i] = input()\n\nblank_rows = []\nfor row in range(height):\n if not "#" in lis[row]:\n blank_rows.append(row)\n\nblank_cols = []\nfor col in range(width):\n flag = 1\n for row in range(height):\n if "#" == lis[row][col]:\n flag = 0\n break\n if flag:\n blank_cols.append(col)\n\nfor row in range(height):\n out = ""\n if not row in blank_rows:\n for col in range(width):\n if not col in blank_cols:\n out += lis[row][col]\n if not out == "":\n\t print(out)'] | ['Runtime Error', 'Accepted'] | ['s502680472', 's031563770'] | [2940.0, 3188.0] | [17.0, 22.0] | [1360, 662] |
p03273 | u310431893 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H, W = input().split()\nH = int(H)\nW = int(W)\n\na = [input() for i in range(W)]\n\na = [i for i in a if "#" in i]\nb = ["".join([for a[i]]) for i in range(H) for j in a]\nb = [i for i in b if "#" in i]\n\na = ["".join([for a[i]]) for i in range(len(b)) for j in b]\n\nfor i in a:\n print(i)', 'H, W = tuple(int(i) for i in input().split())\nAs = [input() for i in range(H)]\n\na = [i for i in As if "#" in i]\nb = ["".join(j[i] for j in a) for i in range(W)]\nb_ = [i for i in b if "#" in i]\na_ = ["".join(j[i] for j in b_) for i in range(len(b_[0]))]\n\nfor i in a_:\n print(i)\n'] | ['Runtime Error', 'Accepted'] | ['s093752069', 's310659058'] | [2940.0, 3064.0] | [17.0, 19.0] | [280, 278] |
p03273 | u327532412 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H, W = map(int, input().split())\nG = [list(input()) for _ in range(H)]\nv = [g for g in G if g.count('.') != W]\nprint(v)\nfor i in reversed(range(W)):\n chk = True\n for vv in v:\n if vv[i] == '#':\n chk = False\n break\n if chk:\n for vv in v:\n vv.pop(i)\nfor vv in v:\n print(''.join(vv))", "H, W = map(int, input().split())\nG = [list(input()) for _ in range(H)]\nv = [g for g in G if g.count('.') != W]\nfor i in reversed(range(W)):\n chk = True\n for vv in v:\n if vv[i] == '#':\n chk = False\n break\n if chk:\n for vv in v:\n vv.pop(i)\nfor vv in v:\n print(''.join(vv))"] | ['Wrong Answer', 'Accepted'] | ['s314985211', 's663175817'] | [3316.0, 3064.0] | [19.0, 19.0] | [338, 329] |
p03273 | u330799501 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['#k = int(input())\n#s = input()\n#a, b = map(int, input().split())\n#s, t = map(str, input().split())\n#l = list(map(int, input().split()))\n\n#a = [list(input()) for _ in range(n)]\n\nh,w = map(int, input().split())\na = [input() for _ in range(h)]\n\ny = [False] * h\nx = [False] * w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j] == "#":\n y[i] = True\n x[j] = True\n\nfor i in range(h):\n if y[i]:\n for j in range(w):\n if y[j]:\n print(a[i][j],end="")\n print("")\n\n\n\n', '#k = int(input())\n#s = input()\n#a, b = map(int, input().split())\n#s, t = map(str, input().split())\n#l = list(map(int, input().split()))\n\n#a = [list(input()) for _ in range(n)]\n\nh,w = map(int, input().split())\na = [input() for _ in range(h)]\n\ny = [False] * h\nx = [False] * w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j] == "#":\n y[i] = True\n x[j] = True\n\nfor i in range(h):\n if y[i]:\n for j in range(w):\n if x[j]:\n print(a[i][j],end="")\n print("")\n\n\n\n'] | ['Runtime Error', 'Accepted'] | ['s034790176', 's286851934'] | [9132.0, 9140.0] | [34.0, 38.0] | [587, 587] |
p03273 | u339523379 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['import numpy as np\n\nH,W=map(int,input().split())\nfield=[list(input()) for i in range(H)]\n\nfield=[i for i in field if "#" in i]\n\nfield=np.array(field)\n#print(field)\n\nfield=np.rot90(field,k=1)\nfield=field.tolist()\n\nfield=[i for i in field if "#" in i]\n\nfield=np.rot90(field,k=-1)\nfield=field.tolist()\n\nprint(field)', 'import numpy as np\n\nH,W=map(int,input().split())\nfield=[list(input()) for i in range(H)]\n\nfield=[i for i in field if "#" in i]\n\nfield=np.array(field)\n#print(field)\n\nfield=np.rot90(field,k=1)\nfield=field.tolist()\n\nfield=[i for i in field if "#" in i]\n\nfield=np.rot90(field,k=-1)\nfield=field.tolist()\n\n#print(field)\nfor i in field:\n print("".join(i))'] | ['Wrong Answer', 'Accepted'] | ['s722111219', 's054901135'] | [12644.0, 12536.0] | [154.0, 149.0] | [312, 351] |
p03273 | u342051078 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H,W = map(int,input().split())\ntmp = True\nA = []\nB = []\nfor i in range(H):\n a = list(input())\n if a != [\'.\']*W:\n A.appned(a)\nfor i in range(W):\n cnt = 0\n for j in range(len(A)):\n if A[j][i] != \'.\':\n cnt += 1\n if cnt == 0:\n B.insert(0,i)\nfor i in range(len(A)):\n for j in range(len(B)):\n del A[i][B[j]]\nfor i in range(len(A)):\n ans = "".join(A[i])\n print(ans)\n\n', 'H,W = map(int,input().split())\nA = []\nB = []\nfor i in range(H):\n a = list(input())\n if a != ["."]*W:\n A.append(a)\nfor i in range(W):\n cnt = 0\n for j in range(len(A)):\n if A[j][i] != \'.\':\n cnt += 1\n if cnt == 0:\n B.insert(0,i)\nfor i in range(len(A)):\n for j in range(len(B)):\n del A[i][B[j]]\nfor i in range(len(A)):\n ans = "".join(A[i])\n print(ans)\n\n'] | ['Runtime Error', 'Accepted'] | ['s085308202', 's458427020'] | [3064.0, 3188.0] | [17.0, 19.0] | [423, 412] |
p03273 | u346395915 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H,W = map(int,input().split())\n\nmatrix = [list(map(int,input().replace("#", "1").replace(".","0"))) for _ in range(H)]\n\nans = []\ntemp = []\n\nfor row in matrix:\n if sum(row) != 0:\n ans.append(row)\n\nfor row in zip(*ans):\n temp.append(row)\n\nans = []\nfor row in temp:\n if sum(row) != 0:\n ans.append(row)\n \ntemp = []\nfor row in zip(*ans):\n temp.append(row)\n\n\nfor row in temp:\n res = list(map(str,row))\n res = ",".join(res).replace("1","#").replace("0",".").split(",")\n print(*res)\n \n\n', 'H,W = map(int,input().split())\n\ntemp = [list(map(int,input().replace("#", "1").replace(".","0"))) for _ in range(H)]\n\ncnt = 0\n\n\nwhile cnt != 2:\n ans = []\n s = 0\n for row in temp:\n if sum(row) != 0:\n ans.append(row)\n else:\n s += 1\n if s == 0:\n cnt += 1\n else:\n cnt = 0\n \n \n temp = []\n for row in zip(*ans):\n temp.append(row)\n \n ans = []\n s = 0\n for row in temp:\n if sum(row) != 0:\n ans.append(row)\n else:\n s += 1\n if s == 0:\n cnt += 1\n else:\n cnt = 0\n \n temp = []\n for row in zip(*ans):\n temp.append(row)\n\n\nfor row in temp:\n res = list(map(str,row))\n res = ",".join(res).replace("1","#").replace("0",".").split(",")\n print(*res)\n \n\n', 'H,W = map(int,input().split())\n\ntemp = [list(map(int,input().replace("#", "1").replace(".","0"))) for _ in range(H)]\n\ncnt = 0\n\n\nwhile cnt != 2:\n ans = []\n s = 0\n for row in temp:\n if sum(row) != 0:\n ans.append(row)\n else:\n s += 1\n if s == 0:\n cnt += 1\n else:\n cnt = 0\n \n \n temp = []\n for row in zip(*ans):\n temp.append(row)\n \n ans = []\n s = 0\n for row in temp:\n if sum(row) != 0:\n ans.append(row)\n else:\n s += 1\n if s == 0:\n cnt += 1\n else:\n cnt = 0\n \n temp = []\n for row in zip(*ans):\n temp.append(row)\n\n\nfor row in temp:\n res = list(map(str,row))\n res = ",".join(res).replace("1","#").replace("0",".").split(",")\n print("".join(res))\n \n\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s216249768', 's501456558', 's361161851'] | [3956.0, 3956.0, 3188.0] | [25.0, 25.0, 22.0] | [523, 831, 839] |
p03273 | u347397127 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w=map(int,input().split())\nA=[list(input()) for i in range(w)]\nansw=[]\nansh=[]\nfor i in range(w):\n if not all([a=="." for a in A[i]]):\n answ.append(i)\nfor j in range(h):\n if not all([A[i][j]=="." for i in range(w)]):\n ansh.append(j)\nfor i in answ:\n for j in ansh:\n print(A[i][j],end="")\n print("\\n")\n ', 'h,w=map(int,input().split())\nA=[list(input()) for i in range(h)]\nansw=[]\nansh=[]\nfor i in range(h):\n if not all([a=="." for a in A[i]]):\n answ.append(i)\nfor j in range(w):\n if not all([A[i][j]=="." for i in range(h)]):\n ansh.append(j)\nfor i in answ:\n for j in ansh:\n print(A[i][j],end="")\n print("")'] | ['Runtime Error', 'Accepted'] | ['s971294344', 's404416339'] | [9192.0, 9240.0] | [37.0, 28.0] | [319, 312] |
p03273 | u348285568 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w=map(int,input().split())\ngrid=[list(input()) for i in range(h)]\ntag=[]\nfor i in range(w):\n a=[grid[j][i] for j in range(h)]\n if not "#" in a:tag.append(i)\nfor i in tag[::-1]:\n for j in range(h):\n grid[j].pop(i)\nfor i in grid:\n if "#" in i:print(*i)\n ', 'h,w=map(int,input().split())\nd=[list(input()) for i in range(h)]\nfor i in range(w)[::-1]:\n if not "#" in [d[j][i] for j in range(h)]:\n for j in range(h):del d[j][i]\nfor i in d:\n if "#" in i:print(*i,sep="")'] | ['Wrong Answer', 'Accepted'] | ['s300760490', 's574147732'] | [3828.0, 4596.0] | [22.0, 22.0] | [281, 220] |
p03273 | u366959492 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w=map(int,input().split())\nl=[]\nn=0\nm=0\ncou=0\nfor i in range(h):\n x=input()\n if x==("."*w):\n cou+=1\n continue\n l.append(list(x))\nfor i in range(w):\n k=0\n for j in range(h-cou-1):\n if l[j][i]=="#":\n break\n else:\n k+=1\n if k==h-cou:\n for d in range(h-cou):\n del l[d][i]\nfor i in range(h-cou):\n l[i]="".join(l[i])\n print(l[i])\n\n', 'h,w=map(int,input().split())\na=[list(input()) for i in range(h)]\n#print(a)\nH=[]\nW=[]\nfor i in range(h):\n count=0\n for j in range(w):\n if a[i][j]==".":\n count+=1\n if count==w:\n H.append(i)\nfor i in range(w):\n count=0\n for j in range(h):\n if a[j][i]==".":\n count+=1\n if count==h:\n W.append(i)\nfor i in range(1,len(H)+1):\n for j in range(w):\n a[H[-1*i]][j]=""\nfor i in range(1,len(W)+1):\n for j in range(h):\n a[j][W[-1*i]]=""\n\nfor i in range(h):\n if not ("." in a[i] or "#" in a[i]):\n continue\n print("".join(a[i]))\n'] | ['Wrong Answer', 'Accepted'] | ['s855883930', 's652564680'] | [3064.0, 3188.0] | [19.0, 24.0] | [419, 614] |
p03273 | u369752439 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H, W = list(map(int, input().strip().split(" ")))\n\nfield = []\nhist = [0 for w in range(W)]\n\ndef shrink():\n newField = []\n for h in range(H):\n line = []\n for w in range(W):\n if(hist[w] != H):\n line.append(field[h][w])\n newField.append(line) \n return newField \n\nfor h in range(H):\n line = list(input().strip())\n if(line.count(".") != len(line)):\n field.append(list(line))\n for w in range(W):\n hist[w] += 1 if field[-1][w] == "." else 0 \nH = len(field)\n\nnewField = shrink()\n\nfor h in newField:\n "".join(h)', 'H, W = list(map(int, input().strip().split(" ")))\n\nfield = []\nhist = [0 for w in range(W)]\n\ndef shrink():\n newField = []\n for h in range(H):\n line = []\n for w in range(W):\n if(hist[w] != H):\n line.append(field[h][w])\n newField.append(line) \n return newField \n\nfor h in range(H):\n line = list(input().strip())\n if(line.count(".") != len(line)):\n field.append(list(line))\n for w in range(W):\n hist[w] += 1 if field[-1][w] == "." else 0 \nH = len(field)\n\nnewField = shrink()\n\nfor h in newField:\n print("".join(h))'] | ['Wrong Answer', 'Accepted'] | ['s038985136', 's477390051'] | [3188.0, 3188.0] | [22.0, 22.0] | [607, 617] |
p03273 | u371132735 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H,W = map(int,input().split())\nA = [input() for i in range(H)]\nlow = [False]*H\ncol= [False]*W\nfor l in range(H):\n for c in range(W):\n if A[l][c] == "#":\n low[l] = True\n col[c] = True\nfor l in range(H):\n if low[l] ==True:\n for c in range(W):\n if col[c]==True:\n print("#",end="")\n print()\n', '\nH,W = map(int,input().split())\nglid = [list(input()) for _ in range(H)]\n\nrow = [False]*H\ncol = [False]*W\nfor i in range(H):\n for j in range(W):\n if glid[i][j] == "#":\n row[i] = True\n col[j] = True\nfor i in range(H):\n if row[i]:\n for j in range(W):\n if col[j]:\n print(glid[i][j],end="")\n\n print()'] | ['Wrong Answer', 'Accepted'] | ['s920546113', 's570026506'] | [4468.0, 4596.0] | [31.0, 32.0] | [362, 396] |
p03273 | u371467115 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w=map(int,input().split())\na=[input() for i in range(h)]\n\nprint(a)\n\nfor j in a:\n if '#' not in j:\n a.remove(j)\n h-=1\n \nprint(a)\n \nb=[]\n\nfor k in range(w):\n c=''\n for l in range(h):\n c+=a[l][k]\n b.append(c)\n\nfor m in b:\n if '#' not in m:\n b.remove(m)\n w-=1\n \nprint(b)\n\nfor o in range(h):\n d=''\n for p in range(w):\n d+=b[p][o]\n print(d)", "h,w=map(int,input().split())\na=[input() for i in range(h)]\n\nprint(a)\nprint(h)\nprint(w)\n\nfor j in a:\n if '#' not in j:\n a.remove(j)\n h-=1\n \nprint(a)\nprint(h)\nprint(w)\n \nb=[]\n\nfor k in range(w):\n c=''\n for l in range(h):\n c+=a[l][k]\n b.append(c)\n\nprint(b)\nprint(h)\nprint(w)\n \nfor m in b:\n if '#' not in m:\n b.remove(m)\n w-=1\n \nprint(b)\nprint(h)\nprint(w)\n\nfor o in range(h):\n d=''\n for p in range(w):\n d+=b[p][o]\n print(d)", "h,w=map(int,input().split())\na=[input() for i in range(h)]\n\nfor j in a:\n if '#' not in a:\n a.pop(j)\n h-=1\n \nb=[]\nc=''\n\nfor k in range(w):\n for l in range(h):\n c+=a[l][k]\n b.append(c)\n\nfor m in range(w):\n if '#' not in b:\n b.pop(m)\n w-=1\n \nd=''\n\nfor o in range(h):\n for p in range(w):\n d+=b[p][o]\n print(d)\n ", "H, W = map(int, input().split())\na = []\nfor _ in range(H):\n i = list(input())\n if '#' in i:\n a.append(i)\nans = zip(*[i for i in zip(*a) if '#' in i])\nfor s in ans:\n print(*s, sep='')\n#copy code"] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s216518793', 's327879980', 's807269487', 's287600265'] | [3572.0, 3188.0, 3064.0, 4596.0] | [28.0, 23.0, 24.0, 21.0] | [372, 454, 341, 209] |
p03273 | u373958718 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w=map(int,input().split())\ns=[list(input())for i in range(h)]\nl=[x for x in s if '#' in x]\nans=[]\nfor i in zip(*l):\n if '#' in i:ans.append(i)\nfor x in ans:\n print(''.join(x))", "h,w=map(int,input().split())\ns=[list(input())for i in range(h)]\nl=[x for x in s if '#' in x]\nans=[]\nfor i in zip(*l):\n if '#' in i:ans.append(i)\nan=zip(*ans)\nfor x in an:\n print(''.join(x))"] | ['Wrong Answer', 'Accepted'] | ['s961253455', 's493155638'] | [3188.0, 3188.0] | [18.0, 18.0] | [179, 191] |
p03273 | u375695365 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w=map(int,input().split())\na=[[0 for _ in range(h)] for _ in range(w)]\nans=[]\nprint(a)\nfor i in range(h):\n b=list(input())\n if \'#\' in b:\n for j in range(w):\n a[j][i]=b[j]\n\n #print(a[i])\nc=0\nfor i in range(0-c,w-c):\n if \'#\' not in a[i]:\n for j in range(h):\n a[i][j]=0\nfor i in range(h):\n for j in range(w):\n if a[j][i]!=0:\n print(a[j][i],end="")\n c+=1\n if c!=0:\n print()\n c=0\n\n', 'h,w=map(int,input().split())\na=[[0 for _ in range(h)] for _ in range(w)]\nans=[]\n#print(a)\nfor i in range(h):\n b=list(input())\n if \'#\' in b:\n for j in range(w):\n a[j][i]=b[j]\n\n #print(a[i])\nc=0\nfor i in range(0-c,w-c):\n if \'#\' not in a[i]:\n for j in range(h):\n a[i][j]=0\nfor i in range(h):\n for j in range(w):\n if a[j][i]!=0:\n print(a[j][i],end="")\n c+=1\n if c!=0:\n print()\n c=0\n\n\n \n '] | ['Wrong Answer', 'Accepted'] | ['s511311385', 's515637768'] | [4724.0, 4596.0] | [34.0, 33.0] | [503, 530] |
p03273 | u384679440 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H, W = map(int, input().split())\na = [input() for _ in range(H)]\nrow = [False] * H\ncol = [False] * W\nfor i in range(len(row)):\n for j in range(len(col)):\n if a[i][j] == '#':\n row[i] = col[j] = True\n\nfor i in range(len(row)):\n if row[i]:\n for j in range(len(col)):\n if col[j]:\n print(a[i][j], '')\n print()", "H, W = map(int, input().split())\na = [input() for _ in range(H)]\nrow = [False] * H\ncol = [False] * W\nfor i in range(len(row)):\n for j in range(len(col)):\n if a[i][j] == '#':\n row[i] = col[j] = True\n\nfor i in range(len(row)):\n if row[i]:\n for j in range(len(col)):\n if col[j]:\n print(a[i][j], end = '')\n print()"] | ['Wrong Answer', 'Accepted'] | ['s826784626', 's776804265'] | [3996.0, 4468.0] | [29.0, 30.0] | [332, 338] |
p03273 | u390883247 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H,W = map(int,input().split())\nData1 = []\n\nfor _ in range(H):\n Data1.append(s)\n\nhdata = {}\nwdata = {}\n\nfor h in range(H):\n for w in range(W):\n if Data1[h][w] == '#':\n hdata.add(h)\n wdata.add(w)\n\nfor h in range(H):\n for w in range(W):\n if h in hdata or w in wdata:\n print(Data[h][w],end='')", "H,W = map(int,input().split())\nData = []\n\nfor _ in range(H):\n Data.append(input())\n\nhdata = set()\nwdata = set()\n\nfor h in range(H):\n for w in range(W):\n if Data[h][w] == '#':\n hdata.add(h)\n wdata.add(w)\n\nfor h in range(H):\n output = False\n for w in range(W):\n if h in hdata and w in wdata:\n print(Data[h][w],end='')\n output = True\n if output:\n print('')\n"] | ['Runtime Error', 'Accepted'] | ['s222418305', 's644221899'] | [3064.0, 4468.0] | [17.0, 33.0] | [345, 434] |
p03273 | u393512980 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["H, W = map(int, input().split())\nf = [input() for _ in range(H)]\nwhile True:\n flag = False\n for y in range(H):\n if '#' not in f[y]:\n del f[y]\n H -= 1\n flag = True\n break\n for x in range(W):\n for y in range(H):\n if f[y][x] == '#':\n break\n for y in range(H):\n del f[x][y]\n flag = True\n break\n if not flag:\n break\n\nfor i in range(H):\n print(f[i])\n\t", 'H, W = map(int, input().split())\nf = [list(input()) for _ in range(H)]\nY, X = [False for _ in range(H)], [False for _ in range(W)]\nfor y in range(H):\n for x in range(W):\n Y[y] |= f[y][x] == \'#\'\n X[x] |= f[y][x] == \'#\'\nfor y in range(H):\n flag = False\n for x in range(W):\n if Y[y] and X[x]:\n print(f[y][x], end = "")\n flag = True\n if flag:\n print()'] | ['Runtime Error', 'Accepted'] | ['s698004356', 's602329795'] | [3064.0, 4596.0] | [18.0, 33.0] | [405, 409] |
p03273 | u394033362 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['import numpy as np\n\nH,W=map(int,input().split())\na=np.zeros((H,W))\nfor i in range(H):\n tmp = input()\n for j in range(W):\n if tmp[j] == "#":\n a[i][j]=1\n\ntmp=[]\nfor i in range(H):\n if np.sum(a[i])==0:\n tmp.append(i)\na = np.delete(a,tmp,0)\n\nh=len(tmp)\n\na = a.T\n\ntmp=[]\nfor i in range(W):\n if np.sum(a[i])==0:\n tmp.append(i)\na = np.delete(a,tmp,0)\n \na = a.T\n\nw = len(tmp)\n\nans = list(a)\n\nprint(a)\nfor i in range(H-h):\n tmp=a[i]\n for j in range(W-w):\n if tmp[j] == 1:\n print("#", end="")\n else:\n print(".", end="")\n print()\n', 'import numpy as np\n\nH,W=map(int,input().split())\na=np.zeros((H,W))\nfor i in range(H):\n tmp = input()\n for j in range(W):\n if tmp[j] == "#":\n a[i][j]=1\n\ntmp=[]\nfor i in range(H):\n if np.sum(a[i])==0:\n tmp.append(i)\na = np.delete(a,tmp,0)\n\nh=len(tmp)\n\na = a.T\n\ntmp=[]\nfor i in range(W):\n if np.sum(a[i])==0:\n tmp.append(i)\na = np.delete(a,tmp,0)\n \na = a.T\n\nw = len(tmp)\n\nans = list(a)\n\nfor i in range(H-h):\n tmp=a[i]\n for j in range(W-w):\n if tmp[j] == 1:\n print("#", end="")\n else:\n print(".", end="")\n print()\n'] | ['Wrong Answer', 'Accepted'] | ['s210459468', 's124713462'] | [13908.0, 13784.0] | [182.0, 178.0] | [622, 613] |
p03273 | u395086545 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h, w = map(int, input().split())\n\nmatrix = []\n\nfor i in range(h):\n row = list(input())\n if '#' not in row:\n continue\n else:\n matrix.append(row)\n\nprint(matrix)\nremoved_index = []\n\nfor i in range(len(matrix[0])):\n col = [row[i] for row in matrix]\n if '#' not in col:\n removed_index.append(i)\n\nremoved_index.reverse()\n\nfor n in removed_index:\n for row in matrix:\n \tdel row[n]\n\nfor row in matrix:\n print(''.join(row))\n", "h, w = map(int, input().split())\n\nmatrix = []\n\nfor i in range(h):\n row = list(input())\n if '#' not in row:\n continue\n else:\n matrix.append(row)\n\nprint(matrix)\nremoved_index = []\n\nfor i in range(len(matrix[0])):\n col = [row[i] for row in matrix]\n if '#' not in col:\n removed_index.append(i)\n\nremoved_index.reverse()\n\nfor n in removed_index:\n for row in matrix:\n \tdel row[n]\n\nfor row in matrix:\n print(' '.join(row))\n", "h, w = map(int, input().split())\n\nmatrix = []\n\nfor i in range(h):\n row = list(input())\n if '#' not in row:\n continue\n else:\n matrix.append(row)\n\nremoved_index = []\n\nfor i in range(len(matrix[0])):\n col = [row[i] for row in matrix]\n if '#' not in col:\n removed_index.append(i)\n\nremoved_index.reverse()\n\nfor n in removed_index:\n for row in matrix:\n \tdel row[n]\n\nfor row in matrix:\n print(''.join(row))\n"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s124128650', 's491044963', 's973979535'] | [3316.0, 3316.0, 3060.0] | [19.0, 20.0, 18.0] | [431, 432, 417] |
p03273 | u396495667 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ["h,w = map(int, input().split())\na = [(_ for _ in input()) for i in range(h)]\nb = [x for x in a if '#' in x]\nc = zip(*[y for y in zip(*b) if '#' in y])\n\nfor d in c:\n print(''.join(d))", "h,w = map(int, input().split())\na = [[j for j in input()]for i in range(h)]\nb = [x for x in a if '#' in x]\nc = zip(*[y for y in zip(*b) if '#' in y])\nfor d in c:\n print(''.join(d))"] | ['Wrong Answer', 'Accepted'] | ['s139201676', 's597246294'] | [3188.0, 3188.0] | [18.0, 18.0] | [183, 181] |
p03273 | u403984573 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['H, W = map(int, input().split())\na = [input() for i in range(H)]\nres = [0 for i in range(W)]\nfor i in range(W):\n for j in range(H):\n if a[j][i] != ".":\n break\n res[i] += 1\nfor i in range(H):\n for j in range(W):\n if res[j] != H:\n print(a[i][j],end="")\n print("")', 'H, W = map(int, input().split())\na = [input() for i in range(H)]\nres = [0 for i in range(W)]\nfor i in range(W):\n for j in range(H):\n if a[j][i] != ".":\n break\n res[i] += 1\nfor i in range(H):\n if a[i][0:].count("#") >0:\n for j in range(W):\n if res[j] != H:\n print(a[i][j],end="")\n print("")'] | ['Wrong Answer', 'Accepted'] | ['s485951540', 's754082376'] | [4468.0, 4468.0] | [29.0, 30.0] | [283, 320] |
p03273 | u410118019 | 2,000 | 1,048,576 | There is a grid of squares with H horizontal rows and W vertical columns. The square at the i-th row from the top and the j-th column from the left is represented as (i, j). Each square is black or white. The color of the square is given as an H-by-W matrix (a_{i, j}). If a_{i, j} is `.`, the square (i, j) is white; if a_{i, j} is `#`, the square (i, j) is black. Snuke is compressing this grid. He will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares: * Operation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns. It can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation. Find the final state of the grid. | ['h,w=map(int,input().split())\na=[]\nfor i in range(h):\n aa=list(input())\n if "#" not in aa:\n continue\n else:\n a.append(aa)\nfor i in range(w):\n c=0\n for j in range(len(a)):\n if a[j][i]=="#":\n c+=1\n if c==0:\n for j in range(len(a)):\n del a[j][i]\nfor i in range(len(a)):\n print("".join(a[i]))', 'h,w=map(int,input().split())\na=[]\nfor i in range(h):\n aa=list(input())\n if "#" not in aa:\n continue\n else:\n a.append(aa)\naa=[]\nfor i in range(w):\n c=0\n for j in range(len(a)):\n if a[j][i]=="#":\n c+=1\n if c==0:\n aa.append(i)\naa.reverse()\nfor i in aa:\n for j in range(len(a)):\n del a[j][i]\nfor i in range(len(a)):\n print("".join(a[i]))\n'] | ['Runtime Error', 'Accepted'] | ['s222048910', 's610860259'] | [3064.0, 3188.0] | [19.0, 19.0] | [316, 362] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.