Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m = list(map(int, input().split()))
counter = [0 for _ in range(m)]
#min = m

for i in range(n):
  k,*b = input().split()
  b = [int(j) for j in b]
  for l in b:
    counter[l] +=1
    
print(counter.count(n))

Fixed submission:
n,m = list(map(int, input().split()))
counter = [0]*m
#min = m

for i in range(n):
  k,*b = input().split()
  b = [int(j) for j in b]
  for l in b:
    counter[l-1] +=1
    
print(counter.count(n))
Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
l = [s]

while 1:
  if s %2 == 0:
    l.append(s/2)
    s = s/2
  else:
    l.append(3*s + 1)
    s = 3*s+1
  
  if any(l.count(i) >= 2 for i in range(1000001)):
    print(len(l))
    break

Fixed submission:
s = int(input())
l = [s]
max=s

while 1:
  if s %2 == 0:
    l.append(s/2)
    s = int(s/2)
  else:
    l.append(3*s + 1)
    s = 3*s+1
    max = s
  
  if any(l.count(i) >= 2 for i in range(s+1)):
    print(len(l))
    break
Buggy python submission (verdict: Runtime Error):
D = int(input())
 
if D = 25:
  print("Chrismas")
elif D = 24:
  print("Chrismas Eve")
elif D = 23:
  print("Chrismas Eve Eve")
elif D = 22:
  print("Chrismas Eve Eve Eve")

Fixed submission:
D = int(input())
 
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
elif D == 22:
  print("Christmas Eve Eve Eve")

Buggy python submission (verdict: Runtime Error):
D = int(input())

if D = 25:
  print(Chrismas)
elif D = 24:
  print(Chrismas Eve)
elif D = 23:
  print(Chrismas Eve Eve)
elif D = 22:
  print(Chrismas Eve Eve Eve)

Fixed submission:
D = int(input())
 
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
elif D == 22:
  print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Runtime Error):
x=int(input())

print("YES" if x==7orx==5orx==3 else "NO")

Fixed submission:
x=int(input())
 
print("YES" if x==7 or x==5 or x==3 else "NO")

Buggy python submission (verdict: Runtime Error):
x=int(input())

print(YES if x=7orx=5orx=3 else NO)

Fixed submission:
x=int(input())
 
print("YES" if x==7 or x==5 or x==3 else "NO")
Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=list(map(int,input().split()))
h=list(map(int,input().split()))
imin=100000
suf=0
for i in range(n):
  h[i]=t- h[i]＊0.006
  if imin > abs(a- h[i]):
    imin=abs(a- h[i])
    suf=i
print(i)
  
    

Fixed submission:
n=int(input())
t,a=list(map(int,input().split()))
h=list(map(int,input().split()))
imin=100000
suf=0
for i in range(n):
  h[i]=t- h[i]*0.006
  if a>=h[i]:
    if imin>a-h[i]:
      #print("!!",a-h[i],h[i],i)
      imin=abs(a- h[i])
      suf=i
  else:
    if imin>h[i]-a:
      #print("!!",a-h[i],h[i],i)
      imin=abs( h[i]-a)
      suf=i 
print(suf+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
 
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(A+B)

Fixed submission:
n = int(input())
 
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
 
if n == 1:
  print("Hello World")
else n == 2:
  a = int(input())
  b = int(input())
  print(A+B)

Fixed submission:
n = int(input())
 
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)

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

if n == 1:
  print("Hello World")
else n == 2:
  print(A+B)

Fixed submission:
n = int(input())
 
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
w = []
for i in range(n):
    w.append(input())
if len(w) != len(set(w)):
    print("No")
    sys.exit()
for i in range(n-1):
    if w[i][len(w[i]) - 1] != w[i+1][len(w[i+1] - 1)]:
        print("No")
        sys.exit()
print("Yes")

Fixed submission:
import sys
n = int(input())
w = []
for i in range(n):
    w.append(input())
if len(w) != len(set(w)):
    print("No")
    sys.exit()
for i in range(n-1):
    if w[i][len(w[i]) - 1] != w[i+1][0]:
        print("No")
        sys.exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
import sys

def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num

n = int(input())
count =0
for i in range(1,n+1,2):
    tmp = search_divisor_num_1(i)
    if tmp == 8:
        count+=1
print(count)

Fixed submission:
import sys
import math
def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]
    
n = int(input())
count =0
for i in range(1,n+1,2):
    tmp = search_divisor_num_1(i)
    if tmp == 8:
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
n2 = n
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit(1)
    n -= 7
while n2>0:
    if n2 % 4 == 0 or n2 % 7 == 0:
        print("Yes")
        sys.exit(1)
    n2 -= 4
print("No")

Fixed submission:
import sys
n = int(input())
n2 = n
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit()
    n -= 7
while n2>0:
    if n2 % 4 == 0 or n2 % 7 == 0:
        print("Yes")
        sys.exit()
    n2 -= 4
print("No")

Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
n2 = n
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit(1)
    n -= 7
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit(1)
    n -= 4
print("No")

Fixed submission:
import sys
n = int(input())
n2 = n
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit()
    n -= 7
while n2>0:
    if n2 % 4 == 0 or n2 % 7 == 0:
        print("Yes")
        sys.exit()
    n2 -= 4
print("No")
Buggy python submission (verdict: Runtime Error):
import sys
s = input()
t = input()

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        del s[0]
        s = s + tmp
print("No")

Fixed submission:
import sys
s = input()
t = input()

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        s = s[1:] + tmp
print("No")

Buggy python submission (verdict: Runtime Error):
import sys
s = set(input())
t = set(input())

if len(s) != len(t):
    print("No")
    sys.exit()

if all(s.count(t[i]) ==1 for i in range(len(t))):
    print("Yes")
else:
    print("No")

Fixed submission:
import sys
s = input()
t = input()

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        s = s[1:] + tmp
print("No")
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
a = list(map(int, input().split())).sorted()
print(a[n-1] - a[0])

Fixed submission:
import sys
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[n-1] - a[0])
Buggy python submission (verdict: Runtime Error):
import sys
import math

def isExponential(i : int) -> bool:
    for j in range(2,math.ceil(math.sqrt(i))+1):       
        devidend = i
        devisor = j
        #print(devidend,devisor,"inFor") 
        while 1:
            #print(devidend,devisor,"inWhile")
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return True
                else:
                    devidend //= devisor
    return False

x = int(input())
if x == 1:
    print(1)
for i in range(x,0,-1):
    if isExponential(i) == True:
        #print(i)
        #print("wtf")
        break
    else:
        print(i,"False")

Fixed submission:
a,b,c,d = list(map(int, input().split()))
print("Yes" if abs(a-c)<= d or abs(a-b)<=d and abs(c-b) <= d else "No")
Buggy python submission (verdict: Runtime Error):
import sys
import math

def isExponential(i : int) -> bool:
    for j in range(math.sqrt(i)):
        devidend = i
        devisor = j
        while 1:
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return 1
                else:
                    devidend //= devisor
    return 0
x = int(input())
for i in range(x,0,-1):
    if isExponential(i):
        print(i)
        break

Fixed submission:
import sys
import math

def isExponential(i : int) -> bool:
    #math.ceil(math.sqrt(i))+1
    for j in range(2,i):       
        devidend = i
        devisor = j
        #print(devidend,devisor,"inFor") 
        while 1:
            #print(devidend,devisor,"inWhile")
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return True
                else:
                    devidend //= devisor
    return False

x = int(input())
if x == 1:
    print(1)
for i in range(x,0,-1):
    if isExponential(i) == True:
        print(i)
        #print("wtf")
        break
Buggy python submission (verdict: Runtime Error):
import sys
import math

a,b,k = list(map(int, input().split()))
lis = range(a,a+k)
lis.append(range(b-k+1, b+1))
for i in range(len(lis)):
    print(lis[i])

Fixed submission:
import sys
import math

a,b,k = list(map(int, input().split()))
if b-a+1 <= k:
    for i in range(a,b+1):
        print(i)
else:
    lis = list(range(a,a+k))
    lis.extend(list(range(b-k+1, b+1)))
    lis = list(set(lis))
    lis.sort()
    for i in range(len(lis)):
        print(lis[i])

Buggy python submission (verdict: Runtime Error):
import sys
import math

a,b,k = list(map(int, input().split()))
lis = range(a,a+k) + range(b-k+1, b+1)
for i in range(len(lis)):
    print(lis[i])

Fixed submission:
import sys
import math

a,b,k = list(map(int, input().split()))
if b-a+1 <= k:
    for i in range(a,b+1):
        print(i)
else:
    lis = list(range(a,a+k))
    lis.extend(list(range(b-k+1, b+1)))
    lis = list(set(lis))
    lis.sort()
    for i in range(len(lis)):
        print(lis[i])
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse=True)
print(s[::2] - s[1::2])


Fixed submission:
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse=True)
print(sum(s[::2]) - sum(s[1::2]))
Buggy python submission (verdict: Runtime Error):
s = input().split("/")
print("2018/01/"+s[3])

Fixed submission:
s = input().split("/")
print("2018/01/"+s[2])
Buggy python submission (verdict: Runtime Error):
import sys
s = input().sort()
t = input().sort(reverse = True)
for i in range(min(len(s),len(t))):
    if ord(s[i]) < ord(t[i]):
        print("Yes")
        sys.exit()
    elif ord(s[i]) > ord(t[i]):
        print("No")
        sys.exit()
print("Yes" if len(s) < len(t) else "No")

Fixed submission:
import sys
s = list(input())
s.sort()
t = list(input())
t.sort(reverse = True)
for i in range(min(len(s),len(t))):
    if ord(s[i]) < ord(t[i]):
        print("Yes")
        sys.exit()
    elif ord(s[i]) > ord(t[i]):
        print("No")
        sys.exit()
print("Yes" if len(s) < len(t) else "No")
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
a = list(map(int, input().split()))
count = 0
while all(a[i] % 2 == 0 for i in a):
    a = [a[i] // 2 for i in a]
    count+=1
print(count)

Fixed submission:
import sys
n = int(input())
a = list(map(int, input().split()))
count = 0
while all(i % 2 == 0 for i in a):
    a = [i // 2 for i in a]
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
x,y,z= list(map(int, input().split()))
if y>=z:
    print("delicious")
else:
    print("safe" if x+a>=b else "dangerous")


Fixed submission:
x,y,z= list(map(int, input().split()))
if y>=z:
    print("delicious")
else:
    print("safe" if x+y>=z else "dangerous")
Buggy python submission (verdict: Runtime Error):
import sys

def search_next(nextbutton : int) -> int:
    nextbutton = a.index(nextbutton) +1
    return nextbutton

n = int(input())
a = [int(input()) for i in range(n)]
nextbutton = 2
count = 1

try :
    nextbutton = search_next(nextbutton)
except:
    print(-1)
    sys.exit()
#print(nextbutton,"first")

for _ in range(n):
    if nextbutton == 2:
        print(-1)
        #print(nextbutton,"2")
        
        sys.exit()
    elif nextbutton == 1:
        print(count)
        #print(nextbutton,"1")
        
        sys.exit()
    else:
        nextbutton = search_next(nextbutton)
        #print(nextbutton,"el")
        
        count += 1
print(-1)

Fixed submission:
import sys

def search_next(nextbutton : int) -> int:
    nextbutton = a.index(nextbutton) +1
    return nextbutton

n = int(input())
a = [int(input()) for i in range(n)]
nextbutton = 1
count = 0

#print(nextbutton,"first")

for _ in range(n):
    if nextbutton == 2:
        print(count)
        #print(nextbutton,"1")
        
        sys.exit()
    else:
        nextbutton = a[nextbutton -1]
        #print(nextbutton,"el")
        
        count += 1
print(-1)

Buggy python submission (verdict: Runtime Error):
import sys

def search_next(nextbutton : int) -> int:
    nextbutton = a.index(nextbutton) +1
    return nextbutton

n = int(input())
a = [int(input()) for i in range(n)]
nextbutton = 2
count = 1

try :
    nextbutton = search_next(nextbutton)
except:
    print(-1)
    sys.exit()
#print(nextbutton,"first")

while 1:
    if nextbutton == 2:
        print(-1)
        #print(nextbutton,"2")
        
        sys.exit()
    elif nextbutton == 1:
        print(count)
        #print(nextbutton,"1")
        
        sys.exit()
    else:
        nextbutton = search_next(nextbutton)
        #print(nextbutton,"el")
        
        count += 1

Fixed submission:
import sys

def search_next(nextbutton : int) -> int:
    nextbutton = a.index(nextbutton) +1
    return nextbutton

n = int(input())
a = [int(input()) for i in range(n)]
nextbutton = 1
count = 0

#print(nextbutton,"first")

for _ in range(n):
    if nextbutton == 2:
        print(count)
        #print(nextbutton,"1")
        
        sys.exit()
    else:
        nextbutton = a[nextbutton -1]
        #print(nextbutton,"el")
        
        count += 1
print(-1)
Buggy python submission (verdict: Runtime Error):
import sys
x,y = list(input().split())
judge = 0
x = x.translate(string.maketrans({"3":"1","5":"1","7":"1","8":"1","10":"1","12":"1","6":"4","9":"4","11":"4"}))
y = y.translate(string.maketrans({"3":"1","5":"1","7":"1","8":"1","10":"1","12":"1","6":"4","9":"4","11":"4"}))

print("Yes" if x == y else "No")

Fixed submission:
import sys
x,y = list(input().split())
judge = 0
x = x.translate(str.maketrans({"3":"1","5":"1","7":"1","8":"1","6":"4","9":"4"}))
y = y.translate(str.maketrans({"3":"1","5":"1","7":"1","8":"1","6":"4","9":"4"}))
x = x.replace("10", "1").replace("12", "1").replace("11","4")
y = y.replace("10", "1").replace("12", "1").replace("11","4")

print("Yes" if x == y else "No")
Buggy python submission (verdict: Runtime Error):
import sys
a,b = list(map(int, input().split()))
print("H" if a == b else "D")

Fixed submission:
import sys
a,b = list(input().split())
print("H" if a == b else "D")
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <string>
#include <vector>
#include <string.h>
#include <algorithm>

using namespace std;


int main(){
  int n;
  cin >> k >> s;
  count=0;
  for(int x=0; x<<k+1; x++){
    for(int y=0; y<<k+1; y++){
      for(int z=0; z<<k+1; z++){
        if(x+y+z==s){
          count++;
        }
      }  
    }
  }
  cout << count << endl;
  return 0;
}


Fixed submission:
k,s= list(map(int, input().split()))
count=0
for x in range(k+1):
    for y in range(k+1):
            if 0<=s-x-y <=k:
                count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k,s= list(map(int, input().split()))
count=0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z==s:
                count+=1
print(count)

Fixed submission:
k,s= list(map(int, input().split()))
count=0
for x in range(k+1):
    for y in range(k+1):
            if 0<=s-x-y <=k:
                count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
k,s= list(map(int, input().split()))
count=0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z=s:
                count+=1
print(count)

Fixed submission:
k,s= list(map(int, input().split()))
count=0
for x in range(k+1):
    for y in range(k+1):
            if 0<=s-x-y <=k:
                count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
h,w = list(map(int, input().split()))
c = []
c.append([input() for _ in range(h)])

for i in range(h):
    print(c[i])
    print(c[i])

Fixed submission:
import sys
h,w = list(map(int, input().split()))
c = [input() for _ in range(h)]

for i in range(h):
    print(c[i])
    print(c[i])
Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int, input().split()))
print("A"+ b[0]+ "C")

Fixed submission:
a,b,c = input().split()
print("A"+ b[0]+ "C")
Buggy python submission (verdict: Runtime Error):
s = input()
ans = ""
for i in range(len(s)):
    if s[i] = "0":
        ans.append("0")
    elif s[i] = "1":
        ans.append("1")
    elif s[i] = "B":
        ans.rstrip()
print(ans)

Fixed submission:
s = input()
ans = ""
for i in range(len(s)):
    if s[i] == "0":
        ans = ans + "0"
    elif s[i] == "1":
        ans = ans + "1"
    elif s[i] == "B":
        ans = ans[:len(ans)-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    import fractions
    a, b, c = map(int, input().split())
    a = fractions.sqrt(a)
    b = fractions.sqrt(b)
    c = fractions.sqrt(c)

    if a+b<c:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import math
    a, b, c = map(int, input().split())
    # a = math.sqrt(a)
    # b = math.sqrt(b)
    # c = math.sqrt(c)
    # n = math.sqrt(a*b)

    if 4 * a*b < (c-a-b)**2 and c-a-b > 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math

def main():
    a, b = map(int, input().split())

    print(a*b//math.gcd(a, b))

if __name__ == '__main__':
    main()


Fixed submission:
import fractions

def main():
    a, b = map(int, input().split())

    print(a*b//fractions.gcd(a, b))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    input = sys.stdin.readline
    MAX = 10**9+7

    n = int(input())
    a = tuple(map(int, input().split()))

    dic = {key:0 for key in range(61)}
    for i in a:
        for ind, j in enumerate(bin(i)[:1:-1]):
            dic[ind] += int(j)

    ans = 0
    bit = 1
    for i in range(61):
        ans += bit * dic[i] * (n-dic[i])
        bit *= 2
    print(ans%MAX)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    input = sys.stdin.readline
    MAX = 10**9+7

    n = int(input())
    a = tuple(map(int, input().split()))

    li = [0]*61
    for i in a:
        for j in range(61):
            li[j] += i&1
            i >>= 1
    ans = 0
    bit = 1
    for i in li:
        ans += bit * i * (n-i)
        bit <<= 1
    print(ans%MAX)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    # input
    import sys
    input = sys.stdin.readline
    MAX = 10**9+7

    n = int(input())
    a = tuple(map(int, input().split()))

    li = [0]*61
    for i in a:
        for ind, j in enumerate(bin(i)[:1:-1]):
            li[ind] += int(j)

    ans = 0
    bit = 1
    for i in li:
        ans += bit * i * (n-i)
        bit *= 2
    print(ans%MAX)

    # calc



if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    input = sys.stdin.readline
    MAX = 10**9+7

    n = int(input())
    a = tuple(map(int, input().split()))

    li = [0]*61
    for i in a:
        for j in range(61):
            li[j] += i&1
            i >>= 1
    ans = 0
    bit = 1
    for i in li:
        ans += bit * i * (n-i)
        bit <<= 1
    print(ans%MAX)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    # input
    import sys
    input = sys.stdin.readline
    MAX = 10**9+7

    n = int(input())
    a = tuple(map(int, input().split()))
    ans = 0
    for first, i in enumerate(a[:n-1]):
        for j in a[first:n]:
            ans += i^j
    print(ans%MAX)



    # calc


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    input = sys.stdin.readline
    MAX = 10**9+7

    n = int(input())
    a = tuple(map(int, input().split()))

    li = [0]*61
    for i in a:
        for j in range(61):
            li[j] += i&1
            i >>= 1
    ans = 0
    bit = 1
    for i in li:
        ans += bit * i * (n-i)
        bit <<= 1
    print(ans%MAX)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    # input
    n = int(input())
    s = input()

    ans = 0
    for i in range(0, 1000):
        num = str(i)
        num = '0'*(3-len(num))+num
        index = 0
        for i in s:
            if index == 3:
                ans += 1
                break
            elif num[index]==i:
                index += 1
        else:
            if index == 3:
                ans += 1

    print(ans)

    # calc


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    # input
    m1, d1 = map(int, input().split())
    m2, d2 = map(int, input().split())

    if d2 == 1:
        print(1)
    else:
        print(0)

    # calc


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    # input
    n = int(input())
    s = input()

    ans = 0
    for i in range(0, 1000):
        num = str(i).rjust(3, '0')
        index = 0
        for i in s:
            if index == 3:
                ans += 1
                break
            elif num[index]==i:
                index += 1
        else:
            if index == 3:
                ans += 1

    print(ans)

    # calc


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    # input
    m1, d1 = map(int, input().split())
    m2, d2 = map(int, input().split())

    if d2 == 1:
        print(1)
    else:
        print(0)

    # calc


if __name__ == '__main__':
    main()