A newbie to the code chef

n = int(input())
a1 = 0
while a1 < n:
    present_days = 0
    days_passed = int(input())
    for element in input():
        if element == "1":
            present_days += 1 
    left_days = 120 - days_passed
    a = (present_days + left_days) / 120 * 100
    if a >= 75:
        print("YES")
    else:
        print("NO")
                                or 
 t=int(input())
for _ in range(t):
    n=int(input())
    print("YES" if (((120-input().count('0'))/120)*100)>=75 else "NO")

given above are two blocks of code for same problem (https://www.codechef.com/problems/ATTENDU)

HI i just wanna know that what problems my first block of code is facing to get selected as a valid solution and be submitted.Both the blocks are returning same result in private ide but first block of my code shows runtime error(NZEC) and second block not in codechef online ide.