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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03273 | u414558682 | 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... | ['h, w = map(int, input().split())\n\nl = []\nll = [[True for i in range(w)] for j in range(h)]\nfor _ in range(h):\n s = input()\n cells = list(s)\n # print(cells)\n l.append(cells)\n \n# print(l)\n\nfor h_i in range(h):\n flag = True\n for w_i in range(w):\n # print(l[h_i][w_i])\n i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s060889306', 's754551556', 's939909724'] | [9004.0, 8880.0, 9412.0] | [26.0, 23.0, 33.0] | [891, 891, 890] |
p03273 | u426108351 | 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... | ["H, W = map(int, input().split())\ngrid = []\nfor i in range(H):\n line = input()\n for i in range(len(line)):\n if line[i] == '#':\n grid.append(line)\n break\ngridans = [[''] for i in range(len(grid))]\nfor i in range(W):\n flag = 0\n for j in range(len(grid)):\n if grid[j][i] == '#':\n flag... | ['Wrong Answer', 'Accepted'] | ['s515719966', 's719909290'] | [3188.0, 3064.0] | [23.0, 22.0] | [438, 444] |
p03273 | u445226180 | 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... | ['H,W=map(int,input().split(" "))\n\ndef whitel(gyo):\n ans=0\n for i in range(len(gyo)):\n if gyo[i]=="#":\n ans=1\n break\n return ans\n\nA=[]\nfor i in range(H):\n gyo=input()\n if whitel(gyo)==1:\n A.append(gyo)\n\nfor i in range(len(A)):\n print(A[i])', 'import... | ['Wrong Answer', 'Accepted'] | ['s264554119', 's772147863'] | [3064.0, 21504.0] | [18.0, 1299.0] | [291, 509] |
p03273 | u445628522 | 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... | ['H,W=mamp(int,input().split())\nbd=[]\n\nfor i in range(H):\n bd.append(input())\n\nx=set()\ny=set()\n\nfor i in range(H):\n for j in range(W):\n if bd[i][j]=="#":\n x.add(j)\n y.add(i)\nfor i in y:\n for j in x:\n print(b... | ['Runtime Error', 'Accepted'] | ['s265505861', 's775200566'] | [3064.0, 4468.0] | [17.0, 31.0] | [333, 332] |
p03273 | u456416458 | 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... | ["s = input().split()\n\nh = int(s[0])\nw = int(s[1])\n\nfor i in range(h):\n check = False\n v = input()\n x = list(v)\n for j in range(w):\n if x[j] == '#':\n check = True\n break\n if check:\n print(v)\n", "s = input().split()\n\nh = int(s[0])\nw = int(s[1])\n\nline... | ['Wrong Answer', 'Accepted'] | ['s108140527', 's436114984'] | [9156.0, 9160.0] | [32.0, 36.0] | [240, 473] |
p03273 | u463655976 | 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... | ['H, W = map(int, input().split())\n\nHcnt = [0] * H\nWcnt = [0] * W\n\nL = [list(input()) for _ in range(H)]\n\nfor i, s in enumerate(L):\n for j, c in enumerate(s):\n if c == "#":\n Hcnt[i] += 1\n Wcnt[j] += 1\n\nfor i, s in enumerate(L):\n p = ""\n for j, c in enumerate(s):\n if Hcnt[i] > 0 and Wc... | ['Wrong Answer', 'Accepted'] | ['s599884884', 's900032021'] | [3064.0, 4596.0] | [25.0, 31.0] | [365, 353] |
p03273 | u464912173 | 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... | [" h, w = map(int, input().split())\n a = []\n for _ in range(h):\n l = input()\n if l != '.'*w:\n a.append(l)\n col = []\n h = len(a)\n for i in range(w):\n if a[0][i] == '.':\n for j in range(1,h):\n if a[j][i] != '.':\n co... | ['Runtime Error', 'Accepted'] | ['s117245867', 's684874090'] | [2940.0, 3064.0] | [17.0, 20.0] | [874, 394] |
p03273 | u466331465 | 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... | ['H,W = [int(x) for x in input().split()]\nans = []\nfor i in range(H):\n cnt= 0\n S = list(input())\n for j in range(W):\n if S[j]==".":\n cnt +=1\n if cnt!=W:\n ans.append(S)\nans1 = []\nfor j in range(len(ans[0])):\n cnt = 0\n for i in range(len(ans)):\n if ans[i][j]==".":\n cnt+=1\n if cnt... | ['Runtime Error', 'Accepted'] | ['s803419516', 's050515898'] | [3064.0, 4596.0] | [18.0, 32.0] | [509, 510] |
p03273 | u477650749 | 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... | ["def abc():\n h, w = map(int, input().split())\n lines = []\n for i in range(h):\n line = list(input().rstrip())\n if '#' in line:\n lines.append(line)\n\n for x in reversed(range(w)):\n if len([l for l in lines if l[x] == '#']) == 0:\n for l in lines:\n ... | ['Wrong Answer', 'Accepted'] | ['s267519008', 's039839236'] | [3060.0, 4468.0] | [17.0, 30.0] | [373, 319] |
p03273 | u485319545 | 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... | ["h,w=map(int,input().split())\ngrid=[]\nfor _ in range(h):\n grid.append(list(input()))\n\nrow=[]\ncol=[]\n\nfor i in range(h):\n flg=0\n for j in range(w):\n if grid[i][j]=='#':\n flg=1\n\n if flg==0:\n row.append(i)\n\n\nfor j in range(w):\n flg=0\n for i in range(h):\n ... | ['Wrong Answer', 'Accepted'] | ['s162236138', 's303945256'] | [9232.0, 9208.0] | [39.0, 41.0] | [634, 650] |
p03273 | u485566817 | 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... | ['h, w = map(int, input().split())\na = [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 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]... | ['Runtime Error', 'Accepted'] | ['s273853460', 's344024044'] | [4468.0, 4468.0] | [31.0, 29.0] | [363, 363] |
p03273 | u488127128 | 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... | ["H,W = map(int, input().split())\nA = [input() for h in range(H)]\nA = [list(a) for a in A if '#' in a]\nprint(A)\nw = 0\nwhile w < W:\n for a in A:\n if a[w]=='#':\n break\n else:\n for a in A:\n a.pop(w)\n W -= 1\n w -= 1\n w += 1\nfor a in A:\n print(''.... | ['Wrong Answer', 'Accepted'] | ['s970706249', 's206461248'] | [3316.0, 3188.0] | [19.0, 18.0] | [310, 205] |
p03273 | u492030100 | 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... | ["def str_del(string,index):\n string = string[:index]+string[index+1:]\n return string\n\n\nH,W=map(int,input().split())\nlines=[]\nfor i in range(H):\n get=input()\n flag=True\n for s in get:\n if s=='#':\n flag=False\n break\n if not flag:\n lines.append(get)\n ... | ['Wrong Answer', 'Accepted'] | ['s407938199', 's581829365'] | [3064.0, 3064.0] | [20.0, 20.0] | [787, 743] |
p03273 | u501163846 | 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... | ['h,w=map(int,input().split())\nl=[]\nfor i in range(h):\n l.append(list(map(str,input())))\nprint(l)\n\nrow=[False]*h\ncol=[False]*w\nfor i in range(h):\n for k in range(w):\n if l[i][k]=="#":\n row[i]=True\n col[k]=True\nfor i in range(h):\n if row[i]:\n for k in range(w):... | ['Wrong Answer', 'Accepted'] | ['s480833656', 's651833756'] | [4720.0, 4596.0] | [33.0, 32.0] | [384, 375] |
p03273 | u502389123 | 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... | ["H, W = map(int, input().split())\nmaze = [input() for _ in range(H)]\n\nindex_h = []\nindex_w = []\n\nfor i in range(H):\n for j in range(W):\n if maze[i][j] == '#':\n break\n if j == W - 1:\n index_h.append(i)\n\nfor j in range(W):\n for i in range(H):\n if maze[i][j]... | ['Wrong Answer', 'Accepted'] | ['s585102167', 's543656063'] | [4468.0, 4468.0] | [30.0, 31.0] | [551, 619] |
p03273 | u505830998 | 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... | ['import sys\nimport numpy as np\n\ninput_methods=[\'clipboard\',\'file\',\'key\']\nusing_method=0\ninput_method=input_methods[using_method]\n\ntin=lambda : map(int, input().split())\nlin=lambda : list(tin())\nmod=1000000007\n\n#+++++\n\ndef kk(al):\n\tfor i in range(len(al)-1, -1, -1):\n\t\tif list(al[i]) == [\'.\']*l... | ['Wrong Answer', 'Accepted'] | ['s361131628', 's342217082'] | [13224.0, 12532.0] | [163.0, 162.0] | [1090, 1098] |
p03273 | u506287026 | 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... | ["import functools\nimport numpy as np\nH, W = map(int, input().split())\nmat = np.array([list(input()) for _ in range(H)])\n\n\ndef get_bool(x, value, axis):\n return np.where(x == value, True, False).all(axis=axis)\n\n\ncustom_get_bool = functools.partial(mat, '.')\nmat = mat[:, ~custom_get_bool(0)]\nmat = mat[~cu... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s310204521', 's458854816', 's286282987'] | [12540.0, 13260.0, 12540.0] | [152.0, 164.0, 154.0] | [372, 374, 383] |
p03273 | u513081876 | 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... | ["H, W = map(int, input().split())\na = []\nfor i in range(H):\n a.append(input())\n\n\nfor index, i in enumerate(a):\n if i == '.'*W:\n a.remove('.'*W)\n\n\naa = list(map(list, zip(*a)))\n\n\nfor index, i in enumerate(aa):\n if i == ['.']*len(aa[0]):\n aa.remove(tamesi)\n\naaa = list(map(list, z... | ['Runtime Error', 'Accepted'] | ['s127729716', 's672836313'] | [3188.0, 3064.0] | [18.0, 19.0] | [346, 915] |
p03273 | u519452411 | 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... | ['h,w = [int(_) for _ in input().split()]\nboard = [ list(input()) for _ in range(h)]\n\ngoodx = [False] * w\ngoody = [False] * h\n\nfor i in range(w):\n for j in range(h):\n print("i ={}, j ={}".format(i,j))\n if board[i][j] == \'#\':\n goodx[i] = True\n goody[j] = True\n\nfor i in range(w):\n if go... | ['Runtime Error', 'Accepted'] | ['s166017725', 's222692273'] | [4428.0, 4596.0] | [40.0, 30.0] | [400, 421] |
p03273 | u528748570 | 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... | ['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\nprint(row, col)\n\nfor i in range(H):\n if row[i]:\n f... | ['Wrong Answer', 'Accepted'] | ['s502917416', 's537202791'] | [4212.0, 4468.0] | [31.0, 30.0] | [400, 384] |
p03273 | u530383736 | 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... | ['# -*- coding: utf-8 -*-\nimport pprint\n\nH,W = list(map(int, input().rstrip().split()))\na_list=[list(input().rstrip()) for i in range(H)]\n#-----\n\nrow_del_list=[]\nfor i,v in enumerate(a_list):\n if v.count(".") == W:\n row_del_list.append(i)\n\nfor i in row_del_list[::-1]:\n del a_list[i]\n H -= ... | ['Wrong Answer', 'Accepted'] | ['s460815811', 's459063837'] | [4340.0, 5108.0] | [29.0, 30.0] | [672, 661] |
p03273 | u538739837 | 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... | ["import numpy as np\nh,w=map(int,input().split())\n\nicon=[''] * h\nfor i in range(h):\n a[i]=input()\n\n\nrow=[False]*h\ncol=[False]*w\n\nfor i in range(h):\n for j in range(w):\n if icon[i][j]=='#':\n row[i]=True\n col[j]=True\n\nfor i in range(h):\n if row[i]==True:\n f... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s303596438', 's470599443', 's729032599'] | [21652.0, 12392.0, 13788.0] | [320.0, 152.0, 160.0] | [581, 422, 583] |
p03273 | u549383771 | 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... | ["import numpy as np\nh,w = map(int,input().split())\ngraph = [['.' for j in range(w)]for i in range(h)]\n\n\nfor i in range(h):\n tmp = input()\n for j in range(len(tmp)):\n graph[i][j] = tmp[j]\ngraph = np.array(graph)\n\nflag = True\nwhile flag:\n flag = False\n for i in range(graph.shape[1]-1):\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s821775405', 's834366947', 's708362111'] | [13252.0, 13248.0, 13928.0] | [223.0, 221.0, 230.0] | [1222, 1247, 1222] |
p03273 | u556225812 | 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... | ["H, W = map(int, input().split())\nlst = []\nfor i in range(H):\n lst.append(list(input()))\nfor i in range(H-1, -1, -1):\n if '#' not in lst[i]:\n del lst[i]\nfor j in range(W-1, -1, -1):\n cnt = 0\n for i in range(len(lst)):\n if lst[i][j] == '#':\n cnt += 1\n if cnt == 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s828657369', 's071347019'] | [3828.0, 3064.0] | [22.0, 19.0] | [390, 398] |
p03273 | u569970656 | 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... | ["h, w = map(int, input().split())\na = [[input()] for _ in range(h)]\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\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s003077240', 's417577497', 's664765502'] | [3064.0, 3064.0, 4468.0] | [17.0, 17.0, 31.0] | [363, 371, 318] |
p03273 | u572343785 | 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... | ['h,w=map(int,input().split())\na=[]\nfor i in range(h):\n a.append(input())\nH=[]\nW=[]\nfor i in range(h):\n for j in range(w):\n if a[i][j]=="#":\n H.append(i)\n W.append(j)\nfor j in H:\n ans=[]\n for i in W:\n ans.append(a[j][i])\nprint("".join(ans))\n', 'h,w=map(int... | ['Wrong Answer', 'Accepted'] | ['s702506156', 's113811202'] | [3316.0, 3316.0] | [2104.0, 23.0] | [287, 314] |
p03273 | u578489732 | 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... | ["# -*- coding: utf-8 -*-\nH, W = map(int, input().split(' '));\n\nboard = []\nflags = [ True for x in range(W)]\nfor i in range(H):\n line = list(input())\n if ( '#' in line ):\n board.append(line)\n flags = [ f and s == '.' for s,f in zip(line, flags) ]\n\nj = 0\nfor i, flag in enumerate(flags):\n... | ['Runtime Error', 'Accepted'] | ['s349857818', 's901665587'] | [3188.0, 3828.0] | [19.0, 22.0] | [421, 395] |
p03273 | u580404776 | 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... | ['H, W = map(int, input().split())\na = [list(input()) for _ in range(H)]\nprint(a)\n\na = list(zip(*[i for i in a if "#" in i]))\nprint(a)\na = list(zip(*[j for j in a if "#" in j]))\nprint(a)\n\nfor n in range(len(a)):\n print("".join(a[n]))', 'H, W = map(int, input().split())\na = [list(input()) for _ in range(H)... | ['Wrong Answer', 'Accepted'] | ['s207328873', 's496279722'] | [3384.0, 3188.0] | [20.0, 18.0] | [234, 207] |
p03273 | u581187895 | 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... | ['import numpy as np\nh, w = map(int, input().split())\n\ngrid = [list(input()) for _ in range(h)]\ngrid = [row for row in grid if row.count(".") != len(row)]\ngrid = [row for row in np.rot90(grid, k=1) if np.count_nonzero(row == ".") != len(row)]\n[print(row) for row in np.rot90(grid, k=-1)]', 'import numpy as np\n\nh... | ['Wrong Answer', 'Accepted'] | ['s267297913', 's344918614'] | [12544.0, 12452.0] | [175.0, 160.0] | [285, 252] |
p03273 | u597374218 | 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... | ['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 zip(*c):print("".join(d))', 'h,w=map(int,input().split())\na=[]\nfor i in range(h):\n x = input()\n if "#" in x:\n a.append(x)\na=list(zip(*a))\nprint... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s285206606', 's882469173', 's623184663'] | [3316.0, 3444.0, 3188.0] | [19.0, 20.0, 19.0] | [176, 243, 158] |
p03273 | u597509593 | 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... | ["import numpy as np\n\nH, W = list(map(int, input().split()))\narr = np.array([list(input()) for i in range(H)])\narr = arr[(np.apply_along_axis(lambda line: '#' in line, 1, arr))]\narr = arr[:, (np.apply_along_axis(lambda line: '#' in line, 0, arr))]\nprint(arr)\n", "import numpy as np\n\nH, W = list(map(int, input()... | ['Wrong Answer', 'Accepted'] | ['s135828193', 's698002794'] | [21116.0, 21260.0] | [293.0, 346.0] | [257, 291] |
p03273 | u598229387 | 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... | ["h,w=map(int,input().split())\na=[[i for i in input()] for j in range(h)]\n\nx=[False]*w\ny=[False]*h\n\nfor i in range(h):\n for j in range(w):\n if a[i][j]=='#':\n x[j]=True\n y[i]=True\n\n\nfor i in range(h):\n li=[]\n for j in range(w):\n if x[j]==True and y[i]==True:\n... | ['Wrong Answer', 'Accepted'] | ['s441577540', 's908701158'] | [3828.0, 3064.0] | [28.0, 24.0] | [359, 367] |
p03273 | u614314290 | 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... | ['H, W = map(int, input().split())\nSTAGE = [input() for _ in range(H)]\n\n#print("")\n\nccheck = 0\nfor l in STAGE:\n\tif "#" not in l:\n\t\tSTAGE.remove(l)\n\telse:\n\t\tccheck |= int(l.replace("#", "1").replace(".", "0"), 2)\n\n#print(bin(ccheck))\n\nfor l in STAGE:\n\tprint(l)\n\n', 'H, W = map(int, input().split()... | ['Wrong Answer', 'Accepted'] | ['s018948737', 's337562660'] | [3060.0, 4468.0] | [17.0, 26.0] | [259, 311] |
p03273 | u619144316 | 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... | ["import numpy as np\n\nH,W = map(int,input().split())\nMAP = []\nfor _ in range(H):\n tmp = tuple(input())\n MAP.append(tmp)\n\nMAP = np.array(MAP)\nL = []\nfor i in range(H):\n if all(MAP[i,:] == '.'):\n L.append(i)\n\nMAP = np.delete(MAP,L,0)\n\nL = []\nfor i in range(W):\n if all(MAP[:,i] == '.')... | ['Wrong Answer', 'Accepted'] | ['s503642786', 's458294952'] | [18464.0, 12504.0] | [282.0, 155.0] | [375, 387] |
p03273 | u620238824 | 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... | ['H, W = list(map(int, input().split())) \nA = list(input() for i in range(H)) \n#A = [input() for _ in range(H)]\n\nB = [False] * H\nC = [False] * W\n\nprint(A)\nfor i in range(H):\n for j in range(W):\n if A[i][j] == "#":\n B[i] = True\n C[j] = True\n\nfor i in range(H):\n\tif B[i]:\n... | ['Wrong Answer', 'Accepted'] | ['s879725807', 's004018279'] | [4468.0, 4468.0] | [32.0, 30.0] | [413, 404] |
p03273 | u620945921 | 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... | ["h,w=input().split()\ncnt=0\nb=[]\nfor i in range(int(h)):\n a=input()\n if a.count('.') < int(w):\n b.append(a)\n\nfor i in range(len(b)):\n print(b[i])\n\nprint(len(b))\n\nc=[]\nfor j in range(len(b[0])):\n for i in range(len(b)):\n c.append(b[i][j])\n \nprint(c)", "import numpy as np\n\nh,w=input().spl... | ['Wrong Answer', 'Accepted'] | ['s942478689', 's318102196'] | [3316.0, 13920.0] | [20.0, 163.0] | [259, 663] |
p03273 | u623601489 | 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... | ['h,w=map(int,input().split())\nlst=list(input() for i in range(h))\nfor a in lst:\n if a=="."*w:\n h-=1\n lst.remove(a)\nfor i in range(w):\n T=True\n if i>w:\n break\n for b in range(h):\n if lst[b][i]!="." :\n T=False\n break\n if T==True:\n for... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s254680275', 's282366256', 's332367424', 's635934912', 's735116045', 's762771770', 's815602262'] | [3064.0, 3064.0, 3188.0, 12404.0, 3188.0, 3188.0, 3188.0] | [18.0, 18.0, 18.0, 149.0, 18.0, 18.0, 19.0] | [420, 435, 425, 285, 421, 450, 417] |
p03273 | u623687794 | 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,b=map(int,input().split())\nc=[]\nfor i in range(a):\n g=input()\n if "#" not in g:\n continue\n d=list(g)\n c.append(d)\nl=len(c)\np=[]\nfor i in range(b):\n for j in range(l):\n if c[j][i]=="#":\n p.append(i)\n continue\nfor i in range(l):\n for j in range(len(p)):\n if j == len(p)-1:\n ... | ['Wrong Answer', 'Accepted'] | ['s226559341', 's450207911'] | [5616.0, 4596.0] | [1402.0, 32.0] | [365, 361] |
p03273 | u626881915 | 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... | ['h,w = map(int,input().split())\nmat = []\nfor i in range(h):\n g = list(input().split())\n if g.count(".") != w:\n mat.append(g)\n\nfor i in range(w-1, -1, -1):\n count = 0\n for j in range(len(mat)):\n if mat[j][i] == ".":\n count += 1\n if count == len(mat):\n for j in range(len(mat)):\n mat... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s437089901', 's714033869', 's463576865'] | [3064.0, 3064.0, 3064.0] | [18.0, 20.0, 20.0] | [372, 366, 365] |
p03273 | u627530854 | 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... | ['rows, cols = map(int, input().split())\nmat = [input() for _ in range(rows)]\n\nprint_row = [False for _ in range(rows)]\nprint_col = [False for _ in range(cols)]\n\nfor i in range(rows):\n for j in range(cols):\n if mat[i][j] == \'#\':\n print_row[i] = True\n print_col[i] = True\n \nfor i in range... | ['Runtime Error', 'Accepted'] | ['s531359262', 's571691547'] | [4468.0, 4468.0] | [30.0, 32.0] | [413, 482] |
p03273 | u628965061 | 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... | ['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 i in range(w):\n\t\tif a[i][j]=="#":\n\t\t\trow[i]=True\n\t\t\tcol[j]=True\n\t\t\t\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],en... | ['Runtime Error', 'Accepted'] | ['s401412960', 's036768059'] | [3064.0, 4468.0] | [17.0, 32.0] | [295, 293] |
p03273 | u655975843 | 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... | ["h, w = map(int, input().split())\na = []\nfor i in range(h):\n\ta.append(list(input()))\n\n\ntemp1 = []\ntemp2 = []\nfor i in range(len(a)):\n\tff = 0\n\tfor j in range(len(a[i])):\n\t\tif a[i][0] == '.':\n\t\t\tcontinue\n\t\tff = 1\n\tif ff == 0:\n\t\ttemp1.append(i)\ntemp1.sort(reverse=True)\nfor i in range(len(a[0... | ['Wrong Answer', 'Accepted'] | ['s701567674', 's101888884'] | [3188.0, 3188.0] | [23.0, 23.0] | [629, 629] |
p03273 | u657913472 | 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... | ["f=lambda s:zip(*[t for t in s if'#'in t]);\nfor r in f(f(__import__('sys').stdin)):print(*r)", "f=lambda s:zip(*[t for t in s if'#'in t]);\nfor r in f(f(__import__('sys').stdin)):print(*r,sep='')"] | ['Wrong Answer', 'Accepted'] | ['s069344784', 's060198032'] | [3828.0, 4468.0] | [21.0, 21.0] | [91, 98] |
p03273 | u665038048 | 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... | ["H, W = map(int, input().split())\na = []\nfor i in range(H):\n a.append(input())\nprint(a[0][0])\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\nfor i in range(H):\n if row[i]:\n for j in rang... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s055157274', 's356107733', 's163711230'] | [4468.0, 2940.0, 4468.0] | [30.0, 18.0, 29.0] | [387, 175, 372] |
p03273 | u673338219 | 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... | ['h,w = map(int,input().split())\na = [""]*h\nfor i in range(h):\n a[i] = input()\n\nrow = [False]*h\ncolumn = [False]*w\n\nfor i in range(h):\n for j in range(w):\n if a[i][j] = "#":\n row[i] = True\n column[j] = True\n\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if column[j]:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s411589552', 's824391615', 's043658473'] | [2940.0, 3060.0, 4468.0] | [17.0, 17.0, 31.0] | [363, 361, 362] |
p03273 | u686036872 | 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... | ['H, W = map(int, input().split())\na = [list(input()) for i in range(H)]\na = list(zip(*[i for i in a if "#" in a]))\na = list(zip(*[i for i in a if "#" in a]))\nfor i in range(len(a)):\n print("".join(a[i]))', 'H, W = map(int, input().split())\na = [list(input()) for i in range(H)]\na = zip(*[i for i in a if "#" i... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s805470771', 's983786473', 's047893740'] | [3060.0, 3060.0, 4724.0] | [18.0, 18.0, 21.0] | [205, 193, 262] |
p03273 | u690442716 | 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... | ["import sys\nH_W = list(map(int,input().split()))\nH = H_W[0]\nW = H_W[1]\nb = [[0 for i in range(W)] for j in range(H)]\na = [[str(c) for c in l.strip()] for l in sys.stdin]\n\n\nfor i in range(H):\n for j in range(W):\n if a[i][j] == '#':\n b[i][j] = 1\n\n\nw = [0] * W\nh = [0] * H\nfor i in ran... | ['Wrong Answer', 'Accepted'] | ['s352669475', 's172250419'] | [42868.0, 3316.0] | [568.0, 28.0] | [1067, 1046] |
p03273 | u691018832 | 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... | ["import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(10 ** 7)\n\nh, w = map(int, readline().split())\na = [input() for i in range(h)]\nans = []\nmemo_x = []\nmemo_y = []\nfor i in range(h):\n cnt = 0\n print(a[i])\n for ... | ['Wrong Answer', 'Accepted'] | ['s041860846', 's430000786'] | [3064.0, 3064.0] | [24.0, 21.0] | [765, 776] |
p03273 | u698868214 | 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... | ['H,W = map(int,input().split())\nmass = [list(input()) for _ in range(H)]\n\nfor i in range(H):\n if "#" not in mass[i]:\n mass.pop(i)\n \nH = len(mass)\n\nnew_mass = [[] for _ in range(W)]\n\nfor j in mass:\n for i, k in enumerate(j):\n new_mass[i].append(k)\n \nfor l in range(W):\n if "#" not in new_mas... | ['Runtime Error', 'Accepted'] | ['s127518959', 's761477661'] | [9392.0, 9192.0] | [29.0, 32.0] | [449, 346] |
p03273 | u698919163 | 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... | ['H,W = map(int,input().split())\na = [input() for i in range(H)]\n\ny = [False]*H\nx = [False]*W\n\nfor i in range(H):\n for j in range(W):\n print(a[i][j])\n if a[i][j] == "#":\n y[i] = True\n x[j] = True\n \nfor i in range(H):\n if y[i] == True:\n for j in ... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s129728741', 's476252147', 's863693628', 's683816146'] | [4720.0, 3064.0, 3064.0, 4468.0] | [36.0, 20.0, 20.0, 30.0] | [395, 375, 375, 372] |
p03273 | u699089116 | 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... | ['import numpy as np\nh, w = map(int, input().split())\na = [list(input()) for _ in range(h)]\n\na = np.array(a).reshape(h, w)\na = [i for i in a if "#" in i]\n\na = np.array(a).T\na = [i for i in a if "#" in i]\n\na = np.array(a).T\nfor i in a:\n print(*i)\n', 'import numpy as np\nh, w = map(int, input().split())\n... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s683371276', 's919023212', 's495765981'] | [13180.0, 13224.0, 14292.0] | [163.0, 158.0, 162.0] | [247, 339, 255] |
p03273 | u707498674 | 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... | ['from collections import Counter\nimport numpy as np\nH, W = map(int, input().split())\na = []\nr_idx = []\nc_idx = []\n#a.shape = (H, W)\nfor i in range(H):\n line = list(input())\n ct = Counter(line).most_common()\n if ct[0][1] != W and ct[0][0]==".":\n r_idx.append(i)\n a.append(line)\na = np.arr... | ['Wrong Answer', 'Accepted'] | ['s696423369', 's908191064'] | [12500.0, 22412.0] | [160.0, 342.0] | [585, 593] |
p03273 | u716660050 | 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... | ["H,W=map(int,input().split())\nM=[list(input()) for i in range(H)]\nfor i in range(H):\n if not'#'in M[i]:\n s=[]\n for x in range(W):\n t=[M[y][x] for y in range(H)]\n if not'#'in t: s.append(M[i][x])\n print(''.join(s))", "H,W=map(int,input().split())\nM=[list(input()) f... | ['Wrong Answer', 'Accepted'] | ['s173314003', 's323963570'] | [3060.0, 3060.0] | [113.0, 104.0] | [258, 252] |
p03273 | u722189950 | 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... | ["\nH, W = map(int, input().split())\na = [input() for _ in range(H)]\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], e... | ['Runtime Error', 'Accepted'] | ['s600644893', 's017436302'] | [3064.0, 4468.0] | [17.0, 31.0] | [321, 321] |
p03273 | u726769307 | 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... | ["h,w=map(int,input().split())\na=[[j for j in input()] for i in range(h)]\nfor i in range(h):\n if a[i].count('.')==w:\n a[i]=[]\nwhile [] in a:\n a.remove([])\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==len(a):\n for j in range(len(a)):\n a[j][i]='!'\n... | ['Runtime Error', 'Accepted'] | ['s240411432', 's514263303'] | [3064.0, 4596.0] | [17.0, 23.0] | [400, 399] |
p03273 | u729707098 | 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... | ['h,w = (int(i) for i in input().split())\na,b = [],["" for i in range(w)]\nfor _ in range(h):\n\ts = input()\n\tif s.count("#")!=0:\n\t\ta.append(s)\n\t\tfor i in range(w): b[i]+=s[i]\nnum,ans = [True for i in range(w)],["" for i in range(len(a))]\nfor i in range(w):\n\tif b[i].count("#")==0: num[i] = False\nfor i in ... | ['Wrong Answer', 'Accepted'] | ['s904707994', 's904138379'] | [4084.0, 3064.0] | [29.0, 23.0] | [389, 387] |
p03273 | u732870425 | 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... | ['h, w = map(int, input())\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 ans = ""\n for j in range(w):\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s146760060', 's575703452', 's728204212'] | [3064.0, 3064.0, 4596.0] | [17.0, 24.0, 31.0] | [376, 411, 394] |
p03273 | u734876600 | 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... | ['h,w = map(int,input().split())\nli = []\nfor i in range(h):\n a = list(input().split())\n li.append(a)\nli2 = li.copy()\nc = 0\nfor i in range(h):\n for j in range(w):\n c = 0\n if li[i][j] == ".":\n continue\n elif li[i][j] == "#":\n c = 1\n break\n i... | ['Runtime Error', 'Accepted'] | ['s469898854', 's044212848'] | [3064.0, 3188.0] | [18.0, 23.0] | [731, 746] |
p03273 | u740284863 | 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... | ["h, w = map(int, input().split())\nmaps = []\nfor i in range(h):\n\tmaps.append(str(input()))\nrow = [False] * h\ncol = [False] * w\nfor i in range(h):\n\tfor j in range(w):\n\t\tif maps[i][j] == '#':\n\t\t\trow[i] = True\n\t\t\tcol[j] = True\n\nfor i in range(h):\n\tif scr[i]:\n\t\tfor j in range(w):\n\t\t\tif col[j]... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s079506697', 's511257431', 's963516272', 's934364540'] | [3064.0, 3064.0, 3064.0, 4468.0] | [21.0, 21.0, 20.0, 31.0] | [331, 328, 455, 331] |
p03273 | u741397536 | 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... | ['h, w = map(int, input().split())\n\narr_all = []\narr_del = []\nfor i in range(h):\n arr_w = input()\n if list(set(arr_w)) == ["."]:\n continue\n else:\n arr_all.append(arr_w)\n arr_del.append([])\n\nprint(arr_all)\n\nd = []\nfor i in range(w):\n for j in range(len(arr_all)):\n ... | ['Wrong Answer', 'Accepted'] | ['s166446536', 's724016850'] | [3316.0, 3188.0] | [23.0, 22.0] | [635, 606] |
p03273 | u746849814 | 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... | ["import numpy as np\nh, w = map(int, input().split())\nf = np.array([list(input()) for _ in range(h)])\n\nf = f[~np.all(f=='.', axis=1)]\nf = f[:, ~np.all(f=='.', axis=0)]\n\nfor x in f:\n print(*x)", "import numpy as np\nh, w = map(int, input().split())\nf = np.array([list(input()) for _ in range(h)])\n\nwhile Tru... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s038973160', 's158534588', 's545699394'] | [13200.0, 13132.0, 12544.0] | [156.0, 155.0, 152.0] | [192, 275, 213] |
p03273 | u749770850 | 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... | ["H,W=map(int,input().split())\n\nl=[]\nfor i in range(H):\n x=input()\n if x!='.'*W:\n l.append(x)\n\nrm=[]\nfor i in range(W):\n f=True\n for j in range(len(l)):\n if l[j][i]=='#':\n f=False\n\n if f:\n rm.append(i)\nprint()\na=[]\nprint(l)\nprint(rm)\nfor x in l:\n for i in rm[::-1]:\n print(i... | ['Wrong Answer', 'Accepted'] | ['s654295632', 's292424471'] | [3316.0, 3064.0] | [21.0, 19.0] | [395, 489] |
p03273 | u766566560 | 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... | ["H, W = map(int, input().split())\nG = []\n\nfor i in range(H):\n line = input()\n if line != '.' * W:\n G.append(line)\n\nH = len(G)\nans = []\n\nfor i in range(W):\n flg = False\n tmp = ''\n for j in range(H):\n if G[j][i] == '.':\n flg = False\n else:\n flg = True\n tmp += G[j][i]\n if f... | ['Wrong Answer', 'Accepted'] | ['s030276308', 's397599917'] | [3064.0, 3064.0] | [21.0, 24.0] | [341, 425] |
p03273 | u767432305 | 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... | ['H,W=map(int,input().split())\nhw=[]\nfor _ in range(H):\n hw.append(input())\n\nyoko_list=[]\ntate_list=[]\nfor i in range(H):\n for j in range(W):\n if hw[i][j]=="#":\n break\n elif j==W-1:\n yoko_list.append(i)\n\nfor i in range(W):\n for j in range(H):\n if hw[j]... | ['Runtime Error', 'Accepted'] | ['s510758747', 's636559975'] | [3064.0, 4468.0] | [20.0, 33.0] | [395, 665] |
p03273 | u778814286 | 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... | ["h, w = map(int, input().split())\nrs = [input() for _ in range(h)]\nrows = []\n\n\nfor r in rs:\n if '#' in r: rows.append(r)\n\nprint(rows)\nansrows = zip(*[c for c in zip(*rows) if '#' in c])\n\nfor r in list(ansrows):\n print(''.join(r))", "h, w = map(int, input().split())\nrs = [input() for _ in range(h)]\nrows... | ['Wrong Answer', 'Accepted'] | ['s330296855', 's925102858'] | [3188.0, 3188.0] | [18.0, 18.0] | [269, 257] |
p03273 | u779728630 | 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... | ['H, W = map( int, input().split() )\n\nh_set = set()\nw_set = set()\nB = [input() for i in range(H)]\nfor i in range(H):\n for j in range(W):\n if B[i][j] == \'#\':\n w_set.add(j)\n h_set.add(i)\n\nfor i in range(H):\n if i in h_set:\n for j in range(W):\n t = ""\n if j in w_set:\n t... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s492279402', 's550724262', 's487458809'] | [9024.0, 9124.0, 9220.0] | [31.0, 29.0, 28.0] | [324, 208, 328] |
p03273 | u781262926 | 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... | ["inputs = open(0).readlines()\nimport numpy as np\nclass Grid():\n def __init__(self, grid, w=0, h=0, function=lambda x: x):\n self.w = w = w if w else len(grid[0])\n self.h = h = h if h else len(grid)\n dtype = type(function(grid[0][0]))\n self.grid = np.empty((h, w), dtype=dtype)\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s491628648', 's576263064', 's555877733'] | [14352.0, 12528.0, 12496.0] | [163.0, 156.0, 162.0] | [1182, 1271, 1195] |
p03273 | u785578220 | 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... | ['input = get_input(INPUT)\n\nh, 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("... | ['Runtime Error', 'Accepted'] | ['s039115580', 's169805284'] | [3064.0, 3064.0] | [18.0, 19.0] | [325, 300] |
p03273 | u787059958 | 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... | ["from collections import defaultdict\nd = defaultdict(int)\nH, W = map(int, input().split())\nL = []\nfor i in range(H):\n L.append(input())\ncl = L[:]\n\nal = []\nfor i in cl:\n if ('#' in i):\n al.append(i)\n# print(al)\n\nif (len(al) == 0):\n print()\n exit()\n\nfor i in range(W):\n d[i] = Tru... | ['Wrong Answer', 'Accepted'] | ['s141524052', 's943692072'] | [3316.0, 3436.0] | [23.0, 24.0] | [781, 752] |
p03273 | u787562674 | 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... | ['H, W= map(int, input().split())\nA = [input() for i in range(H)]\n\nv_list = []\nreverse_list = [""]*W\nh_list = []\n\nfor i in range(H):\n if "#" in A[i]:\n v_list.append(A[i])\n\nprint(v_list)\n\nfor i in range(W):\n for j in range(len(v_list)):\n reverse_list[i] = reverse_list[i] + v_list[j][i]... | ['Wrong Answer', 'Accepted'] | ['s965792297', 's271084933'] | [3064.0, 3064.0] | [24.0, 20.0] | [588, 665] |
p03273 | u788137651 | 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... | ['H, W = map(int, input().split())\na = []\nfor i in range(H):\n list = [i for i in input()]\n a.append(list)\ncolumn = [int(i) for i in range(W)]\nrow = [int(i) for i in range(H)]\nfor i in range(H):\n for j in range(W):\n if a[i][j] == "#":\n if i in row:\n row.remove(i)\n ... | ['Wrong Answer', 'Accepted'] | ['s388970873', 's358558483'] | [4596.0, 4596.0] | [39.0, 38.0] | [592, 596] |
p03273 | u796942881 | 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... | ["H, W = map(int, input().split())\n\nl = [int(input()) for i in range(H)]\n\ny = [False] * H\nx = [False] * W\n\nfor i in range(H):\n flg = True\n for j in range(W):\n if l[i][j] != '.':\n flg = False\n break\n if flg:\n y[i] = True\n\nfor i in range(W):\n flg = True\n ... | ['Runtime Error', 'Accepted'] | ['s169615917', 's451675234'] | [3064.0, 4468.0] | [17.0, 29.0] | [576, 570] |
p03273 | u797016134 | 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... | ['h,w = map(int, input().split())\nli = []\nfor i in range(h):\n a = list(input())\n \n if "#" in a:\n li.append(a)\nprint(li)\nfor j in range(w):\n #if all([li[k][j] == "." for k in range(len(li))]):\n if all(li[k][j] == "." for k in range(len(li))):\n for k in range(len(li)):\n #... | ['Wrong Answer', 'Accepted'] | ['s930742470', 's585352847'] | [3316.0, 3064.0] | [19.0, 19.0] | [502, 491] |
p03273 | u800058906 | 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... | ["\n\nh,w=map(int,input().split())\n\na=[] \nfor i in range(h):\n x=input().split()\n a.append(x)\n\nh1=[]\nfor i in range(h):\n if a[i]==['.']:\n h1.append(i)\n\nw1=[]\nfor i in range(w):\n flag=0\n for j in range(h):\n if a[j][i]=='#':\n flag=1\n break\n if flag==0:\n w.append(i)\n\nans=[]\nf... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s085334828', 's300258170', 's411490765', 's503112764', 's640347836', 's085603987'] | [9208.0, 9232.0, 9208.0, 9252.0, 8960.0, 9232.0] | [23.0, 26.0, 26.0, 27.0, 26.0, 33.0] | [535, 486, 534, 534, 532, 480] |
p03273 | u802977614 | 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... | ['h,w=map(int, input().split())\na=[""]*h\nfor i in range(h):\n a[i]=input()\nrow=[False]*h\ncolumn=[False]*w\nfor i in range(h):\n for j in range(w):\n if a[i][j]=="#":\n row[i]=True\n column[j]=True\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if column[j]:\n print(a[i][j]+" ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s547923790', 's780132007', 's867821089'] | [3656.0, 3572.0, 4468.0] | [28.0, 29.0, 32.0] | [317, 318, 323] |
p03273 | u809819902 | 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... | ['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[j]=True\nfor i in range(h):\n if row[i]:\n for j in range(w):\n if col[j]:\n ... | ['Wrong Answer', 'Accepted'] | ['s148172853', 's604902239'] | [9128.0, 9228.0] | [32.0, 33.0] | [362, 328] |
p03273 | u813387707 | 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... | ['h, w = [int(x) for x in input().split()]\n\ntemp_list = []\nl = w\nr = -1\nfor _ in range(h):\n a = input()\n temp_l = a.find("#")\n if temp_l == -1:\n continue\n l = min(temp_l, l)\n r = max(a.rfind("#"), r)\n temp_list.append(a)\n\nfor temp in temp_list:\n print(temp[l:r+1])', 'h, w = [i... | ['Wrong Answer', 'Accepted'] | ['s918978142', 's392772960'] | [3060.0, 3064.0] | [18.0, 23.0] | [290, 320] |
p03273 | u819068380 | 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... | ['\ndef compression(init, matrix):\n\t\n\tmir = []\n\t\n\tfor row in matrix:\n\t\tif "#"in row:\n\t\t\tmir.append(row)\n\tmatrix = []\n\t\n\tmir = list(map(list, zip(*mir)))\n\t\n\tfor row in mir:\n\t\tif "#"in row:\n\t\t\tmatrix.append(row)\n\t\t\n\tmatrix = list(map(list, zip(*matrix)))\t\n\t\t\t\n\t\n\treturn matrix... | ['Runtime Error', 'Accepted'] | ['s296144963', 's383747409'] | [3064.0, 3188.0] | [18.0, 18.0] | [499, 491] |
p03273 | u823885866 | 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... | ["import sys\nimport numpy as np\n\nrm = lambda: map(int, sys.stdin.readline().split())\nrl = lambda: list(map(int, sys.stdin.readline().split()))\n\nh, w = rm()\nli = np.array([np.array(rl()) for _ in range(h)])\nli2 = np.array([])\nli3 = np.array([])\nfor i in li:\n if '#' not in i:\n li2.append(i)\nli2 = li2.T\n... | ['Runtime Error', 'Accepted'] | ['s677290411', 's460117422'] | [27016.0, 27168.0] | [112.0, 119.0] | [390, 384] |
p03273 | u828506439 | 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... | ["import numpy as np\n\nh, w = map(int, input().split())\nA = []\n\nfor _ in range(h):\n a = input()\n if '#' in a:\n A.append(a)\n\nAA = []\ncount = 0\nfor j in range(w):\n retu = []\n for i in range(len(A)):\n retu.append(A[i][j])\n if '#' not in retu:\n continue\n else:\n ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s131985542', 's251067004', 's786599579'] | [13124.0, 2940.0, 4468.0] | [158.0, 17.0, 30.0] | [392, 575, 318] |
p03273 | u840958781 | 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,B=[],[]\nh,w=map(int,input().split())\nfor i in range(h):\n a=input()\n if "#" in a:\n A.append(a)\nb=""\nfor i in range(w):\n if "#" not in b:\n B.append(i-1)\n b=""\n for j in range(len(A)):\n b+=A[j][i]\nb=""\nb+=A[len(A)-1]\nif "#" not in b:\n B.append(w-1)\nB.pop(0)\no=0\... | ['Wrong Answer', 'Accepted'] | ['s107417578', 's927211969'] | [3188.0, 3188.0] | [20.0, 20.0] | [524, 495] |
p03273 | u844005364 | 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... | ['h, w = map(int, input().split())\n \na = [list(input()) for i in range(h)]\n \nfor i in range(h):\n if "#" not in a[i]:\n del a[i]\n \naT = zip(*a)\n \nfor i in range(len(aT)):\n if "#" not in aT[i]:\n del aT[i]\n \na = zip(*aT)\n \nfor i in a:\n print(i)', 'h, w = map(int, input().split())\n\na = [input() f... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s420156933', 's547251795', 's936272491', 's665875016'] | [3064.0, 3064.0, 3316.0, 3316.0] | [18.0, 17.0, 19.0, 19.0] | [247, 235, 259, 209] |
p03273 | u844266921 | 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... | ['h,w=map(int,input().split())\na=[[c for c in input()] for _ in range(h)]\nb=[]\nflag=0\nfor s in a:\n if ("#" in s) and ("." in s):\n b.append(s)\nfor i in range(w):\n flag=0\n for j in range(len(b)):\n if b[j][i]!=b[0][i]:\n flag=1\n break\n if flag==0:\n for j in range(len(b)):\n b[j][i]... | ['Wrong Answer', 'Accepted'] | ['s247914496', 's308864099'] | [3064.0, 3064.0] | [19.0, 18.0] | [338, 317] |
p03273 | u855985627 | 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... | ["H,W=(int(i) for i in input().split(' '))\ngrid=[]\nfor h in range(H):\n tmp = input()\n if tmp.count('#')!=0:\n \tgrid[h]=tmp\n else:\n H -= 1\npop_count=0\nfor w in range(W):\n check = 0\n for h in range(h):\n if grid[h][w-pop_count]='#':\n check = 1\n if check == 0:\n for h in range(H):\n\t\tgri... | ['Runtime Error', 'Accepted'] | ['s954821902', 's351356705'] | [2940.0, 3064.0] | [17.0, 19.0] | [373, 497] |
p03273 | u859897687 | 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... | ['h,w=map(int,input().split())\nh1=[0 for i in range(h)]\nw1=[0 for i in range(w)]\nfor i in range(h):\n a=input()\n m+=[a]\n if not "#" in a:\n h1[i]=1\n \nfor i in range(w):\n k=1\n for j in range(len(m)):\n if m[j][i]=="#":\n k=0\n break\n if k==1:\n w1[i]=1\n \nfor i in range(h):\n i... | ['Runtime Error', 'Accepted'] | ['s528091014', 's120141042'] | [3064.0, 3064.0] | [18.0, 21.0] | [418, 423] |
p03273 | u864197622 | 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... | ['H, W = map(int, input().split(" "))\nA=[]\nfor i in range(H):\n tmp = input()\n A.append ([c for c in tmp])\n \nprint (A)\n\nh=H\nw=W\nfor i in range(H):\n cnt = 0 \n for j in range(W):\n if A[i][j] == ".":\n cnt += 1\n \n \n if cnt == W:\n h -= 1\n... | ['Wrong Answer', 'Accepted'] | ['s771115797', 's519410394'] | [3560.0, 3188.0] | [199.0, 115.0] | [835, 800] |
p03273 | u867848444 | 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... | ["import numpy as np\nh,w=map(int,input().split())\na=[np.array(input().split()) for i in range(h)]\na=np.array(a)\n\nh_score=[0]*h\nw_score=[0]*w\nfor i in range(h):\n for j in range(w):\n if a[i][j]=='.':\n h_score[j]+=1\n w_score[i]+=1\n\nfor i in range(h):\n if h_score[i]==h:\n ... | ['Runtime Error', 'Accepted'] | ['s711152994', 's560769737'] | [12500.0, 13620.0] | [150.0, 156.0] | [461, 668] |
p03273 | u879674287 | 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... | ["import numpy as np\n\n\ndef yoko(row):\n cnt = sum(row)\n return cnt == len(row)\n\n\ndef main():\n h, w = map(int, input().split(' '))\n a = []\n\n for i in range(h):\n b = input()\n a += [1 if c == '.' else 0 for c in b]\n a = np.array(a).reshape(h, w)\n\n while True:\n cnt... | ['Wrong Answer', 'Accepted'] | ['s971962018', 's784775256'] | [12624.0, 12624.0] | [165.0, 165.0] | [1299, 1256] |
p03273 | u879870653 | 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... | ['H,W = map(int,input().split())\nL = [input() for i in range(H)]\nX = [False for i in range(W)]\nY = [False for i in range(H)]\n\nfor y in range(H) :\n for x in range(W) :\n if L[y][x] == "#" :\n X[x] = True\n Y[y] = True\nprint(X,Y)\n\nfor y in range(H) :\n if Y[y] == True :\n ... | ['Wrong Answer', 'Accepted'] | ['s130941736', 's003434144'] | [3188.0, 3064.0] | [23.0, 23.0] | [445, 426] |
p03273 | u882359130 | 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... | ['H, W = [int(hw) for hw in input().split()]\nA = []\nfor h in range(H):\n a = [a for a in input()]\n if a.count("#") > 0:\n A.append(a)\nfor w in range(W):\n cnt = 0\n for h in range(len(A)):\n if A[h][w] == ".":\n cnt += 1\n if cnt == len(A):\n for h in range(len(A)):\n del A[h][w]\nfor h in r... | ['Runtime Error', 'Accepted'] | ['s702316483', 's874468699'] | [3188.0, 3064.0] | [20.0, 20.0] | [331, 364] |
p03273 | u883203948 | 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... | ['import numpy as np\n\ndata = input().split()\n\nh = int(data[0])\nw = int(data[1])\n\ncount = 0\n# creating math\ni = 0\nmath = []\nwhile i < h:\n x = input()\n x = list(x)\n math.append(x)\n i += 1\nmath = np.array(math).reshape(h,w)\n\n\n# row check\n\ni = 0 # row\nj = 0 # colum\nwhile i < h:\n while... | ['Wrong Answer', 'Accepted'] | ['s048565422', 's319506297'] | [12504.0, 13912.0] | [166.0, 177.0] | [862, 1038] |
p03273 | u884323674 | 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... | ['H, W = map(int, input().split())\nfield = [[i for i in input()] for j in range(H)]\n\nb_rows = []\nfor row in range(H):\n if field[row].count(".") != W:\n b_rows.append(row)\n\nb_columns = []\nfor column in range(W):\n memo = []\n for row in range(H):\n memo.append(field[column][row])\n if m... | ['Runtime Error', 'Accepted'] | ['s313880876', 's687596793'] | [4468.0, 4468.0] | [29.0, 30.0] | [447, 447] |
p03273 | u887207211 | 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... | ['H, W = map(int,input().split())\nA = [input() for _ in range(N)]\n\ntmp = []\nfor a in zip(*A):\n if(a.count("#") > 0):\n tmp.append("".join(a))\ntmp2 = []\nfor t in zip(*tmp):\n if(t.count("#") > 0):\n tmp2.append("".join(t))\nprint("\\n".join(tmp2))', 'import sys\n\nstdin = sys.stdin\n\nns = lambda : stdin.... | ['Runtime Error', 'Accepted'] | ['s382213084', 's220592876'] | [3064.0, 3064.0] | [18.0, 18.0] | [247, 355] |
p03273 | u905582793 | 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... | ['h,w = map(int,input().split())\na=[input() for i in range(h)]\nb=[]\nc=[]\nfor i in a:\n if "#" in i:\n b.append(i)\nfor i in range(w):\n for j in range(len(b)):\n if b[j][i] == "#":\n break\n elif j = h-1:\n for k in b:\n del k[j]\nprint(b)', 'a=[input() for i in range(h)]\nb=[]\nfor i in... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s118890428', 's770933684', 's458857618'] | [2940.0, 3060.0, 4596.0] | [17.0, 17.0, 22.0] | [255, 253, 351] |
p03273 | u905711033 | 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... | ['import numpy as np\n\nH,W = list(map(int, input().split()))\n\nmat = np.zeros((H, W))\noriginal_mat = []\n\nremoved_line = []\nremoved_column = []\n\nfor i in range(H):\n row = input()\n line = []\n for j, c in enumerate(row):\n if c == "#":\n mat[i, j] = 1\n\n # print(mat[i,:])\n if ... | ['Wrong Answer', 'Accepted'] | ['s765315485', 's315973060'] | [18256.0, 13932.0] | [403.0, 165.0] | [690, 696] |
p03273 | u911507660 | 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... | ["# Q2\nH, W = map(int, input().split())\na = [[c for c in input()] for _h in range(H)]\n\n\nfor h in range(H):\n if '#' in a[h]:\n for w in range(W):\n a[h][w] = ''\nfor w in range(W):\n if '#' in [p[w] for p in a]:\n for h in range(H):\n a[h][w] = ''\n\nfor h in range(H):\n ... | ['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s349496751', 's605335003', 's926832207', 's282747417'] | [3064.0, 3064.0, 3064.0, 3064.0] | [19.0, 2104.0, 20.0, 21.0] | [367, 533, 534, 375] |
p03273 | u923077302 | 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... | ['def main():\n H, W = list(map(int, input().split(" ")))\n a = []\n for r in range(H):\n a += [input()]\n output = solve(H, W, a)\n for s in output:\n print(s)\n return\n\n#________________________________________\n# Solve\n#________________________________________\ndef solve(H, W, a):... | ['Runtime Error', 'Accepted'] | ['s449578176', 's552035740'] | [3188.0, 3188.0] | [19.0, 19.0] | [1020, 1097] |
p03273 | u931636178 | 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... | ['H,W = map(int,input().split())\ngrid = []\nfor i in range(H):\n row = list(input())\n grid.append(row)\nwhile True:\n r_change = False\n for q in range(len(grid)):\n if "#" not in grid[q]:\n del grid[q]\n r_change = True\n break\n if not r_change:\n break\... | ['Wrong Answer', 'Accepted'] | ['s443351838', 's382964044'] | [3316.0, 3188.0] | [38.0, 37.0] | [593, 622] |
p03273 | u933622697 | 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... | ['h, w = map(int, input().split())\ngrid = [list(input()) for _ in range(h)]\n\n# Filtering the data if any "#" are existed in the each row or col\n\n# If true, the row is not be deleted\n# (Do not use if statement!)\nrow_compressed_grid = list(filter(lambda row: any(x == "#" for x in row), grid)) \ncompressed_grid = l... | ['Wrong Answer', 'Accepted'] | ['s916457320', 's898487040'] | [3188.0, 3188.0] | [18.0, 19.0] | [537, 541] |
p03273 | u934442292 | 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... | ['import numpy as np\n\nH, W = map(int, input().split())\na = np.array(shape=(H, W), dtype=bool)\nfor i in range(H):\n a[i] = [s == "." for s in input().split()]\n\ny = [True] * H\n i in range(H):\n if all(a[i,:]):\n y[i] = False\n\nx = [True] * W\nfor i in range(W):\n if all(a[:,i]):\n x[i] = False\n\nans = [... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s512361670', 's567194633', 's929599957', 's561666011'] | [2940.0, 2940.0, 2940.0, 12512.0] | [16.0, 17.0, 17.0, 157.0] | [496, 493, 485, 491] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.