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

Fixed submission:
a,b,c,k=map(int,input().split())
ai=0
bi=0
ci=0
if a >= k:
  ai=k
else:
  ai=a
  if b>= k-ai:
    bi=k-ai
  else:
    bi=b
    ci= k - ai - bi
print(ai-ci)

Buggy submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
ai=0
bi=0
ci=0
if a >= k:
  ai=k
else:
  ai=a
  if b>= k-ai:
    bi=k-ai
    else:
      bi=b
      ci= k - ai - bi
print(ai-ci)
Problem p02701 (python)

Fixed submission:
n=int(input())
a=[]
for _ in range(n):
  a.append(input())
as_=set(a)
print(len(as_))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
for _ in range(n):
  a.append(input())
as=set(a)
print(len(as))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
for _ in range(n):
  a.append(input())
as=set(a)
print(len(a))
Problem p02785 (python)

Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)

if k>n:
  k=n

for i in range(k):
  h[i]=0

sum_=0
for hh in h:
  sum_+=hh
print(sum_)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)

if k>n:
  k=n

for i in range(k):
  h[i]=0

sum_=0
for hh in range(h):
  sum_+=hh
print(sum_)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)

for i in range(k):
  h[i]=0

sum_=0
for hh in h:
  sum_+=hh
print(sum_)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)

for i in range(k):
  h[i]=0

sum_=0
for hh in range(h):
  sum_+=hh
print(sum_)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)

for i in range(k):
  h[i]=0

print(sum(h))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)
if k > 0:
  for i in range(k):
    h[i]=0
print(sum(h))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)
for i in range(k):
  h[i]=0
print(sum(h))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)
for i in range(k):
  h[i]=0
print(sum(h))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))

h.sort(reverse=True)
for i in range(k):
  h[i]=0
print(sum(h))
Problem p02819 (python)

Fixed submission:
def is_prime(n):
  if n == 1:
    return True
  for i in range(2,int(n**0.5) + 1):
    if n % i == 0:
      return False
  return True

x=int(input())
while True:
  if is_prime(x)==True:
    break
  x+=1
print(x)

Buggy submission (verdict: Runtime Error):
x=int(input())
from sympy import nextprime
print(nextprime(x))
Problem p02829 (python)

Fixed submission:
a=int(input())
b=int(input())
c=[1,2,3]
c.pop(c.index(a))
c.pop(c.index(b))
print(c[0])

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=[1,2,3]
c.pop(a)
c.pop(b)
print(c[0])

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=list(1,2,3)
c.pop(a)
c.pop(b)
print(c[0])
Problem p02881 (python)

Fixed submission:
n=int(input())
import math
ans=10**12
i=0
while i*i<=n:
  i+=1
  if n%i!=0:
    continue
  j=n/i
  ans=min(ans, i+j-2)
if ans ==10**12:
  print(n-1)
else:
  print(int(ans))

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors



n=int(input())


l=list(make_divisors(n))

l.sort()

for i,ll in enumerate(l):
  if i!=len(l)-1 and ll*l[i+1]==n:
    ans=ll+l[i+1]-2
if n==1:
  print(0)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
def get_divisors(n):
    if n < 1:
        return
    i = 1
    while i * i <= n:
        if n % i == 0:
            yield i
            if i * i != n:
                yield round(n / i)
        i = i + 1



n=int(input())


l=list(get_divisors(n))

l.sort()

for i,ll in enumerate(l):
  if i!=len(l)-1 and ll*l[i+1]==n:
    ans=ll+l[i+1]-2
if n==1:
  print(0)
else:
  print(ans)
Problem p02594 (python)

Fixed submission:
x = int(input())
if x>=30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
x = int(input())
if x>=30:
  print(Yes)
else:
  print(No)
Problem p02819 (python)

Fixed submission:
import math
x = int(input())
ans =x

for j in range(x,2*x):
  flag=1
  for i in range(2,int(math.sqrt(x))+1):
    if x%i==0:
      flag=0
  if flag==1:
    print(x)
    exit(0)
  x+=1

Buggy submission (verdict: Runtime Error):
import math
x = int(input())
ans =x
while True:
  for i in range(2,math.sqrt(x)+1):
    if x%i=0:
      print(x)
      exit()
  x+=1
Problem p02572 (python)

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

B = [0]*N

num = 0
for i in reversed(range(N)):
    B[i] = A[i] + num
    num = B[i]
    
ans = 0
for i in range(N-1):
    ans += A[i]*B[i+1] %1000000007

print(ans%1000000007)

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))

B = [0]*N

num = 0
for i in reversed(range(N)):
    B[i] = A[i] + num
    num = B[i]
    
ans = 0
for i in range(N-1):
    ans += A[i]*B[i+1] 

print(ans%1000000007)
Problem p02629 (python)

Fixed submission:
n=int(input())
ans=""
while n>0:
    n-=1
    ans+=chr(ord('a')+n%26)
    n//=26
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=""
while n>0:
    n-=1
    ans+=chr(ord('a')+N%26)
    n//=26
    print(ans[::-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=""
while N>0:
    n-=1
    ans+=chr(ord('a')+N%26)
    n//=26
    print(ans[::-1])
Problem p02753 (python)

Fixed submission:
S = input()
print('Yes' if S != 'AAA' and S != 'BBB' else 'No')

Buggy submission (verdict: Runtime Error):
print('Yes' if S != 'AAA' and S != 'BBB' else 'No')
Problem p03013 (python)

Fixed submission:
from collections import defaultdict

N, M = map(int, input().split())
a = defaultdict(lambda: True)
for i in range(M):
    a[int(input())] = False

dp = defaultdict(int)
dp[0] = 1
for i in range(1, N + 1):
    if a[i]:
        dp[i] = dp[i - 1] + dp[i - 2]
print(dp[N] % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
MOD = 10 ** 9 + 7

N, M = map(int, input().split())
a = [-1] + [int(input()) for i in range(M)] + [N + 1]

factorial = {0: 1}
f = 1
for i in range(1, N):
    f *= i
    factorial[i] = f

c = {}
def nCr(n, r):
    if (n, r) in c:
        return c[(n, r)]
    a = factorial[n] // (factorial[n - r] * factorial[r])
    c[(n, r)] = a
    return a

d = {}
def step(n):
    if n in d:
        return d[n]
    a = 0
    for k in range(n // 2 + 1):
        a += nCr(n - k, k)
    d[n] = a
    return a

ans = 1
for i in range(M + 1):
    n = a[i + 1] - a[i] - 2
    if n < 0:
        ans = 0
    else:
        ans *= step(n)
print(ans % MOD)
Problem p03221 (python)

Fixed submission:
from collections import defaultdict

N, M = map(int, input().split())
years = defaultdict(list)
Q = []
for i in range(M):
    P, Y = map(int, input().split())
    years[P].append(Y)
    Q.append((P, Y))

rev_list = {}
for P, Y in years.items():
    Y.sort()
    rev_list[P] = {}
    for i in range(len(Y)):
        rev_list[P][Y[i]] = i + 1

for q in Q:
    print('{:06}{:06}'.format(q[0], rev_list[q[0]][q[1]]))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
N, M = map(int, input().split())
cities = []
prefs = defaultdict(list)
for i in range(M):
    city = tuple(map(int, input().split()))
    cities.append(city)
    prefs[city[0]].append(city[1])

for pref in prefs.values():
    pref.sort()
for c in cities:
    x = prefs[c[0]].index(c[1]) + 1
    print(f'{c[0]:06}{x:06}')
Problem p03803 (python)

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

a = 14 if A == 1 else A
b = 14 if B == 1 else B
print('Alice' if a > b else 'Bob' if a < b else 'Draw')

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())

a = 14 if A == 1 else A
b = 14 if b == 1 else B
print('Alice' if a > b else 'Bob' if a < b else 'Draw')
Problem p02793 (python)

Fixed submission:
import fractions
from functools import reduce

MOD = 10**9 + 7


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0


def modinv(a, m):
    g, x, y = xgcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m


def main():
    N = int(input())
    AN = list(map(int, input().split()))

    AN_lcm = lcm_list(AN) % MOD

    ans = 0
    for A in AN:
        ans += AN_lcm * modinv(A, MOD)
        ans %= MOD

    print(ans)


main()

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce

MOD = 10**9 + 7


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def main():
    N = int(input())
    AN = list(map(int, input().split()))

    AN_lcm = lcm_list(AN)

    ans = 0
    for A in AN:
        ans += round(AN_lcm * pow(A, -1))
        ans %= MOD

    print(ans)


main()

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce

MOD = 10**9 + 7


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def main():
    N = int(input())
    AN = list(map(int, input().split()))

    AN_lcm = lcm_list(AN)

    ans = 0
    for A in AN:
        ans += round(AN_lcm * pow(A, -1))
        ans %= MOD

    print(ans)


main()
Problem p02881 (python)

Fixed submission:
import math

N=int(input())

ans=999999999999
for i in range(1,int(math.sqrt(N))+1):
  if N % i == 0:
    ans = min(ans,i + N//i - 2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N=int(input())

ans=999999999999
for i in range(1,math.sqrt(N)+1):
  if N % i == 0:
    ans = min(ans,i + N//i - 2)
print(ans)
Problem p03329 (python)

Fixed submission:
def main():
    N = int(input())

    dp = [999999999999 for _ in range(N + 1)]
    dp[0] = 0

    for n in range(1, N + 1):
        # 1 yen
        dp[n] = min(dp[n], dp[n - 1] + 1)

        # 6 yen
        i = 6
        while i <= n:
            dp[n] = min(dp[n], dp[n - i] + 1)
            i *= 6

        # 9 yen
        i = 9
        while i <= n:
            dp[n] = min(dp[n], dp[n - i] + 1)
            i *= 9

    print(dp[N])


main()

Buggy submission (verdict: Runtime Error):
import itertools

N_MAX = 100000
INF = float('inf')

n = int(input().rstrip())

dp = [INF for _ in range(N_MAX)]
dp[0] = 0
dp[1] = 1
dp[6] = 1
dp[9] = 1

for i in range(1, n + 1):

    # [1, 6, 36, ...]
    for j in itertools.takewhile(lambda x: x < N_MAX,
                                 (6 ** c for c in itertools.count())):
        dp[i] = min(dp[i], dp[i - j] + 1)

    # [1, 9, 81, ...]s
    for j in itertools.takewhile(lambda x: x < N_MAX,
                                 (9 ** c for c in itertools.count())):
        dp[i] = min(dp[i], dp[i - j] + 1)

print(dp[n])
Problem p02753 (python)

Fixed submission:
s = input()

if s == 'AAA' or s == 'BBB':
    print('No')
else:
    print('Yes')

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

f = n // (a+b)
g = n % (a+b)

if g <= a:
    print(a * f + g)
    
else:
    print(a * (f+1))
Problem p02759 (python)

Fixed submission:
n = int(input())

print((n + 1) // 2)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())

a = [input().split() for i in range(m)]

s = []
c = []

for i in range(m):
    s.append(a[i][0])
    c.append(a[i][1])

S = [int(i) for i in s]
C = [int(i) for i in c]

x = 0
z = 0

for i in range(m):
    x += C[i] * (10 ** (n-S[i]))
    for k in range(m):
        if n >= 2 and S[i] == 1 and C[i] == 0:
            z += 1
            break
        if S[i] == S[k] and C[i] != C[k]:
            z += 1
            break
        if S[i] == S[k] and C[i] == C[k] and i > k:
            x -= C[i] * (10 ** (n-S[i]))
            break

if z == 0:
    if '1' in S or m == 0:
        print(x)
    else:
        print(x+10**(n-1))

else:
    print('-1')
Problem p02835 (python)

Fixed submission:
a = input()
b = a.split()

if int(b[0]) + int(b[1]) + int(b[2]) >= 22:
    print('bust')
    
else:
    print('win')

Buggy submission (verdict: Runtime Error):
A = list((int(input().split())))
 
if sum(A) > 21:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
 = input()
b = a.split()

if int(b[0]) + int(b[1]) + int(b[2]) >= 22:
    print("bust")
    
else:
    print("win")
Problem p02659 (python)

Fixed submission:
a,b = input().split()
a = int(a);
b = list(b.split("."))
b = int(b[0])*100+int(b[1])
print(a*b//100)

Buggy submission (verdict: Runtime Error):
//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
#include<bits/stdc++.h>
using namespace std;int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding  cin.tie(0);
#define F first
#define S second
#define mp make_pair
#define ll long long
#define Pi atan(1)*4
#define pb  push_back
#define vpr vector<pr> 
#define pr pair<int, int> 
#define vi std::vector<int>
#define vll std::vector<ll>
#define YES printf("YES\n");
#define NO printf("NO\n");
#define Yes printf("Yes\n");
#define No printf("No\n");
#define all(n) n.begin(),n.end()
#define point(x) setprecision(x)
#define Test printf("Case %d: ",tc++);
#define Unique(c) (c).resize(unique(all(c))-(c).begin())
#define vout(v) for (auto z: v) cout << z << " "; cout << endl;

const int M = 1e9 + 7;
const ll  Inf = (ll)2e18 + 5;
const int N   = 2e5 + 5;
ll vis[N],res[N];

int solve() 
{
	//happy coding

	 ll n;cin>>n;
	 string s; cin>>s;
	 ll idx = find(all(s),'.') - s.begin();
	 ll a = stoi(s.substr(0,idx));
	 ll b = stoi(s.substr(idx+1));
	 ll mn = a*100+b;
	 cout<<(mn*n)/100<<endl;
	
	return 0;
}
int main(){
	int test = 1;
	//scanf("%d", &test);
	while (test--)solve();return 0;
}
Problem p02847 (python)

Fixed submission:
weekday = {0:'SUN', 1:'MON', 2:'TUE', 3:'WED', 4:'THU', 5:'FRI', 6:'SAT'}
s=input()
for i in range(0, 7):
    if (weekday[i] == s):
        print(7-i)

Buggy submission (verdict: Runtime Error):
a,b,x = list(map(int,input().split()))

if(x<a+b):
    print(0)
    exit()

# 桁数を求める
r=0
s=0
j=0
for i in range(10):
    j+=1         # Nの桁数
    r=10**i      # j桁の最小整数
    s=a*r+b*j
    if(s>x):
        break    # j桁の最小数がxを超えた

# Nはj-1桁
j=j-1

xr = x - b*j
n = xr // a
if (n>10**9):
    n=10**9

#print('j: {}'.format(j))

print(n)
Problem p03013 (python)

Fixed submission:
def readinput():
    n,m=list(map(int,input().split()))
    a=[]
    for _ in range(m):
        a.append(int(input()))
    return n,a

def main(n,a):
    MOD=10**9+7

    nroute=[0]*(n+2)
    nroute[0]=0
    nroute[1]=1
    nroute[2]=1
    for i in range(3,n+2):
        nroute[i]=(nroute[i-1]+nroute[i-2])%MOD
    #print(nroute)
    
    subn=[]
    i=0
    for j in a:
        subn.append((i,j-1))
        i=j+1
    subn.append((i,n))
    #print(subn)

    nways=1
    for i,j in subn:
        l=j-i+1
        nways=nways*nroute[l]%MOD

    return nways

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)

Buggy submission (verdict: Runtime Error):
def readinput():
    n,m=list(map(int,input().split()))
    a=[]
    for _ in range(m):
        a.append(int(input()))
    return n,a

def main(n,a):
    nroute=[0]*(n+1)
    nroute[0]=0
    nroute[1]=1
    nroute[2]=1
    for i in range(3,n+1):
        nroute[i]=nroute[i-1]+nroute[i-2]
    #print(nroute)
    
    subn=[]
    i=0
    for j in a:
        subn.append((i,j-1))
        i=j+1
    subn.append((i,n))
    #print(subn)

    MOD=10**9+7
    nways=1
    for i,j in subn:
        l=j-i+1
        nways=nways*nroute[l]%MOD

    return nways

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)

Buggy submission (verdict: Runtime Error):
def readinput():
    n,m=list(map(int,input().split()))
    a=[]
    for _ in range(m):
        a.append(int(input()))
    return n,a

def main(n,a):
    nroute=[0]*(n+1)
    nroute[0]=0
    nroute[1]=1
    nroute[2]=1
    for i in range(3,n+1):
        nroute[i]=nroute[i-1]+nroute[i-2]
    #print(nroute)
    
    subn=[]
    i=0
    for j in a:
        subn.append((i,j-1))
        i=j+1
    subn.append((i,n))
    #print(subn)

    MOD=10**9+7
    nways=1
    for i,j in subn:
        l=j-i+1
        nways=nways*nroute[l]%MOD

    return nways

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)
Problem p02711 (python)

Fixed submission:
n=str(input())
a=0
for i in range(len(n)):
    if int(n[i])==7:
        a=1
        break
if a==1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=str(input())
a=0
for i in range(len(n)):
	if int(n[i])==7:
		a=1
        break
if a==1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=str(input())
a=0
for i in range(len(a)):
	if int(n[i])==7:
		a=1
        break
if a==1:
  print('Yes')
else:
  print('No')
Problem p02596 (python)

Fixed submission:
k = int(input())
x = 7%k
s = []

for i in range(k):
  if x == 0:
    print(i+1)
    exit()
  s.append(x)
  x = (10*x + 7)%k

  
  
print(-1)

Buggy submission (verdict: Runtime Error):
k = int(input())
x = 7%k
s = []

for i in range(k):
  if x == 0:
    print(len(i+1))
    exit()
  s.append(x)
  x = (10*x + 7)%k

  
  
print(-1)

Buggy submission (verdict: Runtime Error):
k = int(input())
x = 7%k
s = []

for i in range(k):
  if x == 0:
    print(len(s+1))
    exit()
  s.append(x)
  x = (10*x + 7)%k

  
  
print(-1)

Buggy submission (verdict: Runtime Error):
k = int(input())
x = 7%k
s = []

while x not in s:
  if x == 0:
    print(len(s+1))
    break
  s.append(x)
  x = (10*x + 7)%k

  
if s[-1] != 0:
  print(-1)

Buggy submission (verdict: Runtime Error):
k = int(input())
x = 7%k
s = set()
while s.count(x) == 0:
  s.append(x)
  x = (10*x + 7)%k

if s[-1] == 0:
  print(len(s))
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
k = int(input())
x = 7%k
s = set()
while s.count(x) == 0:
  s.append(x)
  x = (10*x + 7)
Problem p02597 (python)

Fixed submission:
n = int(input())
c = list(input())#ciが R のとき赤、W のとき白
a = c.count("R")
b = 0
count = max(a, b)
# a: R->W, b: W->Rの回数
for i in range(n):
  if c[i] == "R":
    a = a - 1
  else:
    b = b + 1
  ans = max(a, b)
  count = min(ans, count)
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = list(input())#ciが R のとき赤、W のとき白
a = c.count("R")
b = 0
count = max(a, b)
# a: R->W, b: W->Rの回数
for i in range(n+1):
  if c[i] == "R":
    a = a - 1
  else:
    b = b + 1
  ans = max(a, b)
  count = min(ans, count)
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = list(input())#ciが R のとき赤、W のとき白
count = n
a = c.count("R")
b = 0
ans = max(a, b)
count = min(ans, count)
# a: R->W, b: W->Rの回数
for i in range(n+1):
  if c[i] == "R":
    a = a - 1
  else:
    b = b + 1
  ans = max(a, b)
  count = min(ans, count)
print(count)
Problem p02627 (python)

Fixed submission:
a=input()
if a.islower()==True:
  print("a")
else:
  print("A")

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

from scipy.special import comb


def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

print(num2alpha(n).lower())
Problem p03775 (python)

Fixed submission:
n = int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

sosu = make_divisors(n)
#print(type(sosu))
kumi = []
for i in range(len(sosu)):
  for j in range(len(sosu)):
    #print(type(sosu[i]))
    if sosu[i]*sosu[j] == n:
      kumi.append([str(sosu[i]), str(sosu[j])])
#print(kumi)
top = 10000000000
#iter = 0
#if 
for i in kumi[:int(len(kumi)/2)+2]:
  sums = max(len(i[0]), len(i[1]))
  if top > sums:
    top = sums
    #iter = max(len(kumi[0]), len(kumi[1]))
print(top)

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

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

sosu = make_divisors(n)
#print(type(sosu))
kumi = []
for i in range(len(sosu)):
  for j in range(len(sosu)):
    #print(type(sosu[i]))
    if sosu[i]*sosu[j] == n:
      kumi.append([str(sosu[i]), str(sosu[j])])
if len(kumi)%2 == 0:
  print(len(min(kumi[len(kumi)/2])))
else:
  print(len(min(kumi[round(len(kumi)/2)])))
Problem p02552 (python)

Fixed submission:
x = int(input())
if x==1:
    print("0")
else:
    print("1")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
if a >=0:
    if c > 0:
        print(b * d)
    elif d < 0:
        print(a * d)
    else:
        print(b*d)
else:
    if c > 0:
        print(b * c)
    elif d < 0:
        print(a * c)
    else:
        print(b * c)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
if a >=0:
    if c > 0:
        print(b * d)
    elif d < 0:
        print(a * d)
    else:
        print(b*d)
else:
    if c > 0:
        print(b * c)
    elif d < 0:
        print(a * c)
    else:
        print(b * c)
Problem p02570 (python)

Fixed submission:
d, t, s = input().split()
if int(s) * int(t) >= int(d):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
d, t, s = input().split()
if int(s) * int(t) >= d:
    print("Yes")
else:
    print("No")
Problem p02835 (python)

Fixed submission:
a, b, c = [int(x) for x in input().split()]
if a + b + c >= 22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
if (a+b+c)>=22:
    print('bust')
else:
    print('win')
Problem p02598 (python)

Fixed submission:
from math import *

def trycut(val):
	ret = 0
	for i in range(n):
		ret += ceil(a[i]/val)-1
	return ret 

n,k=map(int,input().split())
a = [int(i) for i in input().split()]

low = 0
high = 1000000000
ans  =-1

while low <= high:
	mid = (low + high)/2
	cut = trycut(mid)
	# ~ print("low=",low, "high=", high,"val = ",mid,"ret = ",cut)
	if cut <= k:
		high = mid-0.0000001
		ans = mid
	else:
		low =  mid+0.0000001
	# ~ if low < high: print(low, high, "je reviens")
ans = int(ans*1000000)/1000000
# ~ print(ans)
print(int(ceil(ans)))

Buggy submission (verdict: Runtime Error):
from math import *

def trycut(val):
	ret = 0
	for i in range(n):
		ret += ceil(a[i]/val)-1
	return ret 

n,k=map(int,input().split())
a = [int(i) for i in input().split()]

low = 0
high = 1000000000
ans  =-1

while low <= high:
	mid = (low + high)//2
	cut = trycut(mid)
	if cut <= k:
		high = mid-1
		ans = mid
	else:
		low =  mid+1
print(ans)
Problem p02707 (python)

Fixed submission:
n=int(input())
t = [0]*(n+1)
A = [int(i) for i in input().split()]
for i in range(n-1):
	t[A[i]]+=1
for i in range(1,n+1):
	print(t[i])

Buggy submission (verdict: Runtime Error):
n=int(input())
t= [0]*(n+1)
l=[int(i) for i in input().split()]
for i in range(2, n+1):
  t[l[i]]+=1
for i in range(1,n+1):
  print(t[i])