求助!!能在Spyder中运行,为什么会RE
查看原帖
求助!!能在Spyder中运行,为什么会RE
211044
science123楼主2021/12/5 13:15
a=input().split()
n,m,k=int(a[0]),int(a[1]),int(a[2])
import pandas as pd
b=[]
for i in range(1,n+1):
    b.append(i)
c=pd.DataFrame(columns=b,index=b)
for i in range(m):
    m2=input().split()
    for x in c.columns:
        for y in c.index:
            if abs(x-int(m2[0]))+abs(y-int(m2[1]))<=2:
                c[x][y]=1
for i in range(k):
    k2=input().split()
    for x in c.columns:
        for y in c.index:
            if abs(x-int(k2[0]))<=2 and abs(y-int(k2[1]))<=2:
                c[x][y]=1
s=0
for x in c.columns:
    for y in c.index:
        if c[x][y]==1:
            s+=1
print(n**2-s)
2021/12/5 13:15
加载中...