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
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s420128525
p00101
u197615660
1374676231
Python
Python
py
Accepted
10
4204
106
num = input() for i in range(num): old = raw_input() new = old.replace('Hoshino', 'Hoshina') print new
p00101
<H1>Aizu PR</H1> <p> An English booklet has been created for publicizing Aizu to the world. When you read it carefully, you found a misnomer (an error in writing) on the last name of Masayuki Hoshina, the lord of the Aizu domain. The booklet says "Hoshino" not "Hoshina". </p> <p> Your task is to write a program whic...
3 Hoshino Hashino Masayuki Hoshino was the grandson of Ieyasu Tokugawa.
Hoshina Hashino Masayuki Hoshina was the grandson of Ieyasu Tokugawa.
13,287
s192656476
p00102
u912237403
1414579785
Python
Python
py
Accepted
20
4224
265
while 1: n=input()+1 if n==1: break x=[] y=[0]*n N=range(n) for i in N[:-1]: a=map(int,raw_input().split(' ')) a.append(sum(a)) x.append(a) for j in N: y[j]+=a[j] x.append(y) for i in N: print "".join([str(e).rjust(5) for e in x[i]])
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,288
s611671895
p00102
u912237403
1414580766
Python
Python
py
Accepted
20
4228
273
while 1: n=input()+1 if n==1: break x=[] y=[0]*n for _ in range(n-1): a=map(int,raw_input().split(' ')) a.append(sum(a)) s="" for i in range(n): y[i]+=a[i] s+=str(a[i]).rjust(5) print s print "".join([str(e).rjust(5) for e in y])
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,289
s289524397
p00102
u912237403
1414581324
Python
Python
py
Accepted
20
4228
260
while 1: n=input()+1 if n==1: break x=[] y=[0]*n for i in range(n-1): a=map(int,raw_input().split()) a.append(sum(a)) x.append(a) for i in range(n): y[i]+=a[i] x.append(y) for a in x: print "".join(map(lambda x:str(x).rjust(5),a))
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,290
s820352455
p00102
u912237403
1414581748
Python
Python
py
Accepted
10
4228
268
while 1: n = input() if n==0: break x = [] y = [0]*(n+1) for i in range(n): a=map(int, raw_input().split()) a.append(sum(a)) x.append(a) for j in range(n+1): y[j] += a[j] x.append(y) for a in x: print "".join([str(e).rjust(5) for e in a])
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,291
s618356129
p00102
u672822075
1419287911
Python
Python3
py
Accepted
30
6720
333
while True: n=int(input()) if not n: break a=[list(map(int,input().split())) for _ in range(n)] t=[[0 for _ in range(n+1)] for _ in range(n+1)] for i in range(n): for j in range(n): t[i][j]=a[i][j] t[i][n]+=a[i][j] t[n][j]+=a[i][j] t[n][n]+=a[i][j] for i in range(n+1): print("".join(map("{0:>5}".f...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,292
s787596283
p00102
u014849532
1420125821
Python
Python3
py
Accepted
40
6732
568
#!/usr/bin/python3 while True: n = int(input()) if (n == 0): break mat = [ [] for _ in range(n) ] row = [ 0 for _ in range(n) ] col = [ 0 for _ in range(n) ] for i in range(n): ln = list(map(int, input().split(' '))) mat[i] = ln row[i] = sum(ln) for j in ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,293
s343013391
p00102
u586434734
1421471236
Python
Python
py
Accepted
20
4236
785
#!/usr/bin/python # -*- coding: utf-8 -*- def main(): while(True): # 入力 N = int(raw_input()) if N == 0: break inp = [] for x in range(N): input_list = map(int, raw_input().split()) inp.append(input_list) printAns(inp) def printA...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,294
s883513467
p00102
u586434734
1421471296
Python
Python
py
Accepted
10
4236
686
#!/usr/bin/python # -*- coding: utf-8 -*- def main(): while(True): # 入力 N = int(raw_input()) if N == 0: break inp = [] for x in range(N): input_list = map(int, raw_input().split()) inp.append(input_list) printAns(inp) def printA...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,295
s593324197
p00102
u879226672
1423237752
Python
Python
py
Accepted
20
4252
877
while True: n = int(raw_input()) if n == 0: break else: # n > 0 table = [] for m in range(n): line = [] line = map(int,raw_input().split()) line_sum = sum(line) line.append(line_sum) table.append(line) ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,296
s557054940
p00102
u040533857
1426048321
Python
Python3
py
Accepted
40
6720
423
while True: data=[] n = int(input()) if n==0: break for i in range(n): spam=list(map(int,input().split())) spam.append(sum(spam)) data.append(spam) spam=[] for i in range(n+1): spam.append(sum(x[i] for x in data)) data.append(spam) for i in range(n...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,297
s779311158
p00102
u580607517
1427631423
Python
Python
py
Accepted
10
4224
272
while True: n = int(raw_input()) if n == 0: break a = [map(int, raw_input().split()) for i in xrange(n)] a = [l + [sum(l)] for l in a] a.append([sum([l[i] for l in a]) for i in xrange(len(a[0]))]) print "\n".join(["".join([str(i).rjust(5) for i in l]) for l in a])
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,298
s371157048
p00102
u266872031
1428057877
Python
Python
py
Accepted
20
4256
535
while(1): n=int(raw_input()) if n==0: break else: F=[] for i in range(n): F.append([int(x) for x in raw_input().split()]) F.append([0 for x in range(n+1)]) for i in range(n): F[i]=F[i]+[sum(F[i])] for j in range(n+1): s=0 ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,299
s679291463
p00102
u379499530
1432098512
Python
Python
py
Accepted
20
4228
337
while True: num = input() if num == 0: break mrx = [] row = [0] * (num + 1) for i in range(num): mrx.append(map(int, raw_input().split())) mrx[i].append(sum(mrx[i])) for j in range(num + 1): row[j] += mrx[i][j] mrx.append(row) for i in mrx: print "".join([str(s).rjus...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,300
s597776174
p00102
u308369184
1433750483
Python
Python3
py
Accepted
40
6720
413
while True: data=[] n=int(input()) if n==0:break for i in range(n): a=list(map(int,input().split(' '))) a.append(sum(a)) data.append(a) a=[] for i in range(n+1): a.append(sum(x[i] for x in data)) data.append(a) for i in range(n+1): for j in range(n...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,301
s554497188
p00102
u873482706
1435145803
Python
Python
py
Accepted
10
4224
579
while True: N = int(raw_input()) if N == 0: break total = None result = [] for i in range(N): lis = list(map(int, raw_input().split(' '))) lis.append(sum(lis)) result.append(lis) if total == None: total = lis[:] else: for i in range(len...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,302
s267061901
p00102
u985046243
1437380331
Python
Python3
py
Accepted
30
6724
440
def print_row(iterable): print(''.join(map(lambda x: str(x).rjust(5), iterable)), str(sum(iterable)).rjust(5), sep='') while True: n = int(input()) if n == 0: break m = [] for i in range(n): m.append(list(map(int, input().split()))) last = [0 for i in range(n)] ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,303
s420115077
p00102
u727466163
1440431799
Python
Python
py
Accepted
20
6308
497
import sys try: while 1: temp = input() if (temp==0): break N = temp a = [] for i in range(N): a.append(map(int, raw_input().split())+[0]) a.append([0 for i in range(0,temp+1)]) for i in range(0,temp): for j in range(0,temp): a[i][temp] += a[i][j] for k in range(0,temp+1): for l in rang...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,304
s954493329
p00102
u775586391
1451496848
Python
Python3
py
Accepted
40
7628
397
while True: l = [] n = int(input()) if n == 0: break lx = [0 for i in range(n+1)] for j in range(n): l1 = [int(i) for i in input().split()] c = 0 for i in l1: c += i l1.append(c) for i in range(n+1): lx[i] += l1[i] l.append(l1) l.append(lx) for s in l: a = '' ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,305
s231687557
p00102
u870028426
1459463133
Python
Python
py
Accepted
20
6344
567
n = int(raw_input()) while n != 0: input_list = [] for x in range(n): input_list.append(map(int, raw_input().split(' '))) for x in range(n): input_list[x].append(sum(input_list[x])) print ''.join(map(lambda n:"{:>5}".format(n), input_list[x])) input_len = len(input_list[0]) ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,306
s660753953
p00102
u755162050
1468584901
Python
Python3
py
Accepted
40
7624
876
from sys import stdin if __name__ == '__main__': # is_begin = False for n in stdin: if int(n) == 0: break # else: # if is_begin: # print() # is_begin = True bottom_total = [] right_total = [] for _ in range(int(n)): ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,307
s470592631
p00102
u755162050
1468819969
Python
Python3
py
Accepted
40
7692
520
def output_res(row): print(''.join(map(lambda num: str(num).rjust(5), row)), str(sum(row)).rjust(5), sep='') def main(): while True: n = int(input()) if n == 0: break bottom_total = [0 for _ in range(n)] for _ in range(n): each_line = list(map(int, inpu...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,308
s302890796
p00102
u648595404
1469729273
Python
Python3
py
Accepted
30
7736
582
def print_list_inline(tr_list): inline = map(lambda string:"{:>5}".format(string),tr_list) inline = list(inline) print(("").join(inline)) while True: n = int(input()) if n != 0: sum_col = [0 for i in range(n+1)] for i in range(n): list_row = list(map(int,input().split("...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,309
s759198829
p00102
u589886885
1472141759
Python
Python3
py
Accepted
30
7744
552
while True: n = int(input()) if n == 0: break a = [] b = [] for i in range(n): a.append([int(x) for x in input().split()]) for i in range(n): a[i].append(sum(a[i])) for i in range(n + 1): sum_ = 0 for j in range(n): sum_ += a[j][i] ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,310
s768920317
p00102
u894114233
1475292410
Python
Python
py
Accepted
10
6468
670
while 1: n=int(raw_input()) if n==0:break a=[map(int,raw_input().split()) for _ in xrange(n)] ans=[[0]*(n+1) for _ in xrange(n+1)] for i in xrange(n+1): for j in xrange(n+1): if i==n : if j==n: ans[n][n]+=sum(ans[n]) else: ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,311
s548178123
p00102
u500396695
1477946727
Python
Python3
py
Accepted
30
7748
357
while True: n = int(input()) if n == 0: break a = [list(map(int, input().split())) for i in range(n)] t = [[0 for i in range(n + 1)] for i in range(n + 1)] for i in range(n): for j in range(n): t[i][j] = a[i][j] t[i][n] += a[i][j] t[n][j] += a[i][j] t[n][n] += a[i][j] for i in range(n + 1): prin...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,312
s748437334
p00102
u546285759
1479353660
Python
Python3
py
Accepted
50
7588
583
while True: n = int(input()) if n == 0: break row = n tab = [] for i in range(row): r = list(map(int, input().split())) r.append(sum(r)) tab.append(r) bel = [] for i in range(row): tmp = 0 for j in range(row): tmp += tab[j][i] ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,313
s777091701
p00102
u301729341
1481558630
Python
Python3
py
Accepted
30
7512
609
while True: Num_lis =[] n = int(input()) if n == 0: break for i in range(n): Num_lis.append(list(map(int,input().split()))) for j in range(n): sum_num = 0 for k in range(n): sum_num += Num_lis[j][k] Num_lis[j].append(sum_num) Num_lis.append([...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,314
s428832932
p00102
u919202930
1481611361
Python
Python3
py
Accepted
30
7688
692
def rowSum(matrix): n=len(matrix) sumcolumn=[0]*n for i in range(0,n): sumcolumn[i] = sum(matrix[i]) return sumcolumn def colSum(matrix): n=len(matrix) sumrow=[0]*n for i in range(0,n): for j in range(0,n): sumrow[i]+=matrix[j][i] return sumrow while True: n=int(input()) if n==0: br...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,315
s886053358
p00102
u078042885
1485006962
Python
Python3
py
Accepted
30
7620
338
while 1: n=int(input()) if n==0:break a = [] for i in range(n): a+=[list(map(int, input().split()))] a[i]+=[sum(a[i])] for j in range(n):print('%5d'%a[i][j],end='') print('%5d'%a[i][n]) a=list(zip(*a[::-1])) for i in range(n):print('%5d'%sum(a[i]),end='') prin...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,316
s194729191
p00102
u711765449
1485269895
Python
Python3
py
Accepted
40
7608
764
while True: n = int(input()) if n == 0: break arr = [[0] * n] * n for i in range(n): arr[i] = list(map(int,input().split())) for i in range(n): tmp = 0 for j in range(n): tmp += arr[i][j] arr[i].append(tmp) last_line = [] for j in range(n...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,317
s820275768
p00102
u811773570
1486977662
Python
Python3
py
Accepted
40
7920
647
from copy import deepcopy def main(): while True: n = int(input()) if n == 0: break tate = [0 for i in range(n)] for i in range(n): num = 0 m = map(int, input().split()) hoge = deepcopy(m) tate = [x + y for (x, y) in zip...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,318
s165164924
p00102
u875131962
1487081113
Python
Python3
py
Accepted
40
8120
395
import functools n = int(input()) while(n): bottom_record = [0]*(n+1) for i in range(0, n): l = list(map(int, input().split())) l.append(functools.reduce(lambda x, y: x + y, l)) bottom_record = [x + y for(x,y) in zip(bottom_record, l)] print(''.join(map('{0:5d}'.format, l))) ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,319
s709132889
p00102
u875131962
1487082588
Python
Python3
py
Accepted
30
7628
344
n = int(input()) while(n): bottom_record = [0]*(n+1) for i in range(0, n): l = list(map(int, input().split())) l.append(sum(l)) bottom_record = [x + y for(x,y) in zip(bottom_record, l)] print(''.join(map('{0:5d}'.format, l))) print(''.join(map('{0:5d}'.format, bottom_record...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,320
s765689340
p00102
u490032117
1487083862
Python
Python3
py
Accepted
30
7624
448
def main(): while True: N = int(input()) if N == 0: break A = [ list(map(int, input().split(" "))) for _ in range(N) ] tot = [sum(col[r] for col in A) for r in range(N)] A.append(tot) for col in A: col.append(su...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,321
s939504718
p00102
u661290476
1487313299
Python
Python3
py
Accepted
30
7660
384
while True: n = int(input()) if n == 0: break total = [0] * (n + 1) for i in range(n): a = [int(i) for i in input().split()] a.append(sum(a)) for j in range(n + 1): print("%5d" % (a[j]), end = "") total[j] += a[j] print() for i in range...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,322
s148682965
p00102
u462831976
1494160432
Python
Python3
py
Accepted
30
7508
541
# -*- coding: utf-8 -*- import sys import os for s in sys.stdin: n = int(s) if n == 0: break M = [] for i in range(n): lst = list(map(int, input().split())) lst.append(sum(lst)) M.append(lst) last_lst = [] # vertical sum for i in range(n+1): sumv =...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,323
s887595126
p00102
u546285759
1501637438
Python
Python3
py
Accepted
30
7648
402
def form(x, e=""): print("{:>5}".format(x), end=e) while True: n = int(input()) if n == 0: break rows = [list(map(int, input().split())) for _ in range(n)] for row in rows: for r in row: form(r) form(sum(row), "\n") columns = list(zip(*rows)) for column i...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,324
s095918412
p00102
u546285759
1501638021
Python
Python3
py
Accepted
30
7612
422
while True: n = int(input()) if n == 0: break rows = [list(map(int, input().split())) for _ in range(n)] for row in rows: print("".join(map("{0:>5}".format, row)), end="") print("{:>5}".format(sum(row))) columns = list(zip(*rows)) print("".join(map("{0:>5}".format, list(s...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,325
s671335581
p00102
u748033250
1503562180
Python
Python3
py
Accepted
30
7696
490
while(1): box = [] num = int(input()) if num == 0: break [box.append(list(map(int,input().split()))) for i in range(num)] [box[i].append(sum(box[i])) for i in range(num)] box_replace = list(map(list, zip(*box))) temp = [[]] [temp[0].append(sum(box_replace[i])) for i in range(num+1)] box += temp box = [list(ma...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,326
s081963484
p00102
u811733736
1504184210
Python
Python3
py
Accepted
30
7660
899
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0102&lang=jp """ import sys def solve(data): for d in data: d.append(sum(d)) v_sum = [0] * len(data[0]) for d in data: for x, n in enumerate(d): v_sum[x] += n data.append(v_sum) return...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,327
s279365292
p00102
u855694108
1504668590
Python
Python3
py
Accepted
30
7820
976
import sys def main(): for line in sys.stdin: n = int(line) if n != 0: a = [] for _ in range(n): a.append(list(map(int, input().split()))) a.append(list(range(n + 1))) for x in range(n): hoge = 0 for y i...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,328
s289561912
p00102
u957021183
1505293210
Python
Python3
py
Accepted
30
7712
531
# Aizu Problem 0102: Matrix-like Computation # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") while True: N = int(input()) if N == 0: break M = [[int(_) for _ in input().split()] for __ in range(N)] for i in ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,329
s399743183
p00102
u214404619
1509523201
Python
Python3
py
Accepted
30
7720
539
while True: n = int(input()) if n == 0: break a = [] for i in range(n): a.append([int(num) for num in input().split()]) for i in range(n): sum = 0 for j in range(n): sum += a[i][j] a[i].append(sum) a.append([]) for i in range(n + 1): ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,330
s412786355
p00102
u742505495
1510044502
Python
Python3
py
Accepted
30
7748
477
import sys import math while True: n = int(input()) if n == 0: break data = [list(map(int,input().split())) for i in range(n)] data.append([0 for i in range(n+1)]) for i in range(n+1): if i != n: data[i].append(sum(data[i])) for j in range(n): data[n][i] = data[n][i]+data[j][i] for i in range(n+1): ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,331
s598548658
p00102
u742178809
1511509938
Python
Python3
py
Accepted
30
7724
643
import sys #from me.io import dup_file_stdin def print2d(m): for r in m: print("".join(["{:5d}".format(x) for x in r])) #@dup_file_stdin def solve(): while True: n = int(sys.stdin.readline()) if n == 0 : return m = [] for i in range(n): m.append(...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,332
s015325974
p00102
u203261375
1515218403
Python
Python3
py
Accepted
20
5620
478
while True: n = int(input()) if n == 0: break matrix = [[] for _ in range(n)] col_sum = [0 for _ in range(n + 1)] for i in range(n): matrix[i] = list(map(int, input().split())) matrix[i].append(sum(matrix[i])) for j in range(n + 1): col_sum[j] += matrix[...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,333
s920789353
p00102
u546285759
1515813883
Python
Python3
py
Accepted
20
5620
349
while True: n = int(input()) if n == 0: break matrix = [list(map(int, input().split())) for _ in range(n)] for i in range(n): sum_ = sum(matrix[i]) print(str("{:>5d}" * (n+1)).format(*matrix[i], sum_)) sum_ = [sum(e) for e in list(zip(*matrix))] print(str("{:>5d}" * (n+1)...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,334
s072039489
p00102
u808429775
1516276437
Python
Python3
py
Accepted
20
5620
543
while True: inputCount = int(input()) if inputCount == 0: break table = [] for lp in range(inputCount): content = [int(item) for item in input().split(" ")] content.append(sum(content)) table.append(content) table.append([]) for col in range(inputCount + 1): ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,335
s626411259
p00102
u150984829
1517475460
Python
Python3
py
Accepted
30
5644
247
while 1: n=int(input()) if n==0:break; a=[list(map(int,input().split()))for _ in[0]*n] for r in a: for s in r:print(f"{s:5}",end='') print(f"{sum(r):5}") for c in zip(*a):print(f"{sum(c):5}",end='') print(f"{sum([sum(r)for r in a]):5}")
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,336
s219184136
p00102
u150984829
1517475465
Python
Python3
py
Accepted
30
5644
247
while 1: n=int(input()) if n==0:break; a=[list(map(int,input().split()))for _ in[0]*n] for r in a: for s in r:print(f"{s:5}",end='') print(f"{sum(r):5}") for c in zip(*a):print(f"{sum(c):5}",end='') print(f"{sum([sum(r)for r in a]):5}")
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,337
s584563828
p00102
u150984829
1517475467
Python
Python3
py
Accepted
20
5648
247
while 1: n=int(input()) if n==0:break; a=[list(map(int,input().split()))for _ in[0]*n] for r in a: for s in r:print(f"{s:5}",end='') print(f"{sum(r):5}") for c in zip(*a):print(f"{sum(c):5}",end='') print(f"{sum([sum(r)for r in a]):5}")
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,338
s642021234
p00102
u150984829
1517476377
Python
Python3
py
Accepted
30
5596
220
while 1: n=int(input()) if n==0:break; a=[] for _ in[0]*n: b=list(map(int,input().split())) b+=[sum(b)] a+=[b] for s in b:print("%5d"%s,end='') print() for c in zip(*a):print("%5d"%sum(c),end='') print()
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,339
s155788783
p00102
u150984829
1517476380
Python
Python3
py
Accepted
30
5596
220
while 1: n=int(input()) if n==0:break; a=[] for _ in[0]*n: b=list(map(int,input().split())) b+=[sum(b)] a+=[b] for s in b:print("%5d"%s,end='') print() for c in zip(*a):print("%5d"%sum(c),end='') print()
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,340
s877497834
p00102
u150984829
1517476382
Python
Python3
py
Accepted
30
5592
220
while 1: n=int(input()) if n==0:break; a=[] for _ in[0]*n: b=list(map(int,input().split())) b+=[sum(b)] a+=[b] for s in b:print("%5d"%s,end='') print() for c in zip(*a):print("%5d"%sum(c),end='') print()
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,341
s023006523
p00102
u150984829
1517476384
Python
Python3
py
Accepted
30
5596
220
while 1: n=int(input()) if n==0:break; a=[] for _ in[0]*n: b=list(map(int,input().split())) b+=[sum(b)] a+=[b] for s in b:print("%5d"%s,end='') print() for c in zip(*a):print("%5d"%sum(c),end='') print()
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,342
s338721498
p00102
u150984829
1517476386
Python
Python3
py
Accepted
20
5600
220
while 1: n=int(input()) if n==0:break; a=[] for _ in[0]*n: b=list(map(int,input().split())) b+=[sum(b)] a+=[b] for s in b:print("%5d"%s,end='') print() for c in zip(*a):print("%5d"%sum(c),end='') print()
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,343
s239199302
p00102
u150984829
1517476591
Python
Python3
py
Accepted
30
5604
227
while 1: n=int(input()) if n==0:break; a=[] for i in range(n): a+=[list(map(int,input().split()))] a[i]+=[sum(a[i])] for s in a[i]:print("%5d"%s,end='') print() for c in zip(*a):print("%5d"%sum(c),end='') print()
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,344
s937505215
p00102
u150984829
1517476594
Python
Python3
py
Accepted
30
5604
227
while 1: n=int(input()) if n==0:break; a=[] for i in range(n): a+=[list(map(int,input().split()))] a[i]+=[sum(a[i])] for s in a[i]:print("%5d"%s,end='') print() for c in zip(*a):print("%5d"%sum(c),end='') print()
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,345
s727960399
p00102
u150984829
1517476597
Python
Python3
py
Accepted
30
5600
227
while 1: n=int(input()) if n==0:break; a=[] for i in range(n): a+=[list(map(int,input().split()))] a[i]+=[sum(a[i])] for s in a[i]:print("%5d"%s,end='') print() for c in zip(*a):print("%5d"%sum(c),end='') print()
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,346
s540600990
p00102
u150984829
1517476740
Python
Python3
py
Accepted
30
5600
222
while 1: n=int(input()) if n==0:break; a=[] for i in range(n): b=list(map(int,input().split())) a+=[b+[sum(b)]] for s in a[i]:print("%5d"%s,end='') print() for c in zip(*a):print("%5d"%sum(c),end='') print()
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,347
s768244877
p00102
u043254318
1520321012
Python
Python3
py
Accepted
30
5628
564
while True: N = int(input()) if N == 0: break table = [[0 for i in range(N+1)] for j in range(N+1)] for i in range(N): n = [int(i) for i in input().split()] for j in range(N): table[i][j] = n[j] for i in range(N): for j in range(N): table[i]...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,348
s405163676
p00102
u428982301
1527578879
Python
Python3
py
Accepted
30
5632
792
while True: rows = [] total = {} n = int(input()) if (n == 0): break for r in range(n): datas = map(int, input().split()) ds = list(datas) rows.append(ds) for r in range(n): s = 0 for c in range(n): s += rows[r][c] ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,349
s073507586
p00102
u352394527
1527641892
Python
Python3
py
Accepted
20
5604
417
while True: n = int(input()) if not n: break mat = [] for _ in range(n): lst = list(map(int, input().split())) lst.append(sum(lst)) mat.append(lst) sum_lst = [] for i in range(len(mat[0])): s = 0 for j in range(n): s += mat[j][i] sum_lst.append(s) mat.append(sum_lst) ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,350
s615606150
p00102
u136916346
1528345890
Python
Python3
py
Accepted
20
5612
286
while 1: l=[list(map(int,input().split())) for i in range(int(input()))] if not l:break le=len(l) for (i,j) in enumerate(l): l[i].append(sum(j)) l.append([sum([l[k][i] for k in range(le)]) for i in range(le+1)]) [print("".join([str(j).rjust(5) for j in i])) for i in l]
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,351
s491619506
p00102
u847467233
1529185163
Python
Python3
py
Accepted
30
5636
435
# AOJ 0102: Matrix-like Computation # Python3 2018.6.17 bal4u while True: n = int(input()) if n == 0: break arr = [[0 for r in range(n+2)] for c in range(n+2)] for r in range(n): arr[r] = list(map(int, input().split())) arr[r].append(sum(arr[r])) for c in range(n+1): s = 0 for r in range(n): s += arr[r]...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,352
s250423437
p00102
u894941280
1349281761
Python
Python
py
Accepted
20
5216
442
import sys while True: a=int(input()) if a==0: break soug,tt,te=[0]*a,[],0 for i in range(a): hoge=map(int,raw_input().split()) te=0 for j in range(a): te+=hoge[j] soug[j]+=hoge[j] sys.stdout.write("%5d"%hoge[j]) else: sys.stdout.write("%5d"%te) ; print"" else: te=0 f...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,353
s523320737
p00102
u881567576
1350211333
Python
Python
py
Accepted
20
4268
608
while 2 > 1: line_num = int(raw_input()) if line_num < 1: break mylist = [0,0,0,0,0,0,0,0,0,0,0] for n in range(line_num): dat = map(int, raw_input().split(" ")) col_num = len(dat) row_sum = 0 for m in range(col_num): mylist[m] += dat[m] row_sum += dat[m] mylist[col_num] = row_sum disp = "" fo...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,354
s644568156
p00102
u017525488
1351961088
Python
Python
py
Accepted
10
4276
747
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys def solve(): while True: n = input() if n > 0: mat = [[0 for i in xrange(n + 1)] for j in xrange(n + 1)] for i in range(n): line = sys.stdin.readline().split() for j in range(n): ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,355
s734272751
p00102
u779627195
1354650893
Python
Python
py
Accepted
10
4260
580
import sys R = lambda:map(int,raw_input().split()) while 1: n = int(raw_input()) if n == 0: break lst = [] for i in xrange(n): lst.append(R()) lst[i].append(sum(lst[i])) s = [] for i in xrange(n+1): t = 0 for j in xrange(n): t += lst[j][i] s.a...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,356
s633251264
p00102
u665962315
1357433169
Python
Python
py
Accepted
20
4256
528
import sys while True: n = int(raw_input()) if n == 0: break a = [] for i in range(n): a.append(map(int, raw_input().split())) for i in range(n): a[i].append(sum(a[i])) col_sum = [] for col in range(len(a[0])): s = 0 for row in range(len(a)): ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,357
s825446922
p00102
u647766105
1357448336
Python
Python
py
Accepted
20
4264
385
while True: n=input() if n==0: break li=[[0]*(n+1) for unused in xrange(n+1)] for i in xrange(n): li[i][:n]=map(int,raw_input().split()) for i in xrange(n): li[i][n]=sum(li[i]) li[n][i]=sum([li[j][i] for j in xrange(n)]) li[n][n]=sum(li[n]) print "\n".join([""...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,358
s792042908
p00102
u577457452
1361544645
Python
Python
py
Accepted
20
4232
358
def print_nums(nums): print ''.join(['%5d' % num for num in nums]) while 1: n = int(raw_input()) if n == 0: break sums = [0] * (n + 1) for i in range(n): nums = map(int, raw_input().split()) nums.append(sum(nums)) print_nums(nums) for j in range(n + 1): s...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,359
s899451752
p00102
u575065019
1362264690
Python
Python
py
Accepted
20
4276
752
#coding:utf-8 ans=[] while True: curAns=[] n=input() if n ==0: break for i in xrange(n): lst=map(int,raw_input().split()) lst.append(sum(lst)) curAns.append(lst) lLst=[] #最後のリスト for i in xrange(n+1): #横方向探索 verSum=...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,360
s351355822
p00102
u147801965
1366984274
Python
Python
py
Accepted
20
4268
472
import sys f=lambda v,b: v.append(sum(b)) while True: c=input() if c==0: break x=range(c) z=range(c+1) q={} for i in x: q[i]=map(int,raw_input().split()) t=q.values()[i] f(t,t) q[i+1]=[] for g in x: w=[] for j in x: w.append(q.values()[...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,361
s266893223
p00102
u147801965
1366984378
Python
Python
py
Accepted
20
4268
432
import sys f=lambda v,b: v.append(sum(b)) while True: c=input() if c==0: break x=range(c);z=range(c+1);q={} for i in x: q[i]=map(int,raw_input().split());t=q.values()[i];f(t,t) q[i+1]=[] for g in x: w=[] for j in x: w.append(q.values()[j][g]) f(q[i+1]...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,362
s423325417
p00102
u542421762
1370149236
Python
Python
py
Accepted
10
4260
614
import sys def solv(matrix): for row in matrix: s = sum(row) row.append(s) r = [] l = len(matrix[0]) for c in range(l): column = map(lambda x: x[c], matrix) sc = sum(column) r.append(sc) matrix.append(r) return matrix while True: n = int(sys.stdin...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,363
s143713241
p00102
u759934006
1372579392
Python
Python
py
Accepted
30
4256
464
while True: n = int(raw_input()) if n == 0: break a = [[] for i in range(n + 1)] for i in range(n + 1): if i < n: a[i] = map(int, raw_input().split()) a[i].append(sum(a[i])) else: a[i] = [sum([a[j][k] for j in range(n)]) for k in range(n + 1)...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,364
s265523104
p00102
u759934006
1372579826
Python
Python
py
Accepted
20
4252
443
while True: n = int(raw_input()) if n == 0: break a = [[] for i in range(n + 1)] for i in range(n + 1): if i < n: a[i] = map(int, raw_input().split()) a[i].append(sum(a[i])) else: a[i] = [sum([a[j][k] for j in range(n)]) for k in range(n + 1)]...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,365
s547959415
p00102
u759934006
1372579957
Python
Python
py
Accepted
10
4252
421
while True: n = int(raw_input()) if n == 0: break a = [[] for i in range(n + 1)] for i in range(n + 1): if i < n: a[i] = map(int, raw_input().split()) a[i].append(sum(a[i])) else: a[i] = [sum([a[j][k] for j in range(n)]) for k in range(n + 1)]...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,366
s149093762
p00102
u759934006
1372580468
Python
Python
py
Accepted
20
4240
391
while True: n = int(raw_input()) if n == 0: break a = [] for i in range(n + 1): if i < n: a.append(map(int, raw_input().split())) a[i].append(sum(a[i])) else: a.append([sum([a[j][k] for j in range(n)]) for k in range(n + 1)]) for aa in a:...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,367
s401207654
p00102
u454358619
1377373439
Python
Python
py
Accepted
20
4276
688
import sys def solve(): while True: n = input() if n > 0: mat = [[0 for i in xrange(n + 1)] for j in xrange(n + 1)] for i in range(n): line = sys.stdin.readline().split() for j in range(n): mat[i][j] = int(line[j]) ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,368
s053734275
p00102
u782850731
1382355615
Python
Python
py
Accepted
20
4244
623
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin, exit def main(readline=stdin.readline): fmt = '{:5d}'.format while 1: n = int(readline()) if not n: exit() total = [0] * (n+1) for _ in range(n): s = 0 ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,369
s994396543
p00102
u093607836
1383134431
Python
Python
py
Accepted
20
4228
274
n = int(raw_input()) while n != 0: a = [map(int,raw_input().split()) for i in xrange(n)] a = [l + [sum(l)] for l in a] a.append([sum([l[i] for l in a]) for i in xrange(len(a[0]))]) print '\n'.join([''.join([str(i).rjust(5) for i in l]) for l in a]) n = int(raw_input())
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,370
s578668832
p00102
u633068244
1396095654
Python
Python
py
Accepted
20
4228
302
while True: n = int(raw_input()) if n == 0: break ls = [map(int, raw_input().split()) for i in range(n)]+[[0]*(n+1)] for i in range(n): ls[i].append(sum(ls[i])) for i in range(n+1): for j in range(n): ls[n][i] += ls[j][i] for row in ls: print ''.join(map(lambda x: str(x).rjust(5), row))
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,371
s458090987
p00102
u633068244
1396097063
Python
Python
py
Accepted
20
4232
297
while True: n = input() if n == 0: break ls = [map(int, raw_input().split())+[0] for i in range(n)]+[[0]*(n+1)] for row in range(n+1): for col in range(n): ls[n][col] += ls[row][col] if row != n else 0 ls[row][n] += ls[row][col] print "".join(map(lambda x: str(x).rjust(5), ls[row]))
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,372
s643654577
p00102
u633068244
1396097172
Python
Python
py
Accepted
10
4228
268
while 1: n = input() if n == 0: break l = [map(int, raw_input().split())+[0] for i in range(n)]+[[0]*(n+1)] for r in range(n+1): for c in range(n): l[n][c] += l[r][c] if r != n else 0 l[r][n] += l[r][c] print "".join(map(lambda x: str(x).rjust(5), l[r]))
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,373
s482905499
p00102
u193025715
1397813911
Python
Python
py
Accepted
10
4224
355
while True: n = input() ans = [] if n == 0: break tmp = [0] * (n+1) for i in range(n): ans.append(map(int, raw_input().split())) ans[i].append(sum(ans[i])) for j in range(len(ans[i])): tmp[j] += ans[i][j] ans.append(tmp) for a in ans: print "".join...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,374
s879127931
p00102
u770042163
1596183505
Python
Python3
py
Accepted
30
5616
574
while True: A = [] n = int(input()) if n == 0: break for i in range(n): A.append(list(map(int,input().split()))) result = A[:] result_T = list(map(list,zip(*A))) for line in result: line.append(sum(line)) for line in result_T: line.append(sum(line...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,375
s887018044
p00102
u240091169
1594906563
Python
Python3
py
Accepted
30
5608
441
while True : n = int(input()) if n == 0 : break L = [0] * n for i in range(n) : tmp = list(map(int, input().split())) for j in range(n) : L[j] += tmp[j] tmp.append(sum(tmp)) for j in range(n+1) : print(str(tmp[j]).rjust(5), end = ""...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,376
s964482115
p00102
u260980560
1588636894
Python
Python3
py
Accepted
30
5644
495
import sys readline = sys.stdin.readline write = sys.stdout.write fmt = "{:5d}".format def solve(): N = int(readline()) if N == 0: return False A = [list(map(int, readline().split())) for i in range(N)] for ln in A: write("".join(map(fmt, ln))) write(fmt(sum(ln))) write(...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,377
s523169812
p00102
u630911389
1585107946
Python
Python3
py
Accepted
30
5628
602
while(1): n = int(input()) if n == 0: break t = [[0] * (n + 1) for i in range(n + 1)] m = [] for i in range(0,n): m.append(list(int(x) for x in input().split(" "))) sum = 0 for i in range(0,n): sum1 = 0 sum2 = 0 for j in range(0,n): t[i][j]...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,378
s934524941
p00102
u606731189
1576581266
Python
Python3
py
Accepted
30
5624
587
while True: n=int(input()) if n==0: break i=0 mat=[] #リストを一つに while i<n: tmp_mat=list(map(int, input().split())) mat.extend(tmp_mat) i+=1 total=0 tmp_last=[0 for l in range(n+1)] for x in range(len(mat)): total+=mat[x] tmp_last[x%n]+=ma...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,379
s403876781
p00102
u942532706
1575616529
Python
Python3
py
Accepted
30
5636
372
while True: n = int(input()) if n == 0: break arr = [[0 for r in range(n+2)] for c in range(n+2)] for r in range(n): arr[r] = list(map(int, input().split())) arr[r].append(sum(arr[r])) for c in range(n+1): s = 0 for r in range(n): s += arr[r][c] arr[n][c] = s for r in range(n+1): for c in range(n+1...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,380
s150218959
p00102
u004929098
1574136026
Python
Python3
py
Accepted
30
5600
436
while 1: n = int(input()) if n == 0: break L = [] for i in range(n): L += [list(map(int,input().split()))+[0]] L += [[0]*(n+1)] for r in range(n): for c in range(n): L[r][n] += L[r][c] L[n][c] += L[r][c] L[n][n] += L[r][c] for f in ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,381
s906294269
p00102
u893117841
1573825356
Python
Python3
py
Accepted
20
5620
349
while True: n = int(input()) if n == 0: break matrix = [list(map(int, input().split())) for _ in range(n)] for i in range(n): sum_ = sum(matrix[i]) print(str("{:>5d}" * (n+1)).format(*matrix[i], sum_)) sum_ = [sum(e) for e in list(zip(*matrix))] print(str("{:>5d}" * (n+1)...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,382
s509549147
p00102
u803862921
1571454317
Python
Python3
py
Accepted
30
5632
448
while True: L = [] n = int(input()) if n == 0: break for _ in range(n): l = [int(x) for x in input().split()] l.append(sum(l)) L.append(l) l = [] for i in range(len(L[0])): s = [] for j in range(len(L)): s.append(L[j][i]) l.ap...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,383
s580449755
p00102
u313600138
1564309488
Python
Python3
py
Accepted
30
5616
407
while True: n = int(input()) if n==0: break A=[] for a in range(n): x =list(map(int, input().split())) x.append(sum(x)) A.append(x) Y=[] for j in range(n+1): y=0 for i in range(n): y+=A[i][j] Y.append(y) A.append(Y) for i in range(n+1): for j in range(n+1): ...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,384
s046573055
p00102
u090921599
1563714261
Python
Python3
py
Accepted
30
5640
471
while True: n = int(input()) if n == 0: break arr = [[0 for r in range(n+2)]for c in range(n+2)] for r in range(n): arr[r] = list(map(int, input().split())) arr[r].append(sum(arr[r])) for c in range(n+1): s = 0 for r in range(n): s += arr[r][...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,385
s518882497
p00102
u314166831
1563550437
Python
Python3
py
Accepted
30
5700
2,998
# coding=utf-8 ### ### for python program ### import sys import math # math class class mymath: ### pi pi = 3.14159265358979323846264338 ### Prime Number def pnum_eratosthenes(self, n): ptable = [0 for i in range(n+1)] plist = [] for i in range(2, n+1): if ptable...
p00102
<H1>Matrix-like Computation</H1> <p> Your task is to develop a tiny little part of spreadsheet software. </p> <p> Write a program which adds up columns and rows of given table as shown in the following figure: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_matrixLike" width="640"> <...
4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 4 52 96 15 20 86 22 35 45 45 78 54 36 16 86 74 55 0
52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815 52 96 15 20 183 86 22 35 45 188 45 78 54 36 213 16 86 74 55 231 199 282 178 156 815
13,386