submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s002759662 | p00102 | Runtime Error | import sys
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 ... | 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
|
<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">
<... |
s897981281 | p00102 | Runtime Error | import sys
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... | 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
|
<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">
<... |
s176487845 | p00102 | Runtime Error | import sys
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... | 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
|
<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">
<... |
s007741269 | p00102 | Runtime Error | import sys
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... | 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
|
<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">
<... |
s277924191 | p00102 | Runtime Error | import sys
while 1:
try:
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... | 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
|
<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">
<... |
s565998126 | p00102 | Runtime Error | import sys
while 1:
try:
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]
... | 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
|
<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">
<... |
s380667688 | p00102 | Runtime Error | import sys
while 1:
try:
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):#列に... | 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
|
<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">
<... |
s869435598 | p00102 | Runtime Error | import sys
while 1:
try:
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):#行に関して
... | 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
|
<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">
<... |
s717286997 | p00102 | Runtime Error | import sys
while 1:
try:
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... | 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
|
<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">
<... |
s013102266 | p00102 | Runtime Error | import sys
while 1:
try:
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 ... | 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
|
<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">
<... |
s528537474 | p00102 | Runtime Error | 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... | 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
|
<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">
<... |
s163561585 | p00102 | Runtime Error | #!/usr/bin/env python3
import sys
input_lines = [list(map(int, i.split(' '))) for i in sys.stdin.readlines()]
#print(input_lines)
cnt = 0
lastline = []
output = []
for i in input_lines:
if len(i) == 1:
cnt = i[0]
lastline = [0 for i in range(cnt+1)]
else:
i.append(sum(i))
for k in range(len(i)):
lastli... | 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
|
<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">
<... |
s367558850 | p00102 | Runtime Error | n = int(raw_input())
while n != 0:
input_list = []
for x in range(n):
input_list.append(map(int, raw_input().split(' ')))
last_list_row = []
for x in range(n):
input_list[x].append(sum(input_list[x]))
print ''.join(map(lambda n:"{:>5}".format(n), input_list))
last_list.ap... | 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
|
<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">
<... |
s000266619 | p00102 | Runtime Error | import functools
n = input()
while(n):
list = []
bottom_record = [0]*(n+1)
for i in range(0, n):
l = map(int, raw_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(str, l)))
p... | 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
|
<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">
<... |
s479600225 | p00102 | Runtime Error | import sys
l = []
index = 1
for input in sys.stdin:
l.append(input.split())
a = 0
for i in range(0,len(l),int(l[a][0])+1):
res = []
for j in range(0,int(l[i][0])+1):
res.append(0)
for j in range(i+1,int(l[i][0])+index):
temp = 0
print ' ',
for k in range(0,int(l[i][0]))... | 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
|
<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">
<... |
s406841939 | p00102 | Runtime Error | import numpy
| 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
|
<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">
<... |
s575841016 | p00102 | Runtime Error | while 1:
n=int(input())
if n:
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}")
| 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
|
<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">
<... |
s204426936 | p00102 | Runtime Error | while 1:
n=int(input())
if n==0:break;
a=[]
for i in range(n):
a[i]=[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()
| 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
|
<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">
<... |
s496780784 | p00102 | Runtime Error | while True:
count = int(input())
if count == 0: break
thing,money=[],[]
for i in range(count):
hoge = map(str,raw_input().split())
t = int(hoge[1])
thing.append(hoge[0])
money.append(t)
count = int(input())
if count == 0:
hoge = raw_input()
if hoge not in thing:
print 0
... | 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
|
<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">
<... |
s748458434 | p00102 | Runtime Error | 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])):
sum = 0
for row in range(len(a)):
... | 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
|
<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">
<... |
s950139995 | p00102 | Runtime Error | n = -1
while n != 0:
n = int(raw_input())
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]) | 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
|
<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">
<... |
s545764163 | p00102 | Runtime Error | 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 " ".joi... | 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
|
<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">
<... |
s014899692 | p00102 | WA: Presentation Error | 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:
for e in x[i]: print str(e).rjust(5),
print | 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
|
<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">
<... |
s403592817 | p00102 | WA: Presentation Error | f=0
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:
if f: print
for e in x[i]: print str(e).rjust(5),
f=1 | 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
|
<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">
<... |
s092712084 | p00102 | WA: Presentation Error | 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(str,t[i])... | 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
|
<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">
<... |
s177274171 | p00102 | WA: Presentation Error | #!/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... | 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
|
<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">
<... |
s949943677 | p00102 | WA: Presentation Error | #!/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... | 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
|
<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">
<... |
s376652210 | p00102 | WA: Presentation Error | 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)
... | 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
|
<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">
<... |
s366774800 | p00102 | WA: Presentation Error | 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)
... | 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
|
<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">
<... |
s898402491 | p00102 | WA: Presentation Error | while True:
num = input()
if num == 0: break
sht = []
for i in range(num):
sht.append(map(int, raw_input().split()))
sht[i].append(sum(sht[i]))
print " ".join(map(str, sht[i]))
row = []
for i in range(num + 1):
sm = 0
for j in range(num):
sm ... | 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
|
<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">
<... |
s067259601 | p00102 | WA: Presentation Error | 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... | 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
|
<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">
<... |
s062328562 | p00102 | WA: Presentation Error | 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)]
for row in m:
print(' '.join(map(str, row)), sum(row))
for (i, e) in enumerate(row):
last[i] += e
prin... | 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
|
<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">
<... |
s081816054 | p00102 | WA: Presentation Error | if __name__ == "__main__":
while True:
flag = input()
if flag == 0:
break
num, ans = [], [0]*(flag + 1)
for i in xrange(flag):
num.append(map(int, raw_input().split()))
for i in xrange(len(num)):
for j in xrange(len(num[i])):
... | 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
|
<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">
<... |
s400164182 | p00102 | WA: Presentation Error | 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)):
line... | 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
|
<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">
<... |
s250080255 | p00102 | WA: Presentation Error | 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(" ")))
sum_row = sum(list_row)
list_row.append(sum_row)
for j in range(len(list_row)):
sum_col[j] += ... | 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
|
<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">
<... |
s419212171 | p00102 | WA: Presentation Error | 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(" ")))
sum_row = sum(list_row)
list_row.append(sum_row)
for j in range(len(list_row)):
sum_col[j] += ... | 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
|
<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">
<... |
s140727288 | p00102 | WA: Presentation Error | 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:
... | 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
|
<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">
<... |
s845613049 | p00102 | WA: Presentation Error | 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:
... | 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
|
<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">
<... |
s501201607 | p00102 | WA: Presentation Error | 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]
... | 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
|
<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">
<... |
s257358923 | p00102 | WA: Presentation Error | 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])]
print(*a[i])
a=list(zip(*a[::-1]))
for i in range(n):print(sum(a[i]),end=' ')
print(sum(a[n])) | 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
|
<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">
<... |
s245425367 | p00102 | WA: Presentation Error | 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(str, l)))
print(' ... | 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
|
<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">
<... |
s136573748 | p00102 | WA: Presentation Error | 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))
print(" ".join(map(str, a)))
for j in range(n + 1):
total[j] += a[j]
print(" ".join(map(str, total))) | 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
|
<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">
<... |
s430807653 | p00102 | WA: Presentation Error | 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:
print("{:5d} ".format(r), end="")
print("{:5d}".format(sum(row)))
columns = list(zip(*rows))
for column in columns:
... | 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
|
<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">
<... |
s914486961 | p00102 | WA: Presentation Error | 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):
... | 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
|
<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">
<... |
s140019581 | p00102 | WA: Presentation Error | import sys
#from me.io import dup_file_stdin
def print2d(m):
[print(" ".join(map(str,r))) for r in m]
#@dup_file_stdin
def solve():
while True:
n = int(sys.stdin.readline())
if n == 0 :
return
m = []
for i in range(n):
m.append([int(x) for x in sys.stdin... | 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
|
<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">
<... |
s357825244 | p00102 | WA: Presentation Error | while True:
a=int(input())
if a == 0: break
b=[0]*a
for i in range(a):
d = map(str,raw_input().split())
q=0
for j in range(len(d)):
b[j]+=int(d[j])
q+=int(d[j])
b.append(d)
print d[j],
print q
w=0
for j in range(a): w+=b[j]
for i in range(a):
print b[i],
print... | 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
|
<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">
<... |
s170508981 | p00102 | WA: Presentation Error | while True:
a=int(input())
tage=[0]*(a+1)
if a ==0: break
for i in range(a):
su=0
hoge=map(int,raw_input().split())
for j in range(a):
tage[j]+=hoge[j]
su+=hoge[j]
print "%5d"% (hoge[j]),
else:
tage[j+1]+=su
print "%5d"%(su)
for i in range(a):
print "%5d"%(tag... | 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
|
<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">
<... |
s676104287 | p00102 | WA: Presentation Error | while True:
a = int(input())
if a == 0: break
tage,ans=0,[0]*a
for i in range(a):
hoge =map(int,raw_input().split())
su=0
for j in range(a):
su+=hoge[j]
ans[j]+=hoge[j]
print "%4d"%(hoge[j]),
else:
print "%4d"%(su)
tage+=su
for i in range(a):
print "%4d"%(ans[... | 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
|
<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">
<... |
s186132161 | p00102 | WA: Presentation Error | import sys
while True:
a=int(input())
if a==0: break
ans2,tage=0,[0]*a
for i in range(a):
ans=0
hoge=map(int,raw_input().split())
sys.stdout.write(" ")
for j in range(a):
tage[j]+=hoge[j]
print "%4d"%(hoge[j]),
ans+=hoge[j]
else:
ans2+=ans
print "%4d"%(ans)
e... | 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
|
<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">
<... |
s122535307 | p00102 | WA: Presentation Error | 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)):
s... | 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
|
<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">
<... |
s223750880 | p00102 | WA: Presentation Error | #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=... | 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
|
<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">
<... |
s222712418 | p00102 | WA: Presentation Error | #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=... | 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
|
<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">
<... |
s625692107 | p00102 | WA: Presentation Error | 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 " ".joi... | 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
|
<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">
<... |
s670240689 | p00102 | WA: Presentation Error | 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 " " + "... | 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
|
<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">
<... |
s217962299 | p00102 | WA: Presentation Error | 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 " ".joi... | 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
|
<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">
<... |
s701882700 | p00103 | Wrong Answer | N = int(raw_input())
p = 0
b = [0,0,0]
o = 0
for i in range(N):
e = raw_input()
if e == 'HIT':
if b[-1] == 1:
p += 1
b[0],b[1],b[2] = 1,b[0],b[1]
elif e == 'HOMERUN':
p += sum(b)+1
b = [0,0,0]
elif e == 'OUT':
o += 1
if o == 3:
prin... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s224243244 | p00103 | Wrong Answer | for i in range(int(input())):
point = 0
out = 0
runner = [0, 0, 0]
while True:
event = input()
if event == 'HIT':
if runner[2] == 1:
point += 1
if runner[1] == 1:
runner[2] = 1
if runner[0] == 1:
runner[1... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s873040249 | p00103 | Wrong Answer | for i in range(int(input())):
point = 0
out = 0
runner = [0, 0, 0]
while True:
event = input()
if event == 'HIT':
if runner[2] == 1:
point += 1
runner[2] = 0
if runner[1] == 1:
runner[2] = 1
runner[1]... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s975033940 | p00103 | Wrong Answer | n = int(raw_input())
for i in range(n):
out = 0
base = [0] * 4
while out != 3:
s = raw_input()
if s == 'HIT':
if base[2] == 1:
base[3] += 1
base[2] = base[1]
base[1] = base[0]
base[0] = 1
elif s == 'HOMERUN':
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s031985373 | p00103 | Wrong Answer | num=int(input())
for i in range(num):
outcount=0
HIT=0
HOMWRUN=0
COUNT=0
while True:
a=input()
if a=='HIT':
HIT+=1
if HIT==4:
COUNT+=1
HIT=1
if a=='HOMERUN':
COUNT+=(HIT+1)
if a=='OUT':
ou... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s140239018 | p00103 | Wrong Answer | ining = int(input())
out_count = 0
score = 0
bases = []
while True:
n = input()
if n == 'OUT':
out_count = out_count + 1
if out_count >= 3 * ining: break
if out_count % 3 == 0 and out_count != 0:
bases = []
continue
if n == 'HIT':
bases.append(1)
if len(ba... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s573608162 | p00103 | Wrong Answer | ining = int(input())
out_count = 0
score = 0
bases = []
while True:
print(score)
n = input()
if n == 'OUT':
out_count = out_count + 1
if out_count >= 3 * ining: break
if out_count % 3 == 0 and out_count != 0:
bases = []
continue
if n == 'HIT':
bases.append(1)
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s145289028 | p00103 | Wrong Answer | for i in range(int(input())):
f, s, t, count, point = 0, 0, 0, 0, 0
while count != 3:
data = input()
if data == 'HIT':
if t == 1:
point += 1
t = 0
if s == 1:
t = 1
s = 0
if f == 1:
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s917015737 | p00103 | Wrong Answer | import sys
#from me.io import dup_file_stdin
#@dup_file_stdin
def solve():
n = int(sys.stdin.readline())*3
s = 0
p = 0
while n>0:
log = sys.stdin.readline()
if "HIT" in log:
if p >= 3:
s += 1
p += 1
elif "OUT" in log:
n -= 1
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s910118990 | p00103 | Wrong Answer | inn=int(input())
o=0
i=0
s=[]
sc=0
ba=[]
while i<inn:
b=input()
if b == "OUT":
o+=1
if o%3 == 0 and o>0:
s.append(sc)
sc=0
i+=1
o=0
ba=[]
elif b == "HIT":
ba.append(1)
if len(ba)>=4:
sc+=1
ba=[1,1,1,1]
elif b == "HOMERUN":
ba.append(1)
sc+... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s985636332 | p00103 | Wrong Answer | import sys
def solve():
r = int(raw_input())
totalOuter = 0
goal = 0
bs = [0,0,0]#base situation
while r > 0:
event = raw_input()
# print "get",event
if event == "HIT":
# print "#HIT"
if bs[2] == 1:
bs[2] =0
goal += 1
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s086810236 | p00103 | Accepted | var1 = int(input())
for m in range(0, var1):
OutCount = 0
BaseCount = 0
PointCount = 0
for i in range(0, 100):
try:
str1 = input()
if str1 == 'HIT':
BaseCount = BaseCount + 1
if BaseCount == 4:
PointCount = PointCount + ... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s923816475 | p00103 | Accepted | n = int(raw_input())
runner = 0
run = 0
out = 0
inning = 0
while inning < n:
event = raw_input()
if event == 'HIT':
if runner == 3:
run += 1
else:
runner += 1
elif event == 'HOMERUN':
run += (runner+1)
runner = 0
else:
if out == 2:
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s017850908 | p00103 | Accepted | n=input()
for _ in [0]*n:
i=0
B=[0]*3
c=0
while i<3:
s=raw_input()[1]
if s=='I':
if B[2]==1:c+=1
B=[1]+B[0:2]
elif s=='O':
c+=sum(B)+1
B=[0]*3
elif s=='U':i+=1
print c | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s331798007 | p00103 | Accepted | n=input()
for _ in [0]*n:
i=0
b=0
c=0
while i<3:
s=raw_input()[1]
if s=='I':
if b==3:c+=1
else: b+=1
elif s=='O':
c+=b+1
b=0
elif s=='U':i+=1
print c | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s289950062 | p00103 | Accepted | n=input()
for _ in [0]*n:
i,b,c=0,0,0
while i<3:
s="IOU".index(raw_input()[1])
if s==0:
if b==3: c+=1
else: b+=1
elif s==1:
c+=b+1
b=0
elif s==2: i+=1
print c | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s350700767 | p00103 | Accepted | import sys
import sys
N = int(input())
turn = 0
point = 0
out = 0
base = [0, 0, 0]
point_list = []
for idx, line in enumerate(sys.stdin):
if line == 'HOMERUN\n':
# print('homerun')
cnt = 1
if base[0] == 1:
cnt += 1
if base[1] == 1:
cnt += 1
if base[2... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s429082948 | p00103 | Accepted | #!/usr/bin/python3
n = int(input())
def solve():
o = 0
s = 0
b = [False, False, False]
while o < 3:
inst = input()
if inst == 'OUT':
o += 1
elif inst == 'HIT':
if b[2]:
s += 1
b2 = [True]
b2.extend(b[0:2])
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s599267177 | p00103 | Accepted | #!/usr/bin/python
# -*- coding: utf-8 -*-
def main():
# 入力
N = int(raw_input())
for i in range(N):
data = {}
b = Baseball()
while(b.out < 3):
event = raw_input()
b.decisionScore(event)
print(b.score)
class Baseball():
def __init__(self):
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s404712534 | p00103 | Accepted | SCORE=[]
preSCORE=0
OUTcount=0
BASE=[False]*3
n=int(input())
for i in range(n):
while OUTcount<3:
spam=input()
if 'HIT' in spam:
if BASE[2]==True:
preSCORE+=1
BASE[2]=BASE[1]
BASE[1]=BASE[0]
BASE[0]=True
elif 'OUT' in spam:
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s033291350 | p00103 | Accepted | SCORE=[]
n=int(input())
for i in range(n):
BASE=[False]*3
OUTcount=0
preSCORE=0
while OUTcount<3:
spam=input()
if 'HIT' in spam:
if BASE[2]==True:
preSCORE+=1
BASE[2]=BASE[1]
BASE[1]=BASE[0]
BASE[0]=True
elif 'OUT' i... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s598050931 | p00103 | Accepted | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright : @Huki_Hara
# Created : 2015-03-16
for _ in range(int(input())):
ans = 0
out = 0
hit = 0
while True:
w = input()
if w == "OUT":
out += 1
if out == 3:
break
elif w == "HIT":
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s266923200 | p00103 | Accepted | n=int(raw_input())
game=0
while game<n:
run=0
score=0
out=0
while out<3:
ev=raw_input()
if ev=='OUT':
out=out+1
elif ev=='HIT':
run=run+1
if run>3:
run=3
score=score+1
else:
score=score+run+1
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s318896480 | p00103 | Accepted | while True:
try:
n = int(raw_input())
except EOFError:
break
for i in range(n):
base = [False,False,False] # first, second, third
point = 0
out = 0
while out <3:
order = raw_input()
if order =='HIT':
base.insert(0,True)... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s171355042 | p00103 | Accepted | n = input()
base, out, score = [0]*3, 0, 0
while True:
if n == 0:
break
event = raw_input()
if event == 'OUT':
out += 1
if out == 3:
print score
base, out, score = [0]*3, 0, 0
n -= 1
elif event == 'HIT':
score += base.pop()
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s849117555 | p00103 | Accepted | from collections import deque
inning = 0
point = 0
out = 0
base = deque([0] * 3)
n = input()
while True:
event = raw_input()
if event == "HIT":
point += base.pop()
base.appendleft(1)
elif event == "HOMERUN":
point += base.count(1) + 1
base = deque([0] * 3)
else:
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s406877799 | p00103 | Accepted | N = int(raw_input())
p = 0
b = [0,0,0]
o = 0
while True:
try:
e = raw_input()
if e == 'HIT':
if b[-1] == 1:
p += 1
b[0],b[1],b[2] = 1,b[0],b[1]
elif e == 'HOMERUN':
p += sum(b)+1
b = [0,0,0]
elif e == 'OUT':
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s472780606 | p00103 | Accepted | N = int(input())
base = [0] * 3
out = 0
point = 0
inning = 0
while True:
event = input()
if event == "HIT":
if base[2] == 1:
point += 1
base[2] = base[1]
base[1] = base[0]
base[0] = 1
elif event == "HOMERUN":
point += sum(base) + 1
base = [0] *... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s425351392 | p00103 | Accepted | n = int(input())
for i in range(n):
first = False
second = False
third = False
out = 0
points = 0
while (out != 3):
event = raw_input()
if event == "HIT":
if first == True:
if second == True:
if third == True:
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s722265787 | p00103 | Accepted | n = int(input())
for i in range(n):
l = [1,0,0,0]
c = 0
o_c = 0
while True:
s = input()
if s == 'HIT':
if l[3] == 1:
c += 1
for i in range(4):
if i == 3:
l[3-i] == 1
else:
l[3-i] = l[2-i]
elif s == 'HOMERUN':
c += sum(l)
l = [1,0,0,... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s541199283 | p00103 | Accepted | for i in range(int(input())):
point = 0
out = 0
runner = [0, 0, 0]
while True:
event = input()
if event == 'HIT':
if runner[2] == 1:
point += 1
runner[2] = 0
if runner[1] == 1:
runner[2] = 1
runner[1]... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s487502132 | p00103 | Accepted | for i in range(int(input())):
point = 0
out = 0
runner = [0, 0, 0]
while True:
event = input()
if event == 'HIT':
if runner[2] == 1:
point += 1
runner[2] = 0
if runner[1] == 1:
runner[2] = 1
runner[1]... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s458579989 | p00103 | Accepted | def hit(point, base, out_count):
new_base = (base << 1) + 1
return point + (new_base > 0b111), new_base & 0b111, out_count
def homerun(point, base, out_count):
return point + (bin(base & 0b111).count('1') + 1), 0, out_count
def out(point, base, out_count):
return point, base, out_count - 1
F = {'H... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s685208881 | p00103 | Accepted | import sys
n = input()
events = []
for line in sys.stdin:
events.append(line.strip())
out = 0
score = 0
runner = 0
for event in events:
if event == 'OUT':
out += 1
if out == 3:
print score
out = 0
score = 0
runner = 0
elif event == 'HIT':
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s442875737 | p00103 | Accepted | def game():
score=out=0
runner=[0]*3
while 1:
t=raw_input()
if t=='OUT':
out+=1
if out==3:
return score
elif t=='HOMERUN':
score+=(1+runner.count(1))
runner=[0]*3
elif t=='HIT':
if runner[2]==1:
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s066645937 | p00103 | Accepted | n = int(input())
score = [0 for i in range(n)]
inning = 1
runner = [0 for i in range(3)]
outCount = 0
inningScore = 0
while inning <= n:
str = input()
if str == "OUT":
outCount += 1
elif str == "HIT":
runner.insert(0, 1)
inningScore += runner[3]
runner.pop()
elif str == "... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s624923991 | p00103 | Accepted | def init_state():
return 0, 0, 0
def main():
n = int(input())
point, hit, out = init_state()
while True:
if n == 0:
break
event = input()
if event == 'HIT':
if hit >= 3:
point += 1
else:
hit += 1
el... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s137571224 | p00103 | Accepted | n = int(input())
score = 0
outcount = 0
first = 0
second = 0
third = 0
for i in range(n):
while outcount < 3:
event = input()
if event == 'HIT':
if third == 1:
score += 1
third = second
second = first
first = 1
if event == 'HOMERUN':
score = score + first + second + third + 1
first = second... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s791900608 | p00103 | Accepted | n = int(input())
for i in range(n):
out_count = 0
score = 0
runner = []
while True:
if out_count == 3:
print(score)
break
events = input()
if events == "HIT":
if len(runner) == 3:
score += 1
else:
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s888278881 | p00103 | Accepted | n = int(input())
for i in range(n):
r = 0
p = 0
o = 0
while o < 3:
e = input()
if e == "OUT":
o += 1
elif e == "HIT":
if r == 3:
p += 1
else:
r += 1
else:
p += r + 1
r = 0
prin... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s602553067 | p00103 | Accepted | for Panzerlied in range(0,int(input())):
runners = 0
outs = 0
points = 0
while outs<3:
command=input()
if command == "HIT":
runners+=1
if runners > 3:
runners=3
points+=1
elif command == "HOMERUN":
points+=(runners+1)
runners=0
else: # command == "OUT"
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s203194298 | p00103 | Accepted | n = int(input())
for i in range(n):
hit_cou = 0
out_cou = 0
poi = 0
while True:
eve = input()
if eve == "HIT":
if hit_cou == 3:
poi += 1
else:
hit_cou += 1
elif eve == "OUT":
if out_cou == 2:
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s996565471 | p00103 | Accepted | n=int(input())
b=[0]*3;s=o=0
while n:
e=input()
if len(e)>3:s+=sum(b)+1;b=[0]*3
elif e[0]=='H':
if b.pop():s+=1
b=[1]+b
else:
o+=1
if o==3:n-=1;b=[0]*3;print(s);o=s=0 | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s632958272 | p00103 | Accepted | n = int(input())
for _ in range(n):
runners = []
outs = 0
score = 0
while True:
s = input()
if s == "HIT":
runners.append(0)
for i in range(len(runners)):
runners[i] += 1
if runners[i] == 4:
score += 1
... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
s244509736 | p00103 | Accepted | def main():
kai, wo = 0, []
kai = input()
while(True):
try:
wo.append(raw_input())
except EOFError:
break
R, S, O = 0, 0, 0
for i in wo:
if i == "HIT":
if R < 3:
R += 1
else:
S += 1
elif ... | 2
HIT
OUT
HOMERUN
HIT
HIT
HOMERUN
HIT
OUT
HIT
HIT
HIT
HIT
OUT
HIT
HIT
OUT
HIT
OUT
OUT
| 7
0
|
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.