코드를 돌리니 RTE(nonzero return code)가 나왔습니다.
어디서 이 에러가 나오는지 찾아보기 위해서
입력은 구색만 맞춰서 받도록 하고 출력은 무조건 YES가 나오게 했습니다.
기본적인 입력에서부터 문제가 생겨버리니 더 이상 진행 할 수 없어 질문을 드립니다.
코드는 다음과 같습니다.
~~~python
testCases = input()
boolresult = []
for testcase in range(int(testCases)):
name =[]
winGame =[]
Games=[]
winRatio=[]
leftName = []
rightName =[]
targetName = ""
for num in range(8):
line = input()
lineofEle = line.split()
name.append(lineofEle[0])
winGame.append(int(lineofEle[1]))
Games.append(int(lineofEle[1])+int(lineofEle[2])+int(lineofEle[3]))
winRatio.append(winGame[num]/Games[num])
targetName=input()
remainGames=input()
for num in range(int(remainGames)):
line=input()
lineofEle = line.split()
leftName.append(name.index(lineofEle[0]))
rightName.append(name.index(lineofEle[1]))
if recurs(int(remainGames)):
boolresult.append("YES")
else:
boolresult.append("NO")
for i in range(len(boolresult)):
print(boolresult[i])
첫번째 for문에서 케이스의 시행횟수를 입력받고
8줄의 팀의 정보는 split으로 나누어 받습니다.
또한 for문에서는 int함수로 string으로 받은 숫자를 int형으로 치환합니다
그 외에는 문제가 생길만한 곳은 잘 모르겠습니다
알려주시면 감사하겠습니다.
hogaeng
코드를 돌리니 RTE(nonzero return code)가 나왔습니다.
어디서 이 에러가 나오는지 찾아보기 위해서
입력은 구색만 맞춰서 받도록 하고 출력은 무조건 YES가 나오게 했습니다.
기본적인 입력에서부터 문제가 생겨버리니 더 이상 진행 할 수 없어 질문을 드립니다.
코드는 다음과 같습니다.
~~~python
name =[]
winGame =[]
Games=[]
winRatio=[]
leftName = []
rightName =[]
targetName = ""
def recurs(dummy):
return True
testCases = input()
boolresult = []
for testcase in range(int(testCases)):
name =[]
winGame =[]
Games=[]
winRatio=[]
leftName = []
rightName =[]
targetName = ""
for num in range(8):
line = input()
lineofEle = line.split()
name.append(lineofEle[0])
winGame.append(int(lineofEle[1]))
Games.append(int(lineofEle[1])+int(lineofEle[2])+int(lineofEle[3]))
winRatio.append(winGame[num]/Games[num])
targetName=input()
remainGames=input()
for num in range(int(remainGames)):
line=input()
lineofEle = line.split()
leftName.append(name.index(lineofEle[0]))
rightName.append(name.index(lineofEle[1]))
if recurs(int(remainGames)):
boolresult.append("YES")
else:
boolresult.append("NO")
for i in range(len(boolresult)):
print(boolresult[i])
8년 전