Cho e hỏi lỗi như dưới đây là gì và sửa như nào ạ
Đề bài đây ạ:
Code:
f=open('olympic.inp','r')
g=open('olympic.out','w')
n,m=map(int,f.readline().split())
s=[int(x) for x in f.readline().split()]
b=[]
period=[[0,0,0]]
for i in range(m):
b.append([int(x) for x in f.readline().split()])
for i in range(n):
prev=period[i].copy()
if s[i]==1:prev[0]+=1
elif s[i]==2:prev[1]+=1
else:prev[2]+=1
period.append(prev)
for i in b:
g.write(f'{period[i[1]][0]-period[i[0]-1][0]} {period[i[1]][1]-period[i[0]-1][1]} {period[i[1]][2]-period[i[0]-1][2]}\n')
f.close()
g.close()
Lỗi trên Themis:
● OLYMPIC: 0.00
OLYMPIC.py
;Mã nguồn Python được thông dịch!
◆ test01: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)
◆ test02: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)
◆ test03: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)
◆ test04: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)
◆ test05: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)
◆ test06: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)
◆ test07: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)
◆ test08: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)
◆ test09: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)
◆ test10: 0.00
Chạy sinh lỗi
Command: "C:\Program Files (x86)\Themis\PYTHON\python.exe" "OLYMPIC.py" terminated with exit code: 1 (Hexadecimal: 1)