2010프로야구 파이썬 RTE 질문입니다

  • hogaeng
    hogaeng

    코드를 돌리니 RTE(nonzero return code)가 나왔습니다.
    어디서 이 에러가 나오는지 찾아보기 위해서
    입력은 구색만 맞춰서 받도록 하고 출력은 무조건 YES가 나오게 했습니다.
    기본적인 입력에서부터 문제가 생겨버리니 더 이상 진행 할 수 없어 질문을 드립니다.
    코드는 다음과 같습니다.

    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])
    

    첫번째 for문에서 케이스의 시행횟수를 입력받고
    8줄의 팀의 정보는 split으로 나누어 받습니다.
    또한 for문에서는 int함수로 string으로 받은 숫자를 int형으로 치환합니다
    그 외에는 문제가 생길만한 곳은 잘 모르겠습니다
    알려주시면 감사하겠습니다.


    6년 전
1개의 댓글이 있습니다.
  • hogaeng
    hogaeng

    자문자답합니다. 한번도 경기를 치르지 않는 팀의 예외처리를 하지 않아서 오류가 난 것이었습니다.


    6년 전 link
  • 정회원 권한이 있어야 커멘트를 다실 수 있습니다. 정회원이 되시려면 온라인 저지에서 5문제 이상을 푸시고, 가입 후 7일 이상이 지나셔야 합니다. 현재 문제를 푸셨습니다.