python AOJ_ITP1_6_C:官方大厦

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python AOJ_ITP1_6_C:官方大厦相关的知识,希望对你有一定的参考价值。

# define
first = [[0 for i in range(10)] for j in range(3)]
second = [[0 for i in range(10)] for j in range(3)]
third = [[0 for i in range(10)] for j in range(3)]
forth = [[0 for i in range(10)] for j in range(3)]

# input
n = int(input())

datanum=n
info=[]

while n>0:
    info.append(list(map(int,input().split())))
    n -=1


def roomdata(x,f,r,v):
    x[f-1][r-1]+=v
        
for i in range(datanum):
    b=info[i][0]
    f=info[i][1]
    r=info[i][2]
    v=info[i][3]
    if b==1:
        roomdata(first,f,r,v)
    elif b==2:
        roomdata(second,f,r,v)
    elif b==3:
        roomdata(third,f,r,v)
    elif b==4:
        roomdata(forth,f,r,v)
        
# output
for i in range(3):
    print(" " + " ".join(map(str,first[i])))

print("#"*20)

for i in range(3):
    print(" " + " ".join(map(str,second[i])))

print("#"*20)

for i in range(3):
    print(" " + " ".join(map(str,third[i])))

print("#"*20)

for i in range(3):
    print(" " + " ".join(map(str,forth[i])))

以上是关于python AOJ_ITP1_6_C:官方大厦的主要内容,如果未能解决你的问题,请参考以下文章

python AOJ_ITP1_6_B查找丢失的卡片

python ITP1_6_C:官方House_codeShortVer_but_slow

探索尝试:用OpenCV官方发布的build包替换Pip命令安装的Python包(以失败告终)

python动态模块导入

Python-三元运算

Python修行之路__流程控制