s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s963134606 | p00118 | u350804311 | 1473921276 | Python | Python3 | py | Runtime Error | 0 | 0 | 713 | while True:
H, W = list(map(int, input().split()))
if H == 0 and W == 0:
break
field = []
for i in range(H):
field.append(list(input()))
ans = 0
def field_count(x, y):
fruit = field[x][y]
field[x][y] = "."
for dx in [-1, 0, 1]:
nx = x + dx
... |
s425578255 | p00118 | u227162786 | 1490011544 | Python | Python3 | py | Runtime Error | 0 | 0 | 765 | def dfs(h, w, m, v, H, W):
'''
m[h][w]?????????????????????????¨???????(v???True?????????)
'''
v[h][w] = True
for dh, dw in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
nh = h + dh
nw = w + dw
if nh in range(H) and nw in range(W) and m[nh][nw] == m[h][w] and v[nh][nw] == False:
... |
s827509767 | p00118 | u227162786 | 1490014345 | Python | Python3 | py | Runtime Error | 0 | 0 | 719 | def dfs(h, w, m, v, H, W):
'''
m[h][w]?????????????????????????¨???????(v???True?????????)
'''
v[h][w] = True
for dh, dw in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
nh = h + dh
nw = w + dw
if nh in range(H) and nw in range(W) and m[nh][nw] == m[h][w] and v[nh][nw] == False:
... |
s874971731 | p00118 | u227162786 | 1490014780 | Python | Python3 | py | Runtime Error | 0 | 0 | 827 | def dfs(h, w, m, v, H, W):
'''
m[h][w]?????????????????????????¨???????(v???True?????????)
'''
v[h][w] = True
for dh, dw in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
nh = h + dh
nw = w + dw
if nh in range(H) and nw in range(W) and m[nh][nw] == m[h][w] and v[nh][nw] == False:
... |
s430461085 | p00118 | u577311000 | 1493288529 | Python | Python3 | py | Runtime Error | 0 | 0 | 773 | def solve(values,hp=0,vp=0,stamp=0):
if hp==0:
if hp!=0 and values[hp-1][vp]==values[hp][vp]:
values[hp-1][vp]=stamp
solve(values,hp-1,vp,stamp)
if hp!=len(values) and values[hp+1][vp]==values[hp][vp]:
values[hp+1][vp]=stamp
solve(values,hp-1,vp,stamp)
if vp!=0 and values[hp][vp-1]==values[hp][vp]:
values... |
s250587489 | p00118 | u577311000 | 1493288580 | Python | Python3 | py | Runtime Error | 0 | 0 | 773 | def solve(values,hp=0,vp=0,stamp=0):
if hp==0:
if hp!=0 and values[hp-1][vp]==values[hp][vp]:
values[hp-1][vp]=stamp
solve(values,hp-1,vp,stamp)
if hp!=len(values) and values[hp+1][vp]==values[hp][vp]:
values[hp+1][vp]=stamp
solve(values,hp-1,vp,stamp)
if vp!=0 and values[hp][vp-1]==values[hp][vp]:
values... |
s840156147 | p00118 | u577311000 | 1493288626 | Python | Python3 | py | Runtime Error | 0 | 0 | 773 | def solve(values,hp=0,vp=0,stamp=0):
if hp==0:
if hp!=0 and values[hp-1][vp]==values[hp][vp]:
values[hp-1][vp]=stamp
solve(values,hp-1,vp,stamp)
if hp!=len(values) and values[hp+1][vp]==values[hp][vp]:
values[hp+1][vp]=stamp
solve(values,hp-1,vp,stamp)
if vp!=0 and values[hp][vp-1]==values[hp][vp]:
values... |
s607731383 | p00118 | u577311000 | 1493289860 | Python | Python3 | py | Runtime Error | 0 | 0 | 708 | #! -*- coding:utf-8 -*-
def search(values,hp=0,vp=0,stamp=0,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[0])): return
if fruit!=values[hp][vp]: return
fruit,values[hp][vp]=values[hp][vp],stamp
search(values,hp-1,vp,stamp,fruit)
search(values,hp+1,vp,stamp,fruit)
search(values,hp,vp-1,stam... |
s157997220 | p00118 | u577311000 | 1493289876 | Python | Python | py | Runtime Error | 0 | 0 | 708 | #! -*- coding:utf-8 -*-
def search(values,hp=0,vp=0,stamp=0,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[0])): return
if fruit!=values[hp][vp]: return
fruit,values[hp][vp]=values[hp][vp],stamp
search(values,hp-1,vp,stamp,fruit)
search(values,hp+1,vp,stamp,fruit)
search(values,hp,vp-1,stam... |
s341019480 | p00118 | u577311000 | 1493290839 | Python | Python | py | Runtime Error | 0 | 0 | 819 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,stamp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[0])): return
if fruit!=values[hp][vp]: return
fruit,values[hp][vp]=values[hp][vp],stamp
search(values,hp-1,vp,stamp,fruit)
search(values,hp+1,vp,stamp,fruit)
search(valu... |
s320321375 | p00118 | u683968848 | 1493291231 | Python | Python | py | Runtime Error | 0 | 0 | 1259 | import sys
process()
def process():
data = get_data()
integer = data[0].split()
H = int(integer[0])
W = int(integer[1])
data = data[1: -1]
field = create_field(H, W)
print search(H, W, data, field)
def search(H, W, data, field):
count = 0
for i in xrange(H):
for j in x... |
s016392104 | p00118 | u577311000 | 1493291492 | Python | Python3 | py | Runtime Error | 0 | 0 | 816 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+... |
s056952302 | p00118 | u577311000 | 1493291582 | Python | Python3 | py | Runtime Error | 0 | 0 | 881 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+... |
s407186960 | p00118 | u577311000 | 1493291630 | Python | Python3 | py | Runtime Error | 0 | 0 | 783 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+1,fruit)
def solve(valu... |
s946090713 | p00118 | u577311000 | 1493291655 | Python | Python3 | py | Runtime Error | 0 | 0 | 910 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+... |
s361423782 | p00118 | u577311000 | 1493291673 | Python | Python3 | py | Runtime Error | 0 | 0 | 906 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+... |
s484421033 | p00118 | u577311000 | 1493291760 | Python | Python3 | py | Runtime Error | 0 | 0 | 928 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+... |
s689978348 | p00118 | u683968848 | 1493291838 | Python | Python | py | Runtime Error | 0 | 0 | 1503 | def process():
data = []
for line in get_data():
if ' ' in line:
integer = line.split()
if integer[0] == integer[1] == 0:
data = []
continue
H = int(integer[0])
W = int(integer[1])
else:
data.append(line)... |
s581835568 | p00118 | u577311000 | 1493291983 | Python | Python3 | py | Runtime Error | 0 | 0 | 977 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+... |
s828884586 | p00118 | u577311000 | 1493291999 | Python | Python3 | py | Runtime Error | 0 | 0 | 936 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+... |
s403196635 | p00118 | u577311000 | 1493292069 | Python | Python3 | py | Runtime Error | 0 | 0 | 807 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+1,fruit)
def solve(valu... |
s946238273 | p00118 | u683968848 | 1493292185 | Python | Python | py | Runtime Error | 0 | 0 | 1549 | def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
pass
els... |
s043419788 | p00118 | u577311000 | 1493292219 | Python | Python3 | py | Runtime Error | 0 | 0 | 807 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+1,fruit)
def solve(valu... |
s523336980 | p00118 | u683968848 | 1493292224 | Python | Python | py | Runtime Error | 0 | 0 | 1562 | import sys
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
pas... |
s184497001 | p00118 | u577311000 | 1493292242 | Python | Python3 | py | Runtime Error | 0 | 0 | 806 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[0])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+1,fruit)
def solve(value... |
s578194472 | p00118 | u683968848 | 1493292244 | Python | Python | py | Runtime Error | 0 | 0 | 1531 | import sys
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
pas... |
s108168080 | p00118 | u683968848 | 1493292324 | Python | Python | py | Runtime Error | 0 | 0 | 1531 | import sys
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
pas... |
s070873088 | p00118 | u577311000 | 1493292345 | Python | Python3 | py | Runtime Error | 0 | 0 | 807 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[0])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
# search(values,hp,vp-1,fruit)
search(values,hp,vp+1,fruit)
def solve(valu... |
s032326504 | p00118 | u683968848 | 1493292363 | Python | Python | py | Runtime Error | 0 | 0 | 1531 | import sys
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
pas... |
s976266956 | p00118 | u577311000 | 1493292375 | Python | Python3 | py | Runtime Error | 0 | 0 | 807 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=0
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+1,fruit)
def solve(valu... |
s763722206 | p00118 | u683968848 | 1493292416 | Python | Python | py | Runtime Error | 0 | 0 | 1587 | import sys
def main():
process()
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len... |
s752759999 | p00118 | u964207033 | 1493292429 | Python | Python3 | py | Runtime Error | 0 | 0 | 1351 | # coding: utf-8
# @????????? #?????? *?????????
import sys
def dfs(x, y, fru):
# ???????????¨?????????.???????????????
field[x][y] = '.'
# 4??????????????????
for dx in [-1,0,1]:
nx = x + dx
if 0 <= nx and nx < H and field[nx][y] == fru:
dfs(nx,y,fru)
for dy in [-1,0,1... |
s728429249 | p00118 | u964207033 | 1493292481 | Python | Python3 | py | Runtime Error | 0 | 0 | 872 | # coding: utf-8
import sys
def dfs(x, y, fru):
field[x][y] = '.'
for dx in [-1,0,1]:
nx = x + dx
if 0 <= nx and nx < H and field[nx][y] == fru:
dfs(nx,y,fru)
for dy in [-1,0,1]:
ny = y + dy
if 0 <= ny and ny < W and field[x][ny] == fru:
dfs(x,ny,fru)... |
s230591609 | p00118 | u577311000 | 1493292502 | Python | Python3 | py | Runtime Error | 0 | 0 | 810 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if fruit!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,fruit)
search(values,hp,vp+1,fruit)
def solve(v... |
s951660911 | p00118 | u964207033 | 1493292524 | Python | Python3 | py | Runtime Error | 0 | 0 | 870 | # coding: utf-8
import sys
def dfs(x, y, fru):
field[x][y] = '.'
for dx in [-1,0,1]:
nx = x + dx
if 0 <= nx and nx < H and field[nx][y] == fru:
dfs(nx,y,fru)
for dy in [-1,0,1]:
ny = y + dy
if 0 <= ny and ny < W and field[x][ny] == fru:
dfs(x,ny,fru)
... |
s528002841 | p00118 | u683968848 | 1493292557 | Python | Python | py | Runtime Error | 0 | 0 | 1531 | import sys
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
pas... |
s709697982 | p00118 | u683968848 | 1493292620 | Python | Python | py | Runtime Error | 0 | 0 | 1525 | import sys
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
pass... |
s327853829 | p00118 | u577311000 | 1493292672 | Python | Python3 | py | Runtime Error | 0 | 0 | 858 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,fruit):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if values[hp][vp] not in ['@','#','*']: return
if fruit!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,fruit)
search(values,hp+1,vp,fruit)
search(values,hp,vp-1,f... |
s973093024 | p00118 | u683968848 | 1493292730 | Python | Python | py | Runtime Error | 0 | 0 | 1536 | import sys
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
pass... |
s551753572 | p00118 | u577311000 | 1493292755 | Python | Python | py | Runtime Error | 0 | 0 | 803 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search(values,hp,vp+1,item)
def solve(values)... |
s168604361 | p00118 | u577311000 | 1493292768 | Python | Python | py | Runtime Error | 0 | 0 | 804 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
# search(values,hp,vp+1,item)
def solve(values... |
s780667964 | p00118 | u577311000 | 1493292785 | Python | Python | py | Runtime Error | 0 | 0 | 815 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search(values,hp,vp+1,item)
def solve(values)... |
s492676594 | p00118 | u964207033 | 1493292797 | Python | Python3 | py | Runtime Error | 0 | 0 | 1086 | # coding: utf-8
# @????????? #?????? *?????????
import sys
def dfs(x, y, fru):
# ???????????¨?????????.???????????????
field[x][y] = '.'
# 4??????????????????
for dx in [-1,0,1]:
nx = x + dx
if 0 <= nx and nx < W and field[nx][y] == fru:
dfs(nx,y,fru)
for dy in [-1,0,1]:... |
s623516100 | p00118 | u683968848 | 1493292827 | Python | Python | py | Runtime Error | 0 | 0 | 1519 | import sys
def process(dataset):
data = []
for line in dataset:
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
... |
s404745340 | p00118 | u577311000 | 1493292857 | Python | Python3 | py | Runtime Error | 0 | 0 | 804 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search(values,hp,vp+1,item)
def solve(values)... |
s387666294 | p00118 | u683968848 | 1493292863 | Python | Python | py | Runtime Error | 0 | 0 | 1553 | import sys
def process(dataset):
data = []
for line in dataset:
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
... |
s297963084 | p00118 | u577311000 | 1493292920 | Python | Python3 | py | Runtime Error | 0 | 0 | 804 | #! -*- coding:utf-8 -*-
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search(values,hp,vp+1,item)
def solve(values)... |
s116281818 | p00118 | u577311000 | 1493293011 | Python | Python3 | py | Runtime Error | 0 | 0 | 783 | def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search(values,hp,vp+1,item)
def solve(values):
count=0
for i in rang... |
s623709416 | p00118 | u964207033 | 1493293024 | Python | Python3 | py | Runtime Error | 0 | 0 | 1098 | # coding: utf-8
# @????????? #?????? *?????????
def dfs(x, y, fru):
# ???????????¨?????????.???????????????
field[x][y] = '.'
# 4??????????????????
for dx in [-1,0,1]:
nx = x + dx
if 0 <= nx and nx < H and field[nx][y] == fru:
dfs(nx,y,fru)
for dy in [-1,0,1]:
ny... |
s387759946 | p00118 | u577311000 | 1493293079 | Python | Python3 | py | Runtime Error | 0 | 0 | 787 | def visiting(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search(values,hp,vp+1,item)
def solve(values):
count=0
for i in ra... |
s194734801 | p00118 | u577311000 | 1493293094 | Python | Python3 | py | Runtime Error | 0 | 0 | 795 | def visiting(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
visiting(values,hp-1,vp,item)
visiting(values,hp+1,vp,item)
visiting(values,hp,vp-1,item)
visiting(values,hp,vp+1,item)
def solve(values):
count=0
for... |
s289755407 | p00118 | u683968848 | 1493293097 | Python | Python | py | Runtime Error | 0 | 0 | 1553 | import sys
def process(dataset):
data = []
for line in dataset:
line = line.split()
if len(line) == 2:
if line[0] == line[1] == "0":
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
... |
s754834731 | p00118 | u577311000 | 1493293112 | Python | Python3 | py | Runtime Error | 0 | 0 | 842 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def visiting(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
visiting(values,hp-1,vp,item)
visiting(values,hp+1,vp,item)
visiting(values,hp,vp-1,item)
visiting(values,... |
s663711527 | p00118 | u683968848 | 1493293115 | Python | Python | py | Runtime Error | 0 | 0 | 1553 | import sys
def process(dataset):
data = []
for line in dataset:
line = line.split()
if len(line) == 2:
if line[0] == line[1] == "0":
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
... |
s635760795 | p00118 | u577311000 | 1493293138 | Python | Python3 | py | Runtime Error | 0 | 0 | 830 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search(values,hp,vp+1,it... |
s199076847 | p00118 | u683968848 | 1493293195 | Python | Python | py | Runtime Error | 0 | 0 | 111 |
if __name__ == "__main__":
dataset = [line.strip() for line in sys.stdin.readlines()]
process(dataset) |
s287933637 | p00118 | u683968848 | 1493293218 | Python | Python | py | Runtime Error | 0 | 0 | 122 | import sys
if __name__ == "__main__":
dataset = [line.strip() for line in sys.stdin.readlines()]
process(dataset) |
s414057735 | p00118 | u683968848 | 1493293223 | Python | Python | py | Runtime Error | 0 | 0 | 122 | import sys
if __name__ == "__main__":
dataset = [line.strip() for line in sys.stdin.readlines()]
process(dataset) |
s070493151 | p00118 | u683968848 | 1493293280 | Python | Python | py | Runtime Error | 0 | 0 | 112 | import sys
if __name__ == "__main__":
dataset = [line.strip() for line in raw_input()]
process(dataset) |
s768055136 | p00118 | u577311000 | 1493293324 | Python | Python3 | py | Runtime Error | 0 | 0 | 838 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search(values,hp,vp+1,it... |
s926238228 | p00118 | u577311000 | 1493293341 | Python | Python3 | py | Runtime Error | 0 | 0 | 816 | # -*- coding: utf-8 -*-
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search(values,hp,vp+1,item)
def solve(values)... |
s053874982 | p00118 | u683968848 | 1493293403 | Python | Python | py | Runtime Error | 0 | 0 | 1539 | def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif len(line) == 0:
pass
els... |
s667973400 | p00118 | u683968848 | 1493293544 | Python | Python | py | Runtime Error | 0 | 0 | 1581 | import sys
sys.setrecursionlimit(100000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif le... |
s711708727 | p00118 | u964207033 | 1493293546 | Python | Python3 | py | Runtime Error | 0 | 0 | 1136 | # coding: utf-8
# @????????? #?????? *?????????
import sys
sys.setrecursionlimit(1500)
def dfs(x, y, fru):
# ???????????¨?????????.???????????????
field[x][y] = '.'
# 4??????????????????
for dx in [-1,0,1]:
nx = x + dx
if 0 <= nx and nx < H and field[nx][y] == fru:
dfs(nx,y,f... |
s469653004 | p00118 | u683968848 | 1493293580 | Python | Python | py | Runtime Error | 0 | 0 | 1550 | import sys
sys.setrecursionlimit(1000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif l... |
s663905613 | p00118 | u964207033 | 1493293581 | Python | Python3 | py | Runtime Error | 0 | 0 | 1137 | # coding: utf-8
# @????????? #?????? *?????????
import sys
sys.setrecursionlimit(2000)
def dfs(x, y, fru):
# ???????????¨?????????.???????????????
field[x][y] = '.'
# 4??????????????????
for dx in [-1,0,1]:
nx = x + dx
if 0 <= nx and nx < H and field[nx][y] == fru:
dfs(nx,y,... |
s382934967 | p00118 | u683968848 | 1493293605 | Python | Python | py | Runtime Error | 0 | 0 | 1556 | import sys
sys.setrecursionlimit(1000000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
... |
s691696176 | p00118 | u964207033 | 1493293612 | Python | Python3 | py | Runtime Error | 0 | 0 | 1138 | # coding: utf-8
# @????????? #?????? *?????????
import sys
sys.setrecursionlimit(10000)
def dfs(x, y, fru):
# ???????????¨?????????.???????????????
field[x][y] = '.'
# 4??????????????????
for dx in [-1,0,1]:
nx = x + dx
if 0 <= nx and nx < H and field[nx][y] == fru:
dfs(nx,y... |
s015354148 | p00118 | u683968848 | 1493293648 | Python | Python | py | Runtime Error | 0 | 0 | 1573 | import sys
sys.setrecursionlimit(100000000000000000000000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(... |
s070214841 | p00118 | u683968848 | 1493293660 | Python | Python | py | Runtime Error | 0 | 0 | 1615 | import sys
sys.setrecursionlimit(100000000000000000000000000000000000000000000000000000000000000000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
... |
s706635884 | p00118 | u683968848 | 1493293760 | Python | Python | py | Runtime Error | 0 | 0 | 1518 | import sys
sys.setrecursionlimit(10000000000000000000000000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = in... |
s714862964 | p00118 | u683968848 | 1493293799 | Python | Python | py | Runtime Error | 0 | 0 | 1556 | import sys
sys.setrecursionlimit(1000000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
... |
s344621886 | p00118 | u683968848 | 1493293813 | Python | Python | py | Runtime Error | 0 | 0 | 1557 | import sys
sys.setrecursionlimit(1000000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
... |
s165750097 | p00118 | u683968848 | 1493293831 | Python | Python | py | Runtime Error | 0 | 0 | 1557 | import sys
sys.setrecursionlimit(1000000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
... |
s899618437 | p00118 | u683968848 | 1493293894 | Python | Python | py | Runtime Error | 0 | 0 | 1487 | import sys
sys.setrecursionlimit(1000000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
... |
s628144427 | p00118 | u683968848 | 1493293917 | Python | Python | py | Runtime Error | 0 | 0 | 1008 | import sys
sys.setrecursionlimit(1000000000000)
def search(H, W, data, field):
count = 0
for i in xrange(H):
for j in xrange(W):
if field[i][j] == 0:
continue
_search(i, j, H, W, data[i][j], data, field)
count += 1
return count
def _search(i, j... |
s068856538 | p00118 | u683968848 | 1493293933 | Python | Python | py | Runtime Error | 0 | 0 | 237 | import sys
sys.setrecursionlimit(1000000000000)
def create_field(H, W):
field = []
for i in xrange(H):
raw = []
for j in xrange(W):
raw.append(1)
field.append(raw)
return field
print 0 |
s911032622 | p00118 | u683968848 | 1493293943 | Python | Python | py | Runtime Error | 0 | 0 | 57 | import sys
sys.setrecursionlimit(1000000000000)
print 0 |
s237860325 | p00118 | u683968848 | 1493294056 | Python | Python | py | Runtime Error | 0 | 0 | 1547 | import sys
sys.setrecursionlimit(100000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif l... |
s366695699 | p00118 | u683968848 | 1493294066 | Python | Python3 | py | Runtime Error | 0 | 0 | 1547 | import sys
sys.setrecursionlimit(100000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif l... |
s102053711 | p00118 | u683968848 | 1493294078 | Python | Python3 | py | Runtime Error | 0 | 0 | 1552 | import sys
sys.setrecursionlimit(10000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
e... |
s121355717 | p00118 | u577311000 | 1493294377 | Python | Python3 | py | Runtime Error | 0 | 0 | 872 | # -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10000000)
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
se... |
s618825331 | p00118 | u683968848 | 1493294452 | Python | Python3 | py | Runtime Error | 0 | 0 | 1649 | import sys
sys.setrecursionlimit(10000000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
e... |
s010162921 | p00118 | u683968848 | 1493294485 | Python | Python3 | py | Runtime Error | 0 | 0 | 1554 | import sys
sys.setrecursionlimit(100000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
eli... |
s240218823 | p00118 | u683968848 | 1493294504 | Python | Python3 | py | Runtime Error | 0 | 0 | 1551 | import sys
sys.setrecursionlimit(100000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif l... |
s218562256 | p00118 | u683968848 | 1493294516 | Python | Python | py | Runtime Error | 0 | 0 | 1551 | import sys
sys.setrecursionlimit(100000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif l... |
s539893677 | p00118 | u683968848 | 1493294528 | Python | Python | py | Runtime Error | 0 | 0 | 1552 | import sys
sys.setrecursionlimit(1000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif ... |
s817701009 | p00118 | u683968848 | 1493294537 | Python | Python | py | Runtime Error | 0 | 0 | 1553 | import sys
sys.setrecursionlimit(10000000)
def process():
data = []
for line in get_data():
line = line.split()
if len(line) == 2:
if line[0] == line[1] == '0':
data = []
continue
H = int(line[0])
W = int(line[1])
elif... |
s289359795 | p00118 | u683968848 | 1493295368 | Python | Python | py | Runtime Error | 0 | 0 | 1581 | import sys
sys.setrecursionlimit(10000000)
def main():
process()
def process():
for data in get_dataset():
H = int(data)
W = int(data[0])
field = create_field(H, W)
print search(H, W, data, field)
def search(H, W, data, field):
count = 0
for i in xrange(H):
... |
s586203917 | p00118 | u683968848 | 1493295392 | Python | Python | py | Runtime Error | 0 | 0 | 1580 | import sys
sys.setrecursionlimit(1000000)
def main():
process()
def process():
for data in get_dataset():
H = int(data)
W = int(data[0])
field = create_field(H, W)
print search(H, W, data, field)
def search(H, W, data, field):
count = 0
for i in xrange(H):
f... |
s535501023 | p00118 | u683968848 | 1493295418 | Python | Python | py | Runtime Error | 0 | 0 | 1551 | import sys
sys.setrecursionlimit(100000)
def process():
for data in get_dataset():
H = int(data)
W = int(data[0])
field = create_field(H, W)
print search(H, W, data, field)
def search(H, W, data, field):
count = 0
for i in xrange(H):
for j in xrange(W):
... |
s717103279 | p00118 | u683968848 | 1493296595 | Python | Python | py | Runtime Error | 0 | 0 | 1443 | import sys
def process():
for data in get_dataset():
H = len(data)
W = len(data[0])
field = create_field(H, W)
print search(H, W, data, field)
def search(H, W, data, field):
count = 0
for i in xrange(H):
for j in xrange(W):
if field[i][j] == 0:
... |
s015925300 | p00118 | u683968848 | 1493296606 | Python | Python | py | Runtime Error | 0 | 0 | 1472 | import sys
sys.setrecursionlimit(10000)
def process():
for data in get_dataset():
H = len(data)
W = len(data[0])
field = create_field(H, W)
print search(H, W, data, field)
def search(H, W, data, field):
count = 0
for i in xrange(H):
for j in xrange(W):
... |
s485911056 | p00118 | u577311000 | 1493299374 | Python | Python3 | py | Runtime Error | 0 | 0 | 840 | # -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10*6)
def search(values,hp,vp,item):
if not (0<=hp<len(values)): return
if not (0<=vp<len(values[hp])): return
if item!=values[hp][vp]: return
values[hp][vp]=True
search(values,hp-1,vp,item)
search(values,hp+1,vp,item)
search(values,hp,vp-1,item)
search... |
s512413676 | p00118 | u284851373 | 1493299850 | Python | Python | py | Runtime Error | 0 | 0 | 1394 | Last login: Thu Apr 27 19:24:49 on ttys001
[@toshiki-s ~ 20:56:20]
$cd Desktop/
.DS_Store Mendeley Desktop.app/ OTHER/
.localized NAIST/ Readme.webloc
[@toshiki-s ~ 20:56:20]
$cd Desktop/NAIST/
.DS_Store advancedCource/ procon/
[@toshiki-s ~ ... |
s563675844 | p00118 | u284851373 | 1493299967 | Python | Python | py | Runtime Error | 0 | 0 | 1401 | Last login: Thu Apr 27 19:24:49 on ttys001
[@toshiki-s ~ 20:56:20]
$cd Desktop/
.DS_Store Mendeley Desktop.app/ OTHER/
.localized NAIST/ Readme.webloc
[@toshiki-s ~ 20:56:20]
$cd Desktop/NAIST/
.DS_Store advancedCource/ procon/
[@toshiki-s ~ ... |
s576024216 | p00118 | u284851373 | 1493300052 | Python | Python | py | Runtime Error | 0 | 0 | 963 | # -*- coding:utf-8 -*-
import sys
sys.setrecursionlimit(10000000000)
def dfs(x, y, sym):
field[x][y] = '.'
for dx in range(-1,2):
if dx==-1 or dx==1:
nx = x + dx
ny = y
if(nx>=0 and nx<N and 0<=ny and ny<M and field[nx][ny]==sym):
dfs(nx, ny, sym)
... |
s672700602 | p00118 | u284851373 | 1493301175 | Python | Python | py | Runtime Error | 0 | 0 | 1361 | # -*- cod:utf-8 -*-
import sys
sys.setrecursionlimit(100000000)
def dfs(x, y, sym):
field[x][y] = '.'
for dx in range(-1,2):
if dx==-1 or dx==1:
nx = x + dx
ny = y
if(nx>=0 and nx<N and 0<=ny and ny<M and field[nx][ny]==sym):
dfs(nx, ny, sym)
... |
s909684031 | p00118 | u284851373 | 1493301309 | Python | Python | py | Runtime Error | 0 | 0 | 1359 | # -*- cod:utf-8 -*-
import sys
sys.setrecursionlimit(1000000)
def dfs(x, y, sym):
field[x][y] = '.'
for dx in range(-1,2):
if dx==-1 or dx==1:
nx = x + dx
ny = y
if(nx>=0 and nx<N and 0<=ny and ny<M and field[nx][ny]==sym):
dfs(nx, ny, sym)
e... |
s606764504 | p00118 | u284851373 | 1493301377 | Python | Python | py | Runtime Error | 0 | 0 | 1358 | # -*- cod:utf-8 -*-
import sys
sys.setrecursionlimit(100000)
def dfs(x, y, sym):
field[x][y] = '.'
for dx in range(-1,2):
if dx==-1 or dx==1:
nx = x + dx
ny = y
if(nx>=0 and nx<N and 0<=ny and ny<M and field[nx][ny]==sym):
dfs(nx, ny, sym)
el... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.