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
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s453608066
p00100
u609881501
1453801288
Python
Python3
py
Runtime Error
0
0
723
#!/usr/bin/env python3 import sys input_lines = sys.stdin.readlines() cnt = 0 dataset = [] for i in input_lines: if not(' ' in i): dataset.append([int(i)]) cnt += 1 else:dataset[cnt-1].append(list(map(int, i.split(' ')))) for d in dataset: if d == [0]:break shain = [[x[0], x[1]*x[2]] for x in d[1:]] #score = [ for x in d[1:]] slist = [] for s in shain: if not(s[0] in slist):slist.append(s[0]) newslist = [[x, 0] for x in slist] score = [] for s in shain: newslist[slist.index(s[0])][1] += s[1] flag = False for n in newslist: if n[1] >= 1000000: print(n[0]) flag = True if not flag:print('NA')
s602891086
p00100
u609881501
1453801750
Python
Python3
py
Runtime Error
0
0
757
#!/usr/bin/env python3 import sys input_lines = sys.stdin.readlines() cnt = 0 dataset = [] for i in input_lines: if not(' ' in i): dataset.append([int(i)]) cnt += 1 else:dataset[cnt-1].append(list(map(int, i.split(' ')))) for d in dataset: if d == [0]:pass else: shain = [[x[0], x[1]*x[2]] for x in d[1:]] slist = [] for s in shain: if not(s[0] in slist):slist.append(s[0]) newslist = [[x, 0] for x in slist] score = [] for s in shain: newslist[slist.index(s[0])][1] += s[1] flag = False for n in newslist: if n[1] >= 1000000: print(n[0]) flag = True if not flag:print('NA')
s485165545
p00100
u609881501
1453801947
Python
Python3
py
Runtime Error
0
0
724
#!/usr/bin/env python3 import sys input_lines = sys.stdin.readlines() cnt = 0 dataset = [] for i in input_lines: if not(' ' in i): dataset.append([int(i)]) cnt += 1 # else:dataset[cnt-1].append(list(map(int, i.split(' ')))) for d in dataset: if d == [0]:break shain = [[x[0], x[1]*x[2]] for x in d[1:]] #score = [ for x in d[1:]] slist = [] for s in shain: if not(s[0] in slist):slist.append(s[0]) newslist = [[x, 0] for x in slist] score = [] for s in shain: newslist[slist.index(s[0])][1] += s[1] flag = False for n in newslist: if n[1] >= 1000000: print(n[0]) flag = True if not flag:print('NA')
s043795802
p00100
u609881501
1453801988
Python
Python3
py
Runtime Error
0
0
507
#!/usr/bin/env python3 import sys input_lines = sys.stdin.readlines() cnt = 0 dataset = [] for i in input_lines: if not(' ' in i): dataset.append([int(i)]) cnt += 1 else:dataset[cnt-1].append(list(map(int, i.split(' ')))) for d in dataset: if d == [0]:break shain = [[x[0], x[1]*x[2]] for x in d[1:]] #score = [ for x in d[1:]] slist = [] for s in shain: if not(s[0] in slist):slist.append(s[0]) newslist = [[x, 0] for x in slist] score = []
s877282074
p00100
u609881501
1453802008
Python
Python3
py
Runtime Error
0
0
384
#!/usr/bin/env python3 import sys input_lines = sys.stdin.readlines() cnt = 0 dataset = [] for i in input_lines: if not(' ' in i): dataset.append([int(i)]) cnt += 1 else:dataset[cnt-1].append(list(map(int, i.split(' ')))) for d in dataset: if d == [0]:break shain = [[x[0], x[1]*x[2]] for x in d[1:]] #score = [ for x in d[1:]] slist = []
s501131380
p00100
u609881501
1453802018
Python
Python3
py
Runtime Error
0
0
246
#!/usr/bin/env python3 import sys input_lines = sys.stdin.readlines() cnt = 0 dataset = [] for i in input_lines: if not(' ' in i): dataset.append([int(i)]) cnt += 1 else:dataset[cnt-1].append(list(map(int, i.split(' '))))
s379301017
p00100
u609881501
1453802054
Python
Python3
py
Runtime Error
0
0
223
import sys input_lines = sys.stdin.readlines() cnt = 0 dataset = [] for i in input_lines: if not(' ' in i): dataset.append([int(i)]) cnt += 1 else:dataset[cnt-1].append(list(map(int, i.split(' '))))
s807549733
p00100
u609881501
1453802155
Python
Python
py
Runtime Error
0
0
714
#!/usr/bin/env python import sys input_lines = sys.stdin.readlines() cnt = 0 dataset = [] for i in input_lines: if not(' ' in i): dataset.append([int(i)]) cnt += 1 else:dataset[cnt-1].append(map(int, i.split(' '))) for d in dataset: if d == [0]:break shain = [[x[0], x[1]*x[2]] for x in d[1:]] #score = [ for x in d[1:]] slist = [] for s in shain: if not(s[0] in slist):slist.append(s[0]) newslist = [[x, 0] for x in slist] score = [] for s in shain: newslist[slist.index(s[0])][1] += s[1] flag = False for n in newslist: if n[1] >= 1000000: print n[0] flag = True if not flag:print 'NA'
s099317495
p00100
u919202930
1481768486
Python
Python3
py
Runtime Error
0
0
564
datasets=[] while True: n = int(input()) if n==0: break inputs=[None]*n for t in range(0,n): inputs[t] = list(map(int,input().split())) #inputs == [[i0,p0,q0],[i1,p1,q1],[i2,p2,q2]] id_sale = [] # id_sale == [id,sale,id,sale,id,sale] for i in inputs: # i == [ik,pk,qk] if i[0] in id_sale: id_sale[id_sale.index(i[0])+1] += i[1]*i[2] else: id_sale += [i[0],i[1]*i[2]] na=True for i in range(0,len(id_sale),2): if id_sale[i+1] >= 1000000: print(id_sale[i]) na=False if na == True: print("NA")
s614983953
p00100
u919202930
1481768787
Python
Python3
py
Runtime Error
0
0
562
datasets=[] while True: n = int(input()) if n==0: break inputs=[None]*n for t in range(0,n): inputs[t] = list(map(int,input().split())) #inputs == [[i0,p0,q0],[i1,p1,q1],[i2,p2,q2]] id_sale = [] # id_sale == [id,sale,id,sale,id,sale] for i in inputs: # i == [ik,pk,qk] try: id_sale[id_sale.index(i[0])+1] += i[1]*i[2] except ValueError: id_sale += [i[0],i[1]*i[2]] na=True for i in range(0,len(id_sale),2): if id_sale[i+1] >= 1000000: print(id_sale[i]) na=False if na == True: print("NA")
s434895425
p00100
u919202930
1481770653
Python
Python3
py
Runtime Error
0
0
656
datasets=[] while True: n = int(input()) if n==0: break inputs=[None]*n for t in range(0,n): inputs[t] = list(map(int,input().split())) #inputs == [[i0,p0,q0],[i1,p1,q1],[i2,p2,q2]] id_sale = [] # id_sale == [id,sale,id,sale,id,sale] for i in inputs: # i == [ik,pk,qk] try: id_sale[id_sale.index(i[0])+1] += i[1]*i[2] except ValueError: # output in the order of inputting # (list1 += list2) == [list1_elements, list2_elements] id_sale += [i[0],i[1]*i[2]] na=True for i in range(0,len(id_sale),2): if id_sale[i+1] >= 1000000: print(id_sale[i]) na=False if na: print("NA")
s663192246
p00100
u724963150
1496502911
Python
Python3
py
Runtime Error
0
0
356
while True: n=int(input()) if n==0:break res={} li=[] for i in range(n): d=[int(num) for num in input().split(' ')] res[d[0]-1]+=d[1]*d[2] if d[0]-1 not in li:li.append(d[0]-1) flag=False for i in li: if res[i]>=1000000: print(i+1) flag=True if flag==False:print("NA")
s083708478
p00100
u356989804
1496823317
Python
Python3
py
Runtime Error
0
0
278
while True: n=int(input()) if n==0: break else: for i in range(n): k=0 l=map(int, input().split()) if l[1]*l[2]>=1000000: print(l[0]) k+=1 if k==0: print("NA")
s477398577
p00100
u356989804
1496823356
Python
Python3
py
Runtime Error
0
0
278
while True: n=int(input()) if n==0: break else: for i in range(n): k=0 l=map(int, input().split()) if l[1]*l[2]>=1000000: print(l[0]) k+=1 if k==0: print("NA")
s396974495
p00100
u356989804
1496823401
Python
Python3
py
Runtime Error
0
0
278
while True: n=int(input()) if n==0: break else: for i in range(n): k=0 l=map(int, input().split()) if l[1]*l[2]>=1000000: print(l[0]) k+=1 if k==0: print("NA")
s386905519
p00100
u501510481
1500104764
Python
Python3
py
Runtime Error
0
0
282
while True: str = input() if len(str) == 1 and not str == "0": datadic={} nn = len(str) for ii in range(nn): data = input.stlip() datadic[data[0]] = int(data[1]) * int(data[2]) print(datadic[ max( datadic.values() ) ])
s693211573
p00100
u501510481
1500104878
Python
Python3
py
Runtime Error
0
0
306
while True: str = input() if len(str) == 1 and not str == "0": datadic={} nn = len(str) for ii in range(nn): data = input.stlip() datadic[data[0]] = int(data[1]) * int(data[2]) print(datadic[ max( datadic.values() ) ]) else: break
s427050496
p00100
u501510481
1500105309
Python
Python3
py
Runtime Error
0
0
354
import sys while True: str = sys.stdin.readline().stlip() if len(str) == 1 and not str == "0": datadic={} nn = len(str) for ii in range(nn): data = sys.stdin.readline().stlip() datadic[data[0]] = int(data[1]) * int(data[2]) print(datadic[ max( datadic.values() ) ]) else: break
s852704422
p00100
u501510481
1500105329
Python
Python3
py
Runtime Error
0
0
353
import sys while True: str = sys.stdin.readline().stlip() if len(str) == 1 and not str == "0": datadic={} nn = len(str) for ii in range(nn): data = sys.stdin.readline().stlip() datadic[data[0]] = int(data[1]) * int(data[2]) print(datadic[ max( datadic.values() ) ]) else: break
s880671759
p00100
u501510481
1500105510
Python
Python3
py
Runtime Error
0
0
353
import sys while True: str = sys.stdin.readline().split() if len(str) == 1 and not str == "0": datadic={} nn = len(str) for ii in range(nn): data = sys.stdin.readline().split() datadic[data[0]] = int(data[1]) * int(data[2]) print(datadic[ max( datadic.values() ) ]) else: break
s597798797
p00100
u501510481
1500105547
Python
Python3
py
Runtime Error
0
0
353
import sys while True: str = sys.stdin.readline().split() if len(str) == 1 and not str == "0": datadic={} nn = len(str) for ii in range(nn): data = sys.stdin.readline().split() datadic[data[0]] = int(data[1]) * int(data[2]) print(datadic[ max( datadic.values() ) ]) else: break
s435851207
p00100
u501510481
1500122784
Python
Python3
py
Runtime Error
0
0
316
while True: str = input().split() if len(str) == 1 and not str == "0": datadic={} nn = len(str) for ii in range(nn): data = input().split() datadic[data[0]] = int(data[1]) * int(data[2]) print(datadic[ max( datadic.values() ) ]) else: break
s938951396
p00100
u501510481
1500122973
Python
Python3
py
Runtime Error
0
0
316
while True: str = input().split() if len(str) == 1 and not str == "0": datadic={} nn = len(str) for ii in range(nn): data = input().split() datadic[data[0]] = int(data[1]) * int(data[2]) print(datadic[ max( datadic.values() ) ]) else: break
s240957485
p00100
u453481381
1504575136
Python
Python3
py
Runtime Error
0
0
342
while True: n = input() if n == 0: break rs = {} for i in range(n): arr = input().split(' ') s = arr[0] * arr[1] rs[arr[0]] = (rs[arr[0]] or 0) + s top = [k for k, v in rs.items if v > 1000000] if len(top) == 0: print('NA') else: for i in top: print(i)
s099323048
p00100
u926657458
1508784220
Python
Python3
py
Runtime Error
0
0
1138
import numpy as np class Employee(): def __init__(self,id,p,q): self.id = id self.total = p*q def add_total(self,total): self.total += total class Manager(): def __init__(self): self.employees = list() self.count = 0 def add(self,e): if len(self.employees) == 0: self.employees.append(e) else: if self.employees[-1].id == e.id: self.employees[-1].add_total(e.total) else: self.employees.append(e) def pprint(self): for i,e in enumerate(self.employees): if e.total >= 1000000: print(e.id) self.count+=1 if self.count == 0: print("NA") def main(): while(True): m = Manager() n = int(input()) if n==0: break l = list() for i in range(n): s = list(map(int,input().split())) l.append(s) l = sorted(l) for x in l: m.add(Employee(*x)) m.pprint() if __name__=="__main__": main()
s348464413
p00100
u926657458
1508785808
Python
Python
py
Runtime Error
0
0
375
while(True): n = int(input()) if n==0: break d = dict() s = set() c = 0 for _ in range(n): id_,p,q = map(int,input().split()) if id_ in s: d[id_] += p*q else: s.add(id_) d[id_] = p*q for i in s: if d[i] >= 1000000: print(i) c+=1 if c == 0: print("NA")
s560980087
p00100
u139200784
1510665939
Python
Python3
py
Runtime Error
0
0
394
import sys while True: n = input() salesmap = {} j = 0 for i in range(1,4001): salesmap[i] = 0 if n == 0: break for i in range(n): a = input().split() salesmap[int(a[0])] += int(a[1])*int(a[2]) for i in range(1,4001): if salesmap[i] >= 1000000: j += 1 print(i) if j == 0: print('NA') #print a # [a1, a2, a3, ..., aN]
s065030574
p00100
u139200784
1510665970
Python
Python3
py
Runtime Error
0
0
419
# -*- coding: utf-8 -*- import sys while True: n = input() salesmap = {} j = 0 for i in range(1,4001): salesmap[i] = 0 if n == 0: break for i in range(n): a = input().split() salesmap[int(a[0])] += int(a[1])*int(a[2]) for i in range(1,4001): if salesmap[i] >= 1000000: j += 1 print(i) if j == 0: print('NA') #print a # [a1, a2, a3, ..., aN]
s484360276
p00100
u139200784
1510666522
Python
Python3
py
Runtime Error
0
0
393
# -*- coding: utf-8 -*- import sys while True: n = int(input()) j = 0 if n == 0: break salesmap = [0 in range(0,4001)] for i in range(n): a = input().split() salesmap[int(a[0])] += int(a[1])*int(a[2]) for i in range(1,4001): if salesmap[i] >= 1000000: j += 1 print(i) if j == 0: print('NA') #print a # [a1, a2, a3, ..., aN]
s250052742
p00100
u139200784
1510666918
Python
Python
py
Runtime Error
0
0
421
# -*- coding: utf-8 -*- import sys while True: n = int(input()) j = 0 if n == 0: break salesmap = [0 for i in range(0,4001)] for i in range(n): a = input().split() salesmap[int(a[0])] += int(a[1])*int(a[2]) for i in range(1,4001): if salesmap[i] >= 1000000: j += 1 print i if j == 0: print 'NA' #print a # [a1, a2, a3, ..., aN]
s842626188
p00100
u139200784
1510720979
Python
Python
py
Runtime Error
0
0
359
# -*- coding: utf-8 -*- import sys while True: n = int(input()) j = 0 if n == 0: break salesmap = [0 for i in range(0,4001)] for i in range(n): a = input().split() salesmap[int(a[0])] += int(a[1])*int(a[2]) for i in range(1,4001): if salesmap[i] >= 1000000: j += 1 print(str(i)) if j == 0: print('NA') #print a # [a1, a2, a3, ..., aN]
s415860611
p00100
u566872786
1511243153
Python
Python3
py
Runtime Error
0
0
278
while 1: n=int(input()) if not n:break f=1 L={} for a,b,c in [map(int,input().split()) for i in range(n)]: a=str(a) if a in L: d=b*c if L[a]>=1e6:continue L[a]+=d else:L[a]=d if L[a] >= 1e6: print(a) f=0 if f:print('NA')
s251535200
p00100
u566872786
1511243435
Python
Python3
py
Runtime Error
0
0
242
while 1: n=int(input()) if not n:break f=1 L={} for a,b,c in [input().split() for i in range(n)]: if a in L: if L[a]>=1e6:continue L[a]+=d else:L[a]=d if L[a]>=1e6: print(a) f=0 if f:print('NA')
s605736966
p00100
u424041287
1512628935
Python
Python3
py
Runtime Error
0
0
250
x = 1 while x != 0: x = int(input().rstrip()) frag = 0 for j in range(x): A = input().rstrip().sprit() if int(A[1]) * int(A[2]) >= 1000000: print(A[0]) flag = 1 if flag == 0: print("NA")
s189313985
p00100
u424041287
1512629027
Python
Python3
py
Runtime Error
0
0
244
x = 1 while x != 0: x = int(input().rstrip()) frag = 0 for j in range(x): A = input().sprit(" ") if int(A[1]) * int(A[2]) >= 1000000: print(A[0]) flag = 1 if flag == 0: print("NA")
s501338252
p00100
u428982301
1526441323
Python
Python3
py
Runtime Error
0
0
388
While True: no = [] n = int(input()) if (n = 0): return for i in range(n): datas = map(int, input().split()) li = list(datas) e = li[0] p = li[1] q = li[2] s = p * q if (1000000 < s and (e in no) = False): print(e) no.append(e) if (len(no) = 0): print("NA")
s032127780
p00100
u428982301
1526441875
Python
Python3
py
Runtime Error
0
0
389
while True: no = [] n = int(input()) if (n == 0): exit for i in range(n): datas = map(int, input().split()) li = list(datas) e = li[0] p = li[1] q = li[2] s = p * q if (1000000 < s and (e in no) == False): print(e) no.append(e) if (len(no) == 0): print("NA")
s495519132
p00100
u894941280
1349282678
Python
Python
py
Runtime Error
0
5216
625
import sys while True: a=int(input()) if a==0: break ans,name1,name2=[],[],[] hogehoge=0 for i in range(a): hoge=map(int,raw_input().split()) if hoge[0] in name2: ww = hoge[1]*hoge[2] r = name2.index(hoge[0]) if len(ans[r]+ww) >= 7: hogehoge+=1 name1.append(hoge[0]) else: ans[r]+=ww else: qq = hoge[1]*hoge[2] if len(str(qq)) >= 7: hogehoge+=1 name1.append(hoge[0]) else: name2.append(hoge[0]) ans.append(qq) if hogehoge == 0: print "NA" else: for i in range(len(name1)): print name1[i]
s376558969
p00100
u223011712
1393184265
Python
Python
py
Runtime Error
0
0
555
import sys from Config import DB def add(lis,check_list): for index in range(len(lis)): if lis[index][0]==check_list[0]: lis[index][1]+=int(check_list[1])*int(check_list[2]) return lis.append([check_list[0],int(check_list[1])*int(check_list[2])]) while True: num=int(raw_input()) if num==0: break lis=[] for i in range(num): l=raw_input().split(" ") add(lis,l) c=0 for ele in lis: if ele[1]>=1000000: print ele[0] c+=1 if c==0: print "NA"
s240668590
p00101
u051394180
1559188387
Python
Python3
py
Runtime Error
0
0
280
for i in range(int(input())): doc = input().split() ans = [] for s in doc: if 'Hoshino' in s: while 'Hoshino' in s: t = s.find('Hoshino') s = s[:t] + 'Hoshina' + s[s+7:] ans.append(s) print ' '.join(ans)
s105611512
p00101
u051394180
1559188471
Python
Python3
py
Runtime Error
0
0
280
for i in range(int(input())): doc = input().split() ans = [] for s in doc: if 'Hoshino' in s: while 'Hoshino' in s: t = s.find('Hoshino') s = s[:t] + 'Hoshina' + s[s+7:] ans.append(s) print ' '.join(ans)
s032992889
p00101
u051394180
1559188709
Python
Python3
py
Runtime Error
0
0
78
for i in range(int(input())): print input().replace('Hoshino', 'Hoshina')
s330036051
p00101
u585391547
1412458448
Python
Python3
py
Runtime Error
0
0
253
n=int(input()) n=int(input()) for i in range(n): inputs=list(map(str,input().split())) ans="" for j in inputs: if j[:7]=="Hoshino": ans+="Hoshina " #print("Hoshina",end=" ") else: ans+=j+" " #print(j,end=" ") ans=ans[:-1] print(ans)
s329441282
p00101
u580607517
1427630022
Python
Python
py
Runtime Error
0
0
119
while True: n = int(raw_input()) for i in [raw_input().replace("Hoshino", "Hoshina") for i in range(n)]: print i
s496466444
p00101
u580607517
1427630051
Python
Python
py
Runtime Error
0
0
139
while True: n = int(raw_input()) if n == 0: break for i in [raw_input().replace("Hoshino", "Hoshina") for i in range(n)]: print i
s575195140
p00101
u580607517
1427630115
Python
Python
py
Runtime Error
0
0
122
n = int(raw_input()) if n == 0: break for i in [raw_input().replace("Hoshino", "Hoshina") for i in range(n)]: print i
s699693496
p00101
u379499530
1432094763
Python
Python
py
Runtime Error
0
0
102
while True: num = input() for i in range(num): print raw_input().replace("Hoshino", "Hoshina")
s385263933
p00101
u463990569
1452842690
Python
Python3
py
Runtime Error
0
0
166
while True: num = int(input()) if not num: break data = [input() for _ in range(num)] [print(el.replace('Hoshino', 'Hoshina')) for el in data]
s252127140
p00101
u463990569
1452842753
Python
Python3
py
Runtime Error
0
0
166
while True: num = int(input()) if not num: break data = [input() for _ in range(num)] [print(el.replace('Hoshino', 'Hoshina')) for el in data]
s817384683
p00101
u463990569
1452842854
Python
Python3
py
Runtime Error
0
0
166
while True: num = int(input()) if not num: break data = [input() for _ in range(num)] [print(el.replace('Hoshino', 'Hoshina')) for el in data]
s432183736
p00101
u463990569
1452843108
Python
Python
py
Runtime Error
0
0
181
while True: num = int(raw_input()) if not num: break data = [raw_input() for _ in range(num)] for el in data: print(el.replace('Hoshino', 'Hoshina'))
s113369690
p00101
u463990569
1452928716
Python
Python3
py
Runtime Error
0
0
74
[print(input().replace('Hoshino', 'Hoshina')) for _ in range(int(inpu()))]
s623203766
p00101
u119947000
1454973623
Python
Python
py
Runtime Error
0
0
355
#!/usr/bin/python # -*- coding: utf-8 -*- def main(): # ??\??? N = int(raw_input()) inp = [] for x in range(N): input_list = raw_input() inp.append(input_list) # ??????????????? for x in inp: replaced = x.replace("Hoshino", "Hoshina") print(replaced) if __name__=='__main__': main()
s465005223
p00101
u547616245
1478684717
Python
Python
py
Runtime Error
0
0
209
import sys def main(): n = int(sys.stdin.readline()) for _ in range(n): line = sys.stdin.readline() print(line.strip().replace("Hoshino", "Hoshina"), end="\n") if __name__ == "__main__": main()
s200226203
p00101
u356989804
1496821877
Python
Python3
py
Runtime Error
0
0
106
import string n=int(raw_input()) for i in range(n): print(raw_input().replace("Hoshino", "Hoshina"))
s964439610
p00101
u919202930
1500120098
Python
Python3
py
Runtime Error
0
0
386
# Hoshinori # Hoshino's n = int(input()) datasets=[None]*n for i in range(n): datasets[i] = input() def rep(a): punc = ["","'s",",",".",":",";","!","?","#","$","%","&","(",")","-"."~,","-","<",">"] for p in punc: if a == "Hoshino"+p: return "Hoshina"+p return a for data in datasets: words = data.split(" ") words = list(map(rep,words)) print(" ".join(words))
s546984492
p00101
u919202930
1500120150
Python
Python3
py
Runtime Error
0
0
386
# Hoshinori # Hoshino's n = int(input()) datasets=[None]*n for i in range(n): datasets[i] = input() def rep(a): punc = ["","'s",",",".",":",";","!","?","#","$","%","&","(",")","-"."~,","-","<",">"] for p in punc: if a == "Hoshino"+p: return "Hoshina"+p return a for data in datasets: words = data.split(" ") words = list(map(rep,words)) print(" ".join(words))
s210433571
p00101
u988834390
1502716104
Python
Python3
py
Runtime Error
0
0
215
n=int(input()) spam=[] for i in range(n): s=input() for j in range(len(s)-7): if s[j:j+6]=='Hoshino': s[j+6]='a' spam.append(s) for i in range(len(spam)): print(spam[i])(spam[i])
s426581912
p00101
u988834390
1502716124
Python
Python3
py
Runtime Error
0
0
214
n=int(input()) spam=[] for i in range(n): s=input() for j in range(len(s)-7): if s[j:j+6]=='Hoshino': s[j+6]='a' spam.append(s) for i in range(len(spam)): print(spam[i])(spam[i])
s391415341
p00101
u988834390
1502716222
Python
Python3
py
Runtime Error
0
0
231
n = int(input()) spam = [] for i in range(n): s = input() for j in range(len(s) - 6): if s[j:j + 7] == 'Hoshino': s[j + 6] = 'a' spam.append(s) for i in range(len(spam)): print(spam[i]) spam[i])
s769493025
p00101
u184989919
1515411911
Python
Python3
py
Runtime Error
0
0
122
def Aizu_PR(): n = int(input()) for _ in range(n): print(input().replace("Hoshino","Hoshina") Aizu_PR()
s724673473
p00101
u546285759
1515812137
Python
Python
py
Runtime Error
0
0
112
n = int(input()) dataset = [input().replace("Hoshino", "Hoshina") for _ in range(n)] print(*dataset, sep="\n")
s215262569
p00101
u759934006
1373726886
Python
Python
py
Runtime Error
0
0
126
import re while True: n = int(raw_input()) for i in range(n): print re.sub("Hoshino", "Hoshina", raw_input())
s677561030
p00101
u633068244
1393771152
Python
Python
py
Runtime Error
0
0
226
n = int(raw_input()) for i in range(n): inp = map(str, raw_input().split()) for j in range(len(inp)): if inp[j][:7] == "Hoshino": inp[j] = Hoshina" + inp[j][7:] print " ".join(map(str, inp))
s020529217
p00102
u040533857
1426045222
Python
Python3
py
Runtime Error
0
0
371
data=[] while True: 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) for j in spam: print(str(j)+' ',end='') print('') for i in range(len(data)+1): print(str(sum(x[i] for x in data))+' ',end='') print('')
s231187471
p00102
u040533857
1426045259
Python
Python3
py
Runtime Error
0
0
410
data=[] while True: try: n = int(input()) except: break if n==0: break for i in range(n): spam=list(map(int,input().split())) spam.append(sum(spam)) data.append(spam) for j in spam: print(str(j)+' ',end='') print('') for i in range(len(data)+1): print(str(sum(x[i] for x in data))+' ',end='') print('')
s055926687
p00102
u040533857
1426045749
Python
Python3
py
Runtime Error
0
0
422
data=[] while True: try: n = int(input()) except: break if n==0: break for i in range(n): spam=list(map(int,input().split())) spam.append(sum(spam)) data.append(spam) for j in spam: print('{:5}'.format(j),end='') print('') for i in range(len(data)+1): print('{:5}'.format(sum(x[i] for x in data)),end='') print('')
s807580280
p00102
u040533857
1426048265
Python
Python3
py
Runtime Error
0
0
419
data=[] while True: 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+1): for j in range(n+1): print('{:5}'.format(data[i][j]),end='') print('')
s842429813
p00102
u580607517
1427631066
Python
Python
py
Runtime Error
0
0
261
while True: n = input() x = [] y = [0 for i in range(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])
s131477256
p00102
u379499530
1432096754
Python
Python
py
Runtime Error
0
0
392
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): sum = 0 for j in range(num): sum += sht[j][i] row.append(sum) print " ".join(map(str, row))
s413494434
p00102
u727466163
1440398420
Python
Python
py
Runtime Error
0
0
455
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 range(0,temp):#????????¢?????? a[temp][k] += a[l][k] for m in range(temp+1): print " ".join(map(str,a[m]))
s002759662
p00102
u727466163
1440402528
Python
Python
py
Runtime Error
0
0
514
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 range(0,temp):#行に関して a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print ""
s897981281
p00102
u727466163
1440402623
Python
Python
py
Runtime Error
0
0
560
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 range(0,temp):#行に関して a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print ""
s176487845
p00102
u727466163
1440414899
Python
Python
py
Runtime Error
0
0
565
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 range(0,temp):#行に関して a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" pass
s007741269
p00102
u727466163
1440414917
Python
Python
py
Runtime Error
0
0
569
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 range(0,temp):#行に関して a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" print ""
s277924191
p00102
u727466163
1440428503
Python
Python
py
Runtime Error
0
0
569
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):#????????¢?????? for l in range(0,temp):#????????¢?????? a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" except(RuntimeError): pass
s565998126
p00102
u727466163
1440428665
Python
Python
py
Runtime Error
0
0
604
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):#列に関して for l in range(0,temp):#行に関して a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" except(RuntimeError): pass
s380667688
p00102
u727466163
1440428726
Python
Python
py
Runtime Error
0
0
565
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):#列に関して for l in range(0,temp):#行に関して a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" except(RuntimeError): pass
s869435598
p00102
u727466163
1440428845
Python
Python
py
Runtime Error
0
0
781
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):#列に関して for l in range(0,temp):#行に関して a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" except(RuntimeError): pass
s717286997
p00102
u727466163
1440428929
Python
Python
py
Runtime Error
0
0
721
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):#列に関して for l in range(0,temp):#行に関して a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" except(RuntimeError): pass
s013102266
p00102
u727466163
1440429111
Python
Python
py
Runtime Error
0
0
725
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):#????????¢?????? for l in range(0,temp):#????????¢?????? a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" except(RuntimeError): pass
s962651164
p00102
u727466163
1440431128
Python
Python
py
Runtime Error
0
0
725
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):#????????¢?????? for l in range(0,temp):#????????¢?????? a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" except(RuntimeError): pass
s528537474
p00102
u727466163
1440431436
Python
Python
py
Runtime Error
0
0
567
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 range(0,temp):#????????¢?????? a[temp][k] += a[l][k] for m in range(0,temp+1): for n in range(0,temp+1): sys.stdout.write(str(a[m][n]).rjust(5)) print "" except(RuntimeError): pass
s163561585
p00102
u609881501
1454550763
Python
Python3
py
Runtime Error
0
0
498
#!/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)): lastline[k] += i[k] cnt -= 1 output.append(i) if cnt == 0: output.append(lastline) s = "" for i in output[:-1]: for j in i: s += "{:>5}".format(j) s+='\n' print(s[:-1])
s367558850
p00102
u870028426
1459462678
Python
Python
py
Runtime Error
0
0
631
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.append(input_list[x][-1]) input_len = len(input_list[0]) column_list = [] for x in range(input_len): tmp = 0 for y in range(n): tmp += input_list[y][x] column_list.append(tmp) print ''.join(map(lambda n:"{:>5}".format(n), column_list)) n = int(raw_input())
s000266619
p00102
u875131962
1487079853
Python
Python3
py
Runtime Error
0
0
375
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))) print(' '.join(map(str, bottom_record))) n = input()
s479600225
p00102
u009288816
1515159480
Python
Python
py
Runtime Error
0
0
654
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])): res[k] += int(l[j][k]) temp += int(l[j][k]) print int(l[j][k]), res[int(l[i][0])] += temp print temp print ' ', for j in range(0,int(l[i][0])+1): print res[j], if(i + int(l[a][0])+1 < len(l)-1): print index += int(l[i][0])+1 a = int(l[a][0])+1
s406841939
p00102
u203261375
1515217599
Python
Python3
py
Runtime Error
0
0
13
import numpy
s575841016
p00102
u150984829
1517475424
Python
Python3
py
Runtime Error
0
0
244
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}")
s204426936
p00102
u150984829
1517476518
Python
Python3
py
Runtime Error
0
0
229
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()
s496780784
p00102
u460331583
1347614272
Python
Python
py
Runtime Error
0
0
758
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 continue t = thing.index(hoge) print money[t] else: for i in range(count): hoge = map(str,raw_input().split()) if hoge[0] not in thing: print 0 break t = int(hoge[1]) x,y = 2,0 for j in range(t): r = thing.index(hoge[x]) y += money[r] x+=1 e = thing.index(hoge[0]) money[e]= y g = raw_input() ans = thing.index(g) print money[ans]
s748458434
p00102
u665962315
1357432708
Python
Python
py
Runtime Error
0
0
511
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)): sum += a[row][col]; col_sum.append(sum) a.append(col_sum) for row in range(len(a)): for col in range(len(a[0])): print "%5d" % a[row][col], print
s950139995
p00102
u093607836
1383134300
Python
Python
py
Runtime Error
0
0
260
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])
s545764163
p00102
u193025715
1397813818
Python
Python
py
Runtime Error
0
0
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(map(lamda x: str(x).rjust(5), a))
s394079627
p00103
u266872031
1428058603
Python
Python3
py
Runtime Error
0
0
374
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 run=0 print score game=game+1
s031284883
p00103
u873482706
1435148587
Python
Python
py
Runtime Error
0
0
599
while True: try: 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: print p p = 0 b = [0,0,0] o = 0 except EOFError: break
s040802265
p00103
u873482706
1452007143
Python
Python3
py
Runtime Error
0
0
525
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] = 1 runner[0] = 1 elif event == 'HOMERUN': point += (sum(runner)+1) elif event == 'OUT': out += 1 if out == 3: print(point)
s860247564
p00103
u844704750
1498785397
Python
Python3
py
Runtime Error
0
0
484
n = int(input()) out_count = 0 score = 0 runners = [0, 0, 0] while n: event = input() if event == "HIT": if runners.pop(): score+=1 runners = [1] + runners if event == "HOMERUN": score += 1 + sum(runners) runners = [0, 0, 0] if event == "OUT": out_count += 1 if out_count > 2: print(score) score = 0 out_count = 0 runners = [0, 0, 0]
s670294269
p00103
u424041287
1507884909
Python
Python3
py
Runtime Error
0
0
282
a = int(input().rstrip()) b = 0 while a > b: c = 0 runner = 0 point = 0 while c < 3: x = input().rstrip() if x == HIT: if runner == 3: point += 1 else: runner += 1 elif x == HOMERUN: point = point + runner + 1 runner = 0 else: c += 1 print(point)
s014766455
p00103
u424041287
1507886078
Python
Python3
py
Runtime Error
0
0
282
a = int(input().rstrip()) b = 0 while a > b: c = 0 runner = 0 point = 0 while c < 3: x = input().rstrip() if x == HIT: if runner == 3: point += 1 else: runner += 1 elif x == HOMERUN: point = point + runner + 1 runner = 0 else: c += 1 print(point)