【发布时间】:2021-03-23 11:47:52
【问题描述】:
我在 python 3 中编写了我的代码。它在 python ide 和 programiz online ide 上运行良好,但在 google 平台上出现 RUNTIME 错误。有人可以帮忙解释为什么会这样吗? 这是问题的链接:Vestigium
def main(x,n,N):
n = len(x)
r = 0
for i in x:
if len(i)> len(set(i)):
r += 1
cols = []
k = 0
for i in range(n):
col = []
for j in range(n):
col.append(x[i][j])
if i == j:
k += int(x[i][j])
cols.append(col)
c = 0
for i in cols:
if len(i)> len(set(i)):
c += 1
print("Case #",N,":",k,r,c,)
N = int(input())
for i in range(N):
x = []
n = int(input())
for j in range(n):
row = []
for p in range(n):
v = int(input())
row.append(v)
x.append(row)
num = i + 1
main(x,n,num)
【问题讨论】:
标签: python python-3.x algorithm error-handling google-code