Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02548 (python)

Fixed submission:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()

ans = 0
for a in range(1,n):
    ans += (n-1)//a        

print(ans)

Buggy submission (verdict: Runtime Error):
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,k = inpm()
LR = inplt(k)

s = []
for l,r in LR:
    for i in range(l,r+1):
        s.append(i)
s.sort(reverse=True)
dp = [0.1] + [1] + [0]*(n-1)

# for i in range(2,n+1):
#     for j in s:
#         if i - j < 1:
#             break
#         dp[i] = (dp[i] + dp[i-j]) % 998244353

def f(x):
    if dp[x] != 0:
        return dp[x]
    else:
        ret = sum(map(f,[x-ss for ss in s if ss < x])) % 998244353
        dp[x] = ret
        return ret

print(f(n))
Problem p02717 (python)

Fixed submission:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

x,y,z = inpm()

print(str(z) + " " + str(x) + " " + str(y))

Buggy submission (verdict: Runtime Error):
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

x,y,z = inpm()

print(str(z) + " " + str(x) + " " + str(y))
Problem p02732 (python)

Fixed submission:
import sys, bisect, math, itertools, string, queue, copy
#import numpy as np
#import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
a = inpl()
kosuu = [0]*(200000+1)
cnt = [0]*(200000+1)
ans = [0]*(200000+1)

for i in range(n):
  kosuu[a[i]] += 1

s = 0
for i in kosuu:
  s += i * (i - 1) // 2

for i in range(n):
  tmp = kosuu[a[i]]
  #print(s - cnt[a[i]] + max(0,((tmp - 1)*(tmp - 2)//2)))
  print(s - max(0,tmp-1))

Buggy submission (verdict: Runtime Error):
import sys, bisect, math, itertools, string, queue, copy
#import numpy as np
#import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
a = inpl()
kosuu = [0]*(200000+1)
cnt = [0]*(200000+1)
ans = [0]*(200000+1)

for i in range(n):
  kosuu[a[i]] += 1

s = 0
for i in kosuu:
  s += i * (i - 1) // 2

for i in range(n)
  tmp = kosuu[a[i]]
  #print(s - cnt[a[i]] + max(0,((tmp - 1)*(tmp - 2)//2)))
  print(s - max(0,tmp-1))
Problem p03557 (python)

Fixed submission:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
A = sorted(inpl())
B = sorted(inpl())
C = sorted(inpl())

ans = 0
for b in B:
    tmp = bisect.bisect_right(C,b)
    tmp2 = bisect.bisect_left(A,b)
    ans += (n-tmp) * tmp2

print(ans)

Buggy submission (verdict: Runtime Error):
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline.rstrip()
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
A = sorted(inpl())
B = sorted(inpl())
C = sorted(inpl())

ans = 0
d = defaultdict(int)
for b in B:
    d[b] = len(C[bisect.bisect_right(C,b):])
for a in A:
    for b in B[bisect.bisect_right(B,a):]:
        ans += d[b]

print(ans)
Problem p02536 (python)

Fixed submission:
class path_compressed_quick_union:
    def __init__(self, n):
        self.n = n
        self.data = [i for i in range(n)]
        self.size = [1 for i in range(n)]

    def root(self, p):
        while p != self.data[p]:
            self.data[p] = self.data[self.data[p]]
            p = self.data[p]
        return p

    def connected(self, p, q):
        return self.root(p) == self.root(q)

    def union(self, p, q):
        proot = self.root(p)
        qroot = self.root(q)
        if self.size[proot] < self.size[qroot]:
            self.data[qroot] = proot
            self.size[qroot] += self.size[proot]
        else:
            self.data[proot] = qroot
            self.size[proot] += self.size[qroot]



N, M = map(int,input().split())
uf = path_compressed_quick_union(N)
for i in range(M):
    a,b=map(int,input().split())
    uf.union(a-1,b-1)
ans = []
for i in range(N):
    ans.append(uf.root(i))
print(len(set(ans))-1)

Buggy submission (verdict: Runtime Error):
class path_compressed_quick_union:
    def __init__(self, n):
        self.n = n
        self.data = [i for i in range(n)]
        self.size = [1 for i in range(n)]

    def root(self, p):
        while p != self.data[p]:
            self.data[p] = self.data[self.data[p]]
            p = self.data[p]
        return p

    def connected(self, p, q):
        return self.root(p) == self.root(q)

    def union(self, p, q):
        proot = self.root(p)
        qroot = self.root(q)
        if self.size[proot] < self.size[qroot]:
            self.data[qroot] = proot
            self.size[qroot] += self.size[proot]
        else:
            self.data[proot] = qroot
            self.size[proot] += self.size[qroot]



N, M = map(int,input().split())
uf = path_compressed_quick_union(N)
for i in range(M):
    a,b=map(int,input().split())
    uf.union(a,b)

print(len(set(uf.data))-1)
Problem p02582 (python)

Fixed submission:
# # abc175_a.py
S = input()
ans  = [0]
cnt = 0
for i in S:
    if i =="S":
        ans.append(cnt)
        cnt = 0
    else:
        cnt+=1
print(max(max(ans),cnt))

Buggy submission (verdict: Runtime Error):
# # abc175_a.py
S = input()
ans  = []
cnt = 0
for i in S:
    if i =="S":
        ans.append(cnt)
        cnt = 0
    else:
        cnt+=1
print(max(max(ans),cnt))
Problem p02696 (python)

Fixed submission:
import math
def f(x):
    return math.floor(A*x/B)

A, B, N = map(int, input().split())
print(f(min(B-1,N)))

Buggy submission (verdict: Runtime Error):
# abc165_d.py
from math import floor
A, B,N = map(int,input().split())
ans = 0
for i in range(1,A):
    t = floor(A*i/B)-A*floor(i/B)
#    print(i, t,floor(A*i/B),A*floor(i/B))
    if ans<=t:
        ans = t
print(ans)# abc165_d.py
from math import floor
A, B,N = map(int,input().split())
ans = -100000000
for i in range(1,A):
    t = floor(A*i/B)-A*floor(i/B)
#    print(i, t,floor(A*i/B),A*floor(i/B))
    if ans<=t:
        ans = t
print(ans)
Problem p02714 (python)

Fixed submission:
# abc162_d.py
n = int(input())
s = input()
r = s.count("R")
g = s.count("G")
b = s.count("B")
cnt= 0
for i in range(n):
    for j in range(i,n):
        if 2*j-i<n:
            if s[i] != s[j] and s[i] != s[2*j-i] and s[j] != s[2*j-i]:
                cnt += 1
print(r*g*b-cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
r = s.count("R")
g = s.count("G")
b = s.count("B")
cnt= 0
for i in range(n):
    for j in range(i,n):
        if s[i] != s[j] and s[i] != s[2*j-i] and s[j] != s[2*j-i] and 2*j-i<n:
            cnt += 1
print(r*g*b-cnt)
Problem p02761 (python)

Fixed submission:
N,M = map(int,input().split())
s = []
c = []
ans = -1
ans_flg = True
for i in range(M):
  si, ci = map(int,input().split())
  s.append(si)
  c.append(ci)
for i in range(1000):
    #print("i : ",i)
    ans_str = str(i)
    if len(str(i)) != N:
        continue
    for j in range(len(s)):
        #print("ans_str : ",ans_str,", ans_str[s[j]-1] : ",ans_str[s[j]-1],", s[j] : ",s[j],", c[j] : ",c[j])
        if ans_str[s[j]-1] != str(c[j]):
            #print("hoge",ans_flg)
            ans_flg = False
            break
        else:
            #print("fuga")
            ans_flg = True
    #print(i)
    if ans_flg:
        ans = i
        break
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
s = []
c = []
ans = -1
ans_flg = True
for i in range(M):
  si, ci = map(int,input().split())
  s.append(si)
  c.append(ci)
for i in range(1000):
    #print("i : ",i)
    ans_str = str(i)
    if i < 10**(N-1)-1 or i > 10**(N+1):
        continue
    for j in range(len(s)):
        #print("ans_str : ",ans_str,", ans_str[s[j]-1] : ",ans_str[s[j]-1],", s[j] : ",s[j],", c[j] : ",c[j])
        if ans_str[s[j]-1] != str(c[j]):
            #print("hoge",ans_flg)
            ans_flg = False
            break
        else:
            #print("fuga")
            ans_flg = True
    #print(i)
    if ans_flg:
        ans = i
        break
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
s = []
c = []
flg = [0]*N
ok_flg = True
ans = [0]*N
answer = "-1"
for i in range(M):
  si, ci = map(int,input().split())
  s.append(si)
  c.append(ci)
#print("s:",s,",c:",c)
for i in range(len(s)):
#  print(ans)
#  print(10**s[i] , 10**(N))
  if 10**s[i] > 10**(N):
    ok_flg = False
    break
  if flg[s[i]-1]  == 0:
#    print("for :",s[i],c[i])
    ans[s[i]-1] = c[i]
    flg[s[i]-1] = 1
  else:
    if ans[s[i]-1] != c[i]:
      answer = -1
      ok_flg = False
      break
is_zero = 0
if ok_flg :
  answer = ""
  for i in ans:
    answer += str(i)
    is_zero += i
  if is_zero == 0:
    answer = "-1"
  if M = 0:
    answer = 0
print(int(answer))
Problem p02801 (python)

Fixed submission:
al = "abcdefghijklmnopqrstuvwxyz"
i = input()
for a in range(len(al)):
  if al[a] == i:
    print(al[a+1])

Buggy submission (verdict: Runtime Error):
al = "abcdefghijklmnopqrstuvwxyz"
i = input()
for a in ramge(al):
  if al[a] == i:
    print(al[a+1])

al = "abcdefghijklmnopqrstuvwxyz"
i = input()
for a in range(len(al)):
  if al[a] == i:
    print(al[a+1])
Problem p02842 (python)

Fixed submission:
# sumitb2019_b.py
import math 
N = int(input())
for i in range(50000):
    if math.floor(i*1.08) == N:
        print(i)
        exit()
print(":(")

Buggy submission (verdict: Runtime Error):
# sumitb2019_b.py
import math
N = int(input())
for i in range(N):
    if math.floor(i*1.08) == N:
#        print(i)
#        exit()
print(":(")
Problem p02995 (python)

Fixed submission:

import math
from  fractions import gcd

def lcm(a,b):
    return (a*b)//gcd(a,b)

A,B,C,D = map(int,input().split())
d_cnt = B//D-(A-1)//D
c_cnt = B//C-(A-1)//C
cd = lcm(C,D)
cd_cnt = B//cd-(A-1)//cd
print(B-A+1-(c_cnt+d_cnt-cd_cnt))

Buggy submission (verdict: Runtime Error):
# abc131_c.py
'''
M を C,D でそれぞれ割り切れるもの
N を CD の最小公倍数で割り切れるもの
とすると
(B - A + 1) - (M - N)
で求められるはず
'''
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)

def lcm(a,b):
    return (a*b)//gcd(a,b)

A,B,C,D = map(int,input().split())
r = (B - A + 1)
M = math.ceil(r/C) + math.ceil(r/D)
N = math.ceil(r/lcm(C,D))
print(r-M+N)

Buggy submission (verdict: Runtime Error):

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
import math

def lcm(a,b):
    return (a*b)//gcd(a,b)

A,B,C,D = map(int,input().split())
r = (B - A + 1)
M = math.ceil(r/C) + math.ceil(r/D)
N = math.ceil(r/lcm(C,D))
print(r-M+N)
Problem p03001 (python)

Fixed submission:
W,H,x,y = map(int,input().split())
scale = W*H/2
div = 0
if x==W/2 and y==H/2:
  div = 1
print(scale,div)

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int,input().split())
duplicate = 1 if W/x==2 and H/y==2 else 0
x_min = min((W-x)*H, x*H)
y_min = min(W*(H-y), W*y)
area = max(x_min, y_min)
print(area, duplicate)
Problem p03106 (python)

Fixed submission:
# abc120_b.py
import fractions 
from functools import reduce
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

A, B, K = map(int,input().split())
cnt = 0
_max = gcd(A,B)
while _max>=0:
    if A%_max==0 and B%_max==0:
        cnt += 1
        if cnt == K:
            print(_max)
            exit()
    _max -=1

Buggy submission (verdict: Runtime Error):
# abc120_b.py
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)

A, B, K = map(int,input().split())
cnt = 0
_max = gcd(A,B)
while _max>=0:
    if A%_max==0 and B%_max==0:
        cnt += 1
        if cnt == K:
            print(_max)
            exit()
    _max -=1
Problem p03284 (python)

Fixed submission:
N ,K = map(int,input().split())
if N%K == 0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
N ,K = map(int,inpuit())
if N%K == 0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
N ,K = map(int,inpuit())
print(N%K)
Problem p03479 (python)

Fixed submission:
X,Y = map(int,input().split())
ans = 0
while Y>=X:
  ans += 1
  X*=2
print(ans)

Buggy submission (verdict: Runtime Error):
X,Y = map(int,unput().split())
ans = 0
while Y<=X:
  ans += 1
  X*=2
print(ans)
Problem p03485 (python)

Fixed submission:
#import math
def round_up_mean(a,b):
#  ans = math.ceil((a+b)/2)
#  print(ans)
  ans = -(-(a+b)//2)
  print(ans)

a, b = map(int, input().split(" "))
round_up_mean(a, b)

Buggy submission (verdict: Runtime Error):
def round_up_mean(a,b):
  ans = -(-(a+b)//2)
  print(ans)


a,b = int(input().split(" "))
round_up_mean(a, b)

Buggy submission (verdict: Runtime Error):
def round_up_mean(a,b):
  ans = -(-(a+b)//2)
  print(ans)


a,b = int(input().split(""))
round_up_mean(a, b)

Buggy submission (verdict: Runtime Error):
#import math
def round_up_mean(a,b):
#  ans = math.ceil((a+b)/2)
#  print(ans)
  ans = -(-(a+b)//2)
  print(ans)


a = int(input())
b = int(input())
round_up_mean(a, b)
Problem p03844 (python)

Fixed submission:
a,op,b = input().split()
if op == "+":
  print(int(a)+int(b))
else:
  print(int(a)-int(b))

Buggy submission (verdict: Runtime Error):
a,op,b = input().split()
if op == "+":
  print(a+b)
else:
  print(a-b)
Problem p04029 (python)

Fixed submission:
n = int(input())
print(int(n/2*(n+1)))

Buggy submission (verdict: Runtime Error):
　n = int(input())
  print(n/2(n+1))
Problem p02576 (python)

Fixed submission:
n, x, t, = map(int, input().split())

result = n // x
result2 = n % x
if result2 != 0:
    result += 1
result *= t
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())


def digits_of(n):
    digits = [] 
    while n != 0:
        r = n % 10 
        digits.append(r) 
        n = n // 10  
    return digits


def is_multiple_of_9(n): 
    sum = 0  
    for i in digits_of(n):
        sum += i
    return sum % 9 == 0


if is_multiple_of_9(n):
    print("Yes")
else:
    print("No")
Problem p03244 (python)

Fixed submission:
from collections import Counter
n = int(input())
v = list(map(int, input().split()))

k = n // 2
half = [Counter(), Counter()]
for i in range(k):
    for par in range(2):
        half[par][v[2*i+par]] += 1

cmn = [0, 0]
for par in range(2):
    cmn[par] = half[par].most_common(2)
    if len(cmn[par]) == 1:
        cmn[par].append(('ghost', 0))
if cmn[0][0][0] != cmn[1][0][0]:
    ret = n - cmn[0][0][1] - cmn[1][0][1]
else:
    ret = n - max(cmn[0][0][1] + cmn[1][1][1], cmn[0][1][1] + cmn[1][0][1])
print(ret)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
​
cnt = [Counter(), Counter()]
cmn = [0, 0]
for parity in range(2):
    for i in (range(parity, n, 2)):
        cnt[parity][v[i]] += 1
    cmn[parity] = cnt[parity].most_common(1)[0]
​
if cmn[0][0] != cmn[1][0]:
    ret = n - cmn[0][1] - cmn[1][1]
else:
    subcmn_mult = [0, 0]
    for parity in range(2):
        try:
            subcmn_mult[parity] = cnt[parity].most_common(2)[1][1]
        except IndexError:
            subcmn_mult[parity] = 0
    ret = n - cmn[0][1] - max(subcmn_mult[0], subcmn_mult[1])
print(ret)
Problem p03583 (python)

Fixed submission:
n = int(input())
imin = n // 4
flag = False
for i in range(imin, 3501):
    num = i * n
    den = 4 * i - n
    if den <= 0:
        continue
    jmin = num // den
    for j in range(jmin, 3501):
        num = i * j * n
        den = 4 * i * j - i * n - j * n
        if den > 0 and num % den == 0:
            k = num // den
            print("{} {} {}".format(i, j, k))
            flag = True
            break
    if flag:
        break

Buggy submission (verdict: Runtime Error):
n = int(input())
imin = n // 4
flag = False
for i in range(imin, 3501):
    jmin = i * n // (4 * i - n)
    for j in range(jmin, 3501):
        num = i * j * n
        den = 4 * i * j - i * n - j * n
        if den > 0 and num % den == 0:
            k = num // den
            print("{} {} {}".format(i, j, k))
            flag = True
    if flag:
        break
Problem p02639 (python)

Fixed submission:
a,b,c,d,e = map(int, input().split())


if a == 0:
    print(1)
elif b == 0:
    print(2)
elif c == 0:
    print(3)
elif d == 0:
    print(4)
else:
    print(5)

Buggy submission (verdict: Runtime Error):
a,b,c,d,e = map(int, input().split())


if a == 0:
        print(1)
    elif b == 0:
        print(2)
    elif c == 0:
        print(3)
    elif d == 0:
        print(4)
    else:
        print(5)