Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
input()
S=input()
k=int(input())
for s in S:print(s if s == S[k-1] else '*',sep='')


Fixed submission:
a,b,c=map(int,input().split())
print('Yes' if a<c<b or a>c>b else 'No')

Buggy python submission (verdict: Runtime Error):
input()
S=input()
k=int(input())
for s in S:print(s if s == S[k-1] else '*',end='')


Fixed submission:
a,b,c=map(int,input().split())
print('Yes' if a<c<b or a>c>b else 'No')

Buggy python submission (verdict: Runtime Error):
input()
S=input()
k=int(input())
for s in S:print(s if s == s[k+1] else '*',end='')


Fixed submission:
a,b,c=map(int,input().split())
print('Yes' if a<c<b or a>c>b else 'No')
Buggy python submission (verdict: Runtime Error):
input()
S=input()
k=int(input())
for s in S:print(s if s == S[k+1] else '*',end='')


Fixed submission:
n=int(input())
s=input()
k=int(input())
a=''
for i in range(n):
    if s[i] != s[k-1]:
        a+='*'
    else:
        a+=s[i]
print(a)

Buggy python submission (verdict: Runtime Error):
input()
s=input()
k=int(input())
for i in s:print(s if s[i] == s[k+1] else '*',end='')


Fixed submission:
n=int(input())
s=input()
k=int(input())
a=''
for i in range(n):
    if s[i] != s[k-1]:
        a+='*'
    else:
        a+=s[i]
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
for i in range(q):
    l,r=map(int,input().split())
    print(s[l-1:r].count('AC'))


Fixed submission:
n,q=map(int,input().split())
s=input()
count=[0]*n
for i in range(1,n):
    count[i]+=count[i-1]
    if s[i-1:i+1]=="AC":count[i]+=1
for i in range(q):
    l,r=map(int,input().split())
    print(count[r-1]-count[l-1])
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[]
for _ in range(n):
    k,*s=input().split()
    l+=s
se=set(l)
a=0
for i in se:
    c=l.count(i)
    if c==n:
        a+=1
print(a)


Fixed submission:
a,b=map(int,input().split())
print(b-a if b%a else a+b)
Buggy python submission (verdict: Runtime Error):
input()
L=list(map(int,input().split()))
print("Yes" if sum(L)>2*max(L) else "No")

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

Buggy python submission (verdict: Runtime Error):
input()
L=list(map(int,input().split()))
print("Yes" if sum(L)>2*max(L) else "No")

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

Buggy python submission (verdict: Runtime Error):
input()
L=list(map(int,input().split()))
print("Yes" if sum(L)>2*max(L) else "No")

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

Buggy python submission (verdict: Runtime Error):
input()
l=list(map(int,input().split()))
print('Yes' if sum(l) >2*max(l) else 'No')


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

Buggy python submission (verdict: Runtime Error):
input()
l=list(map(int,input().split()))
print('Yes' if 2*max(l)< sum(l) else 'No')


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

Buggy python submission (verdict: Runtime Error):
input()
l=list(map(int,input().split()))
print('Yes' if max(l)*2< sum(l) else 'No')


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

Buggy python submission (verdict: Runtime Error):
int(input())
l=list(map(int,input().split()))
print('Yes' if max(l)*2< sum(l) else 'No')


Fixed submission:
t,x = map(int,input().split())
print(t/x)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split())
l=[i for i in range(a,b+1) if i<a+k or i>b-k]
print(*l ,sep='\n')


Fixed submission:
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)
Buggy python submission (verdict: Runtime Error):
n=int(input())
b=[int(input()) for _ in range(n)]
m=int(input())
r=[int(input()) for _ in range(m)]
l=list(set(b))
a=[]
for s in l:
    a.append(b.count(s) - r.count(b))
print(max(max(a),0))


Fixed submission:
n=int(input())
b=[input() for _ in range(n)]
m=int(input())
r=[input() for _ in range(m)]
l=list(set(b))
a=[]
for s in l:
    a.append(b.count(s) - r.count(s))

print(max(max(a),0))
Buggy python submission (verdict: Time Limit Exceeded):
n,y=map(int,input().split())
an=-1,-1,-1
for m in range(n+1):
    for g in range(n+1):
        for s in range(n+1):
            if m+g+s == n and 10000*m+5000*g+1000*s ==y:
                print(m,g,s)
                exit(0)
print(*an)


Fixed submission:
n,y=map(int,input().split())
an=-1,-1,-1
for m in range(n+1):
    for g in range(n+1):
        s=n-m-g
        if m+g >n:
            break
        if m+g+s == n and 10000*m+5000*g+1000*s ==y:
            print(m,g,s)
            exit(0)

print(*an)
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = int(input())
print((n-1)*(m-1))


Fixed submission:
n,m = map(int,input().split())
print((n-1)*(m-1))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(m)]
l.sort(key=lambda l:(l[0]))
c=0
used=[]
def find_num(itr,target):
    for j in range(itr, m):
        if target in l[j]:
            next_target=[k for k in l[j] if k!=target][0]
            used.append(next_target)
            if len(used) == n:
                return True
            if find_num(j,next_target):
                return True
            else:
                return False
    return False

for i in range(m):
    used=[]
    if 1 in l[i]:
        used.append(1)
        next_target = [k for k in l[i] if k != 1][0]
        used.append(next_target)
        rtn=find_num(i, next_target)
        if rtn:
            c+=1
print(c)


Fixed submission:
import itertools
N,M=map(int,input().split())
edges={tuple(sorted(map(int,input().split()))) for i in range(M)}
ans=0
for i in itertools.permutations(range(2,N+1),N-1):
    l=[1]+list(i)
    ans+=sum(1 for edge in zip(l,l[1:]) if tuple(sorted(edge)) in edges)==N-1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
print([x+y+z for x in range(k+1) for y in range(k+1) for z in range(k+1)].count(s))


Fixed submission:
k,s=map(int,input().split())
print(len([1 for y in range(k+1) for z in range(k+1) if 0<=s-y-z<=k]))

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


Fixed submission:
k,s=map(int,input().split())
print(len([1 for y in range(k+1) for z in range(k+1) if 0<=s-y-z<=k]))
Buggy python submission (verdict: Runtime Error):
import math

n,d=map(int,input().split())
x=[]
for j in range(n):
tmp=list(map(int,input().split()))
x.append(tmp)

count=0
for i in range(n-1):
for j in range(i+1,n):
ans=0
for (a,b) in zip(x[i],x[j]):
ans+=(a-b)**2
if math.sqrt(ans).is_integer():
count+=1

print(count)

Fixed submission:
import math
 
n,d=map(int,input().split())
x=[]
for j in range(n):
	tmp=list(map(int,input().split()))
	x.append(tmp)
 
count=0
for i in range(n-1):
	for j in range(i+1,n):
		ans=0
		for (a,b) in zip(x[i],x[j]):
			ans+=(a-b)**2
		if math.sqrt(ans).is_integer():
			count+=1
 
print(count)
Buggy python submission (verdict: Runtime Error):
s=input()
count1=0
count2=0

char1=s[0]
count1+=1
if s[1]==char1:
    count1+=1
else :
    char2=s[1]
    count2+=1

if s[2]==char1:
    count1+=1
elif s[2]==char2:
    char2=s[2]
    count2+=1
else:
    print('No')
    exit()

if s[3]==char1:
    count1+=1
elif s[3]==char2:
    char2=s[3]
    count2+=1
else:
    print('No')
    exit

if count1==2 and count2==2:
    print('Yes')
else:
    print('No')


Fixed submission:
s=input()
count1=0
count2=0

char1=s[0]
char2='1'
count1+=1
if s[1]==char1:
    count1+=1
else :
    char2=s[1]
    count2+=1

if s[2]==char1:
    count1+=1
elif '1'==char2:
    char2=s[2]
    count2+=1
elif s[2]==char2:
    count2+=1

if s[3]==char1:
    count1+=1
elif '1'==char2:
    char2=s[3]
    count2+=1
elif s[3]==char2:
    count2+=1

if count1==2 and count2==2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))

d=0
for i in range(n+1):
    if d>x:
        break
    d=d+l[i]

print(i)


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

d=0
for i in range(n+1):
    if (i>n-1)and(d<=x):
        i+=1
        break
    if d>x:
        break
    d=d+l[i]

print(i)
Buggy python submission (verdict: Runtime Error):
a,p=int(input().split())
print((3*a+p)//2)

Fixed submission:
a,p=map(int,input().split())
print((3*a+p)//2)

Buggy python submission (verdict: Runtime Error):
a,p=input().split()
print((3*a+p)//2)

Fixed submission:
a,p=map(int,input().split())
print((3*a+p)//2)
Buggy python submission (verdict: Runtime Error):
r,D,x=map(int,input().split())
for i in range(10):
	x=r*x-D
    print(x)

Fixed submission:
r,D,x=map(int,input().split())
for i in range(10):
	x=r*x-D
	print(x)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
l=[]
h=[]
count=0
for i in range(m):
    a,b=map(int,input().split())
    l.append(a)
    h.append(b)

for i in range(n):
    judge=True
    for j in range(m):
        #if not (((i+1) >= l[j]) and ((i+1) <= h[j])):
        if not ((i+1) >= l[j] and (i+1) <= h[j]):
            judge^=True
            break
    if judge:
        count+=1

print(count)

Fixed submission:
n,m=map(int,input().split())
l=[]
h=[]
count=0
for i in range(m):
    a,b=map(int,input().split())
    l.append(a)
    h.append(b)

l_max=max(l)
h_min=min(h)
if (h_min-l_max)<0:
    print(0)
else:
    print(h_min-l_max+1)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
l=[]
h=[]
count=0
for i in range(m):
    a,b=map(int,input().split())
    l.append(a)
    h.append(b)

for i in range(n):
    judge=True
    for j in range(m):
        #if not (((i+1) >= l[j]) and ((i+1) <= h[j])):
        if not ((i+1) >= l[j] and (i+1) <= h[j]):
            judge^=True
            break
    if judge:
        count+=1

print(count)

Fixed submission:
n,m=map(int,input().split())
l=[]
h=[]
count=0
for i in range(m):
    a,b=map(int,input().split())
    l.append(a)
    h.append(b)

l_max=max(l)
h_min=min(h)
if (h_min-l_max)<0:
    print(0)
else:
    print(h_min-l_max+1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
v=list(map(int,input().split))
c=list(map(int,input().split))
ans=0
for i in range(n):
    if v[i]-c[i]>0:
        ans+=v[i]-c[i]

print(ans)



Fixed submission:
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=0
for i in range(n):
    if v[i]-c[i]>0:
        ans+=v[i]-c[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if A < B * 2:
    print(0)
else:
    print(A - 2*B)

Fixed submission:
A = list(map(int, input().split()))

if A[0] < A[1] * 2:
    print(0)
else:
    print(A[0] - 2*A[1])
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

n = int(input())
A = iarr()
s = set(A)
if sum(A)==2*sum(s): print(pow(2, l//2, int(1e9+7)))
else: print(0)


Fixed submission:
import numpy as np
import math
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

n = int(input())
A = iarr()
s = set(A)
if sum(A)==2*sum(s): print(pow(2, len(A)//2, int(1e9+7)))
else: print(0)
Buggy python submission (verdict: Runtime Error):
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const long double PI = (acos(-1));
#define rep(i, x, n) for (int i = x; i < (int)(n); i++)
#define sc(x) scanf("%d",&x)
#define scll(x) scanf("%lld",&x)
int main(){
    string s; cin >> s;
    int n = s.size(), p = 0, g = 0, ans = 0;
    rep(i, 0, n){
        if (s[i]=='p'){
            if (p < g) p++;
            else ans--, g++;
        }else {
            if (p < g) ans++, p++;
            else g++;
        }
    }
    cout << ans << endl;
    return 0;
}

Fixed submission:
import numpy as np
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

s = input()
p = g = ans = 0
for i in s:
    if i=='p':
        if p < g: p += 1
        else: ans -= 1; g += 1
    if i=='g':
        if p < g: ans += 1; p += 1
        else: g += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
l = len(ROOP)

num = (K-l-roopstart) % (l)
print(ROOP[num])

Fixed submission:
S = input()
T = input()
flag =0
for i in range(len(S)):
    if S[i] != T[i]:
        flag=1

if flag ==1:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
l = len(ROOP)

num = (K-l-roopstart) % (l)
print(ROOP[num])

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
l = len(ROOP)
if l != 0:
    num = (K-l-roopstart) % (l)
    print(ROOP[num])
else:
    print(node)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
sys.setrecursionlimit(20000000)
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
num = (K-len(ROOP)-roopstart) % (len(ROOP))
print(ROOP[num])

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
l = len(ROOP)
if l != 0:
    num = (K-l-roopstart) % (l)
    print(ROOP[num])
else:
    print(node)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
sys.setrecursionlimit(20000000)
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
num = (K-len(ROOP)-roopstart) % (len(ROOP))
print(ROOP[num])

Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
l = len(ROOP)
if l != 0:
    num = (K-l-roopstart) % (l)
    print(ROOP[num])
else:
    print(node)
Buggy python submission (verdict: Time Limit Exceeded):
N =int(input())
keihin =[]
ans = 0
for _ in range(N):
    S = input()
    if S in keihin:
        continue
    else:
        keihin.append(S)

print(len(keihin))

Fixed submission:
N =int(input())
keihin ={}
ans = 0
for _ in range(N):
    S = input()   
    keihin[S] = 1


print(sum(keihin.values()))

Buggy python submission (verdict: Time Limit Exceeded):
N =int(input())
keihin =[]
ans = 0
for _ in range(N):
    S = input()
    if S in keihin:
        continue
    else:
        keihin.append(S)
        ans+=1

print(ans)

Fixed submission:
N =int(input())
keihin ={}
ans = 0
for _ in range(N):
    S = input()   
    keihin[S] = 1


print(sum(keihin.values()))

Buggy python submission (verdict: Time Limit Exceeded):
N =int(input())
keihin =[]
ans = 0
for _ in range(N):
    S = input()
    if S in keihin:
        continue
    else:
        keihin.append(S)
        ans+=1

print(ans)
    

Fixed submission:
N =int(input())
keihin ={}
ans = 0
for _ in range(N):
    S = input()   
    keihin[S] = 1


print(sum(keihin.values()))
Buggy python submission (verdict: Runtime Error):
mport math
k = int(input())
ans = 0
for i in range(1, k + 1):
    for j in range(1, k + 1):
        gcd1 = math.gcd(i, j)
        for l in range(1, k + 1):
            gcd2 = math.gcd(gcd1, l)
            ans += gcd2
print(ans)

Fixed submission:
import math
k = int(input())
ans = 0
for i in range(1, k + 1):
    for j in range(1, k + 1):
        gcd1 = math.gcd(i, j)
        for l in range(1, k + 1):
            gcd2 = math.gcd(gcd1, l)
            ans += gcd2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd,numbers)
K = int(input())
ans= [[0 for i in range(K)] for j in range(K)]
answ=0
for i in range(1,K+1):
    for j in range(1,K+1):
        ans[i-1][j-1]+=gcd(i,j)

for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            answ+=gcd(ans[i-1][j-1],k)
print(answ)

Fixed submission:
import math
k = int(input())
ans = 0
for i in range(1, k + 1):
    for j in range(1, k + 1):
        gcd1 = math.gcd(i, j)
        for l in range(1, k + 1):
            gcd2 = math.gcd(gcd1, l)
            ans += gcd2
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
N = list(map(int,input().strip().split()))
sqrtA = math.sqrt(N[0])
sqrtB = math.sqrt(N[1])
sqrtC = math.sqrt(N[2])
def fl(x):
    digits = 10
    form = '%.'+str(digits-1)+'e'
    return float((form % x))

if fl(sqrtA) + fl(sqrtB) < fl(sqrtC):
    print("Yes")
if fl(sqrtA) + fl(sqrtB) >= fl(sqrtC):
    print("No")



Fixed submission:
k=input()
K=int(k)
array=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(array[K-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,A,B = map(int,input().split())

numlist=[]

while len(numlist) <=N:
    for i in range(A):
        numlist.append(1)
    for i in range(B):
        numlist.append(0)
ans= 0
for i in range(N):
    if numlist[i] == 1:
        ans +=1
    else:
        continue
print(ans)

Fixed submission:
N,A,B = map(int,input().split())

a = N//(A+B)
b = N%(A+B)

if b>A:
    print(a*A+A)
else:
    print(a*A+b)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
l = []
for _ in range(N):
    s = input()
    l.append(s)
c = collections.Counter(l)
i=0
j=0
ans=[]
while True:
    ans.append(c.most_common()[i][0])
    if i+1<len(c.most_common()):
        if c.most_common()[i+1][1] == c.most_common()[i][1]:
            i+=1
            continue
        else:
            break
    else:
        break
ans.sort()
for _ in range(len(ans)):
    print(ans[_])

Fixed submission:
from collections import defaultdict
N = int(input())
touhyou = defaultdict(int)
for _ in range(N):
    s = input()
    touhyou[s] +=1
touhyou1=dict(sorted(touhyou.items(),key = lambda x: x[1],reverse = True))
maxn=max(touhyou1.values())
ans=[]
for key,val in zip(touhyou1.keys(),touhyou1.values()):
    if val == maxn:
        ans.append(key)

ans=sorted(ans)

for i in range(len(ans)):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()


ans =0

for i in range(10):
    if str(i) in s:
        t = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in s:
                u = t[t.index(str(j))+1:]
                for k in range(10):
                    if str(k) in u:
                        ans += 1
print(ans)


Fixed submission:
n = int(input())
s = input()
ans =0
for i in range(10):
    if str(i) in s:
        t = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in t:
                u = t[t.index(str(j))+1:]
                for k in range(10):
                    if str(k) in u:
                        ans += 1
print(ans)

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


ans =0

for i in range(10):
    if str(i) in s:
        t = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in s:
                u = t[t.index(str(j))+1:]
                for k in range(10):
                    if str(k) in u:
                        ans += 1
print(ans)


Fixed submission:
n = int(input())
s = input()
ans =0
for i in range(10):
    if str(i) in s:
        t = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in t:
                u = t[t.index(str(j))+1:]
                for k in range(10):
                    if str(k) in u:
                        ans += 1
print(ans)

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


ans =0

for i in range(10):
    if str(i) in s:
        t = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in s:
                u = t[t.index(str(j))+1:]
                for k in range(10):
                    if str(k) in u:
                        ans += 1
print(ans)


Fixed submission:
n = int(input())
s = input()
ans =0
for i in range(10):
    if str(i) in s:
        t = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in t:
                u = t[t.index(str(j))+1:]
                for k in range(10):
                    if str(k) in u:
                        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
D,G = map(int,input().split())
P=[]
C=[]
for _ in range(D):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c)
anss=2**10
for i in range(1 << D):
    ans = 0
    summ = 0
    nokori = set(range(1,D+1))
    for j in range(D):
        if 1 & (i >> j):
            summ += P[j]*100*(j+1)+C[j]
            ans += P[j]
            nokori.discard(j+1)
    if summ < G:
        use = max(nokori)
        n = min(P[use-1],-((G-summ)//(100*use)))
        ans += n
        summ += n* use* 100

    if summ < G:
        summ+=C[use-1]

    if summ >= G:
        anss =min(ans,anss)
        
print(anss

Fixed submission:
d,g = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(d)]

ans = float("inf")


for bit in range(1<<d):
    count = 0
    sum = 0
    nokori = set(range(1,d+1))

    for i in range(d):
        if bit & (1<<i):
            sum +=pc[i][0]*(i+1)*100+pc[i][1]
            count +=pc[i][0]
            nokori.discard(i+1)



    if sum < g:
        use = max(nokori)
        n = min(pc[use-1][0],-(-(g-sum)//(use*100)))
        count += n
        sum += n*use *100

    if sum >= g:
        ans = min(ans,count)
print(ans)