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

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
w = [int(x) for x in stdin.readline().rstrip().split()]

m = sum(w)

for i in range(n):
    w1 = w[:i]
    w2 = w[i:]
    wm = abs(sum(w1) - sum(w2))
    if wm < m:
        m = wm

print(m)

Buggy submission (verdict: Runtime Error):
from sys import stdin

n = int(stdin.readline().rstrip())
w = [int(x) for x in stdin.readline().rstrip().split()]

ave = sum(w)/len(w)
w1 = [w.pop(0)]
while sum(w1)/len(w1) <= ave:
    w1.append(w.pop(0))

print(abs(sum(w1) - sum(w)))
Problem p03835 (python)

Fixed submission:
K, S = map(int, input().split())

ANS = 0

for x in range(K + 1):
    for y in range(K + 1):
        z = S - x - y
        if (0 <= z) and z <= K:
            ANS += 1

print(ANS)

Buggy submission (verdict: Runtime Error):
K, S = map(int, input().split())

ANS = 0

for x in range(K + 1):
    for y in rage(K + 1):
        z = S - x - y
        if (0 <= z) and z <= K:
            ANS += 1

print(ANS)
Problem p02659 (python)

Fixed submission:
from math import floor
from fractions import Fraction
a, b = input().split()
a = int(a)
b = Fraction(b)
print(floor(a * b))

Buggy submission (verdict: Runtime Error):
from fractions import Fraction
a,b=input().split()
A=float(a)
B=Fraction(b)
print(floor(A*B))

Buggy submission (verdict: Runtime Error):
from fractions import Fraction
a,b=input().split()
A=float(a)
B=Fraction(b)
print(int(a*b))

Buggy submission (verdict: Runtime Error):
a,b=input().split()
A=int(a)
B=float(100*b)
ans=A*B/100
print(int(ans))

Buggy submission (verdict: Runtime Error):
a,b=input().split()
A=int(a)
B=float(b)
ans=a*(b*100)/100
print(int(ans))

Buggy submission (verdict: Runtime Error):
a,b=input().split()
A=int(a)
B=float(b)
print(A*B*100)/100

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(int(a*b))
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())
if S <= W:
  print('unsafe')
  
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
S, W = map(int, input().split())
if S =< W:
  print('unsafe')
  
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
S = input()
W = input()
if int(S) =< int(W):
  print('unsafe')
  
else: 
  print('safe)

Buggy submission (verdict: Runtime Error):
if S =< W :
  print('unsafe')
 
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
if int('S') =< int('W') :
  print('unsafe')
 
else:
  print('safe')
Problem p02701 (python)

Fixed submission:
n= int(input())
s=[]
for i in range(n):
  s.append(input())
  
print(len(set(s)))

Buggy submission (verdict: Runtime Error):
n= input()
s=[]
for i in range(n):
  s.append(input())
  
print(set(s))

Buggy submission (verdict: Runtime Error):
n= int(input())
s=[]
for i in range(n):
  s.append(int(input()))
  
print(set(s))
Problem p02723 (python)

Fixed submission:
s =list(input())
if s[2] == s[3] and s[4] == s[5]:
  print("Yes")
  
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s =input()
if s[2] == s[3] and s[4] == s[5]:
  print("Yes")
  
else:
  print"No")

Buggy submission (verdict: Runtime Error):
s = list(input())
if s[2] == s[3] and s[4] == s[5]:
  print("Yes")
  
else:
  print"No")

Buggy submission (verdict: Runtime Error):
s = list(input())
if s[2] = s[3] and s[4] = s[5]:
  print("Yes")
  
else:
  print"No")
Problem p02779 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
A=set(a)
if len(a)==len(A):
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for i in range(n)]
if len(a)==len(set(a)):
  print('Yes')
else:
  print('No')
Problem p02836 (python)

Fixed submission:
def resolve():
    S = input()
    s = len(S)
    count = 0
    if s%2 == 0:
        for i in range(s//2):
            if S[i] != S[(i+1)*-1]:
                count += 1
    else:
        for i in range((s-1)//2):
            if S[i] != S[(i+1)*-1]:
                count += 1
    print(count)
resolve()

Buggy submission (verdict: Runtime Error):
s=list(input())
if len(s)%2==0:
  c=len(s)/2
  d=i*(-1)-1
  sum=0
  for i in range(c):
    if s[i]!=s[d]:
      sum+=1
  print(sum)
else:
  sum2=0
  e=(len(s)-1)/2
  f=i*(-1)-1
  for i in range(e):
    if s[i]!=s[f]:
      sum2+=1
  print(sum2)
Problem p02860 (python)

Fixed submission:
n=int(input())
s=list(input())
Len=int(len(s)/2)
if len(s)%2==1:
  print('No')
else:
  for i in range(Len):
    if s[i]!=s[i+Len]:
      print('No')
      exit()
  print('Yes')

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input())
Len=len(s)/2
if len(s)%2==1:
  print('No')
else:
  for i in range(Len):
    if s[i]!=s[i+Len]:
      print('No')
      break
  print('Yes')
Problem p02879 (python)

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

if a<10 and b<10:
  print(a*b)
  
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a<10 and b<10:
  print(a*b)

  
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a<10 and b<10:
  print(a*b)
  
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a<10 and b<10:
  print(a*b)
  
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
if a<10 and b<10:
  print(a*b)
  
else:
  print('-1')
Problem p02912 (python)

Fixed submission:
from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = [-1*int(i) for i in input().split()]
heapify(A)

for i in range(M):
    n = -1 * heappop(A)
    heappush(A, -1*(n//2))

print(-1*sum(A))

Buggy submission (verdict: Runtime Error):
import math
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
for i in ragne(m):
  c=math.floor(max(a)/2)
  a.remove(a[-1])
  a.append(c)
  a.sort()
 
sum=0
for i in range(n):
  sum+=a[i]
  
print(sum)
Problem p02989 (python)

Fixed submission:
n=int(input())
d=list(map(int,input().split()))
d.sort()
m=int(n/2)
ans=d[m]-d[m-1]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int,input().split()))
d.sort()
ans=d[m]-d[m-1]
print(ans+1)
Problem p03208 (python)

Fixed submission:
n, k=map(int,input().split())
a=[int(input()) for i in range(n)]
a.sort()
b=[]
for p in range(n-k+1):
  c=a[p+k-1]-a[p]
  b.append(c)
  
print(min(b))

Buggy submission (verdict: Runtime Error):
n, k=map(int,input().split())
a=[input() for i in range(n)]
a.sort()
b=[]
for p in range(n-k):
  c=a[p+k]-a[p]
  b.append(c)
  
print(min(b))
Problem p03345 (python)

Fixed submission:
a,b,c,k=map(int,input().split())
if a-b>10**18:
  print("Unfair")
else:
  if k%2==0:
    print(a-b)
  else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
if a-b>10**18:
  print("Unfair")
else:
  if k%2=1:
    print(a-b)
  else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
if a-b>10**8:
  print("Unfair")
else:
  print(a-b if k%2=1 else b-a)
Problem p02693 (python)

Fixed submission:
K = int(input())
a,b = map(int, input().split())
for n in range(a, b + 1):
  if n % K == 0:
    print('OK')
    exit()
print('NG')

Buggy submission (verdict: Runtime Error):
k,a,b=map(int,input().split())
for i in range (a,b):
    if k//i==0:
        print('ok')
        break
    else:
        print('ng')
        break
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
 
if w >= s:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
S=int(input())
W=int(input())
if W>=(S):
    print('Unsafe')
else:
    print('Safe')
Problem p02629 (python)

Fixed submission:
a = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
r = 26
d = 1
while n-r > 0:
    n -= r
    r *= 26
    d += 1
n -= 1
name = ''
for i in range(d):
    if n >= 26:
        name = a[n % 26]+name
        n //= 26
    elif n > 0:
        name = a[n]+name
        n = 0
    else:
        name = a[n]+name
print(name)

Buggy submission (verdict: Runtime Error):
n=int(input())
a='abcdefghijjklmnopqrstuvwxyz'
name=''
while n>=26:
  name.append(a[n%26])
  n//=26
name.append(a[n])
print(name)

Buggy submission (verdict: Runtime Error):
a='abcdefghijklmnopqrstuvwxyz'
out=''
n=int(input())
while n>26:
  out=a[n%26+1]+out
  n//=26
print(out)
Problem p02659 (python)

Fixed submission:
#!/usr/bin/python

import sys
import math 

#Input Functions
#===============

input = sys.stdin.readline

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))

#===============

def run_test() :
    (a, b) = map(float, input().split())
    a = int(a)
    b = int(b * 100 + 0.5)
    a *= b
    a //= 100
    print(int(a))

def main() :
	run_test()

if __name__ == '__main__' :
	main()

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi; 
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;

#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ini(a, i) memset(a, i, sizeof(a))
#define contains(i, c) ((c).find(i) != (c).end())

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i <= n; i++)
#define repa(i, a, b) for(int i = (a); i < (b); i++)
#define repd(i, n) for(int i = (n)-1; i >= 0; i--)

#define TRACE(x...) x
#define watch(x) TRACE(cerr << #x" = " << x << endl)
#define watch_all(x) TRACE(cerr << #x" = "; for(auto __i : x) cerr << __i << " "; cerr << endl)

//=========================

typedef unsigned long long ull;

void run_test() {
	ull a; double _b;
	cin >> a >> _b;
	ull b = _b * 100;
	ull ans = a * b / 100;	
	cout << ans << endl;
}

//=========================

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	//int t = 1, _t; cin >> _t; while(t <= _t) { cout << "Case #" << t++ << ": "; run_test(); }
	//int t; cin >> t; while(t--) run_test();
	run_test();
	return 0;	
}
Problem p02771 (python)

Fixed submission:
a,b,c = map(int,input().split(" "))
if (a == b and a == c) or (a != b and b != c and c!= a):
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
 
s = list(map(int,input().split(" ")))
 
count = 0
for x in range(n):
  if s[x]%2 == 0 and (s[x]%5 != 0 and s[x]%3 != 0):
    count += 1
    
if count == 0:
  print("APPROVED")
else:
  print("DENIED")

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

s = list(map(int,input().split(" ")))
 
count = 0
for x in range(n):
  print(s[x])
  if s[x]%2 == 0 and (s[x]%5 != 0 and s[x]%3 != 0):
    count += 1
    
if count == 0:
  print("APPROVED")
else:
  print("DENIED")
Problem p02623 (python)

Fixed submission:
from itertools import accumulate

N, M, K = map(int, input().split())
A = list(accumulate(int(i) for i in input().split()))
B = list(accumulate(int(i) for i in input().split()))

a,b = [0],[0]
for ai in A:
    a.append(ai)
for bj in B:
    b.append(bj)

cnt = 0
best0 = M
for i in range(N+1):
   ai = a[i]
   for j in range(best0, -1, -1):
       bj = b[j]
       if ai + bj <= K:
           cnt = max(cnt, i + j)
           best0 = j
           break

print(cnt)

Buggy submission (verdict: Runtime Error):
from itertools import accumulate

N, M, K = map(int, input().split())
a = list(accumulate(int(i) for i in input().split(), initial=0))
b = list(accumulate(int(i) for i in input().split(), initial=0))

cnt = 0
best0 = M
for i in range(N+1):
    ai = a[i]
    for j in range(best0, -1, -1):
        bj = b[j]
        if ai + bj <= K:
            cnt = max(cnt, i + j)
            best0 = j
            break

print(cnt)
Problem p02629 (python)

Fixed submission:
import string

N = int(input()) - 1
smap = dict(enumerate(string.ascii_lowercase))

res = []
while True:
    d, m = divmod(N, 26)
    res.append(m)
    if d-1 > 25:
        N = d-1
    else:
        if d == 0:
            break
        else:
            res.append(d-1)
            break

print("".join(smap[i] for i in reversed(res)))

Buggy submission (verdict: Runtime Error):
import string

N = int(input())

res = []
while True:
    d, m = divmod(N, 26)
    res.append(m)
    if d < 26:
        if d != 0:
            res.append(d)
        break
    else:
        N = d

smap = dict(enumerate(string.ascii_lowercase, 1))
print("".join(smap[a] for a in reversed(res)))
Problem p02729 (python)

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

def factorial(n):
    p = 1
    for i in range(n, 0, -1):
        p *= i
    return p


def comb(n, k):
    return factorial(n) // (factorial(k) * factorial(n-k))


res = comb(M, 2) + comb(N, 2)

print(res)

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

N, M = map(int, input().split())

def comb(n, k):
    return int(factorial(n) / factorial(k) / factorial(n-k))

res = comb(M, 2) + comb(N, 2)

print(res)
Problem p02912 (python)

Fixed submission:
import heapq

n, m = map(int, input().split(" "))

a = [- int(i) for i in input().split(" ")]
heapq.heapify(a)

for _ in range(m):
    largest = heapq.heappop(a)
    heapq.heappush(a, int(largest / 2))

print(- sum(a))

Buggy submission (verdict: Runtime Error):
import heapq

n, m = map(int, input().split(" "))

a = list(map(int, input().split(" ")))
heapq._heapify_max(a)

for _ in range(m):
    largest = heapq._heappop_max(a)
    heapq.heappush(a, largest // 2)

print(sum(a))
Problem p02832 (python)

Fixed submission:
n = input()
renga = list(map(int, input().split(" ")))

ni = 1
remains = 0

for r in renga:
    if ni == r:
        ni += 1
        remains += 1
if ni == 1:
    print(-1)
else:
    print(len(renga) - remains)

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

ni = 1
remains = 0

for r in renga:
    if ni == r:
        ni += 1
        remains += 1
if ni == 1:
    print(-1)
else:
    print(renga - remains)
Problem p02682 (python)

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

if A >= K:
  print(K)
elif A + B >= K:
  print(A)
else:
  print(A - (K - A - B))

Buggy submission (verdict: Runtime Error):
A, B, C, K = int(input()), int(input()), int(input()), int(input())

if A >= K:
  print(K)
elif A + B >= K:
  print(A)
else:
  print(A - (K - A - B))
Problem p02689 (python)

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

H = list(map(int, input().split()))
H.insert(0, 0)

V = [list(map(int, input().split())) for i in range(M)]

count = 0

dic = {}

for i in range(1, N+1):
  dic[i] = set()

for hen in V:
  dic[hen[0]].add(hen[1])
  dic[hen[1]].add(hen[0])

print(sum(all([H[i] > H[hs] for hs in dic[i]]) for i in range(1, N+1)))

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())

H = list(map(int, input().split()))

V = [list(map(int, input().split())) for i in range(M)]

count = 0

dic = {}

for i in range(1, N):
  dic[i] = set()

for hen in V:
  dic[hen[0]].add(hen[1])
  dic[hen[1]].add(hen[0])

print(sum(all([H[i] > hs for hs in dic[i]]) for i in range(N)))

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())

H = list(map(int, input().split()))

V = [list(map(int, input().split())) for i in range(M)]

count = 0

dic = {}

for i in range(1, N):
  dic[i] = set()

for hen in V:
  dic[hen[0]].add(hen[1])
  dic[hen[1]].add(hen[0])

print(sum(all([H[i] > hs for hs in dic[i]]) for i in N))

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())

H = [int(input()) for i in range(N)]

V = [list(map(int, input().split())) for i in range(M)]

count = 0

dic = {}

for i in range(1, N):
  dic[i] = set()

for hen in V:
  dic[hen[0]].add(hen[1])
  dic[hen[1]].add(hen[0])

print(sum(all([H[i] > hs for hs in dic[i]]) for i in N))
Problem p02693 (python)

Fixed submission:
import sys

K = int(input())
A, B = map(int, input().split())

for i in range(A, B + 1):
  if i % K == 0:
    print('OK')
    sys.exit()
	
print('NG')

Buggy submission (verdict: Runtime Error):
import sys

K = input()
A, B = map(int, input().split())

for i in range(A, B + 1):
  if i % K == 0:
    print('OK')
    sys.exit()
	
print('NG')

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

for i in range(A, B + 1):
  if i % K == 0:
    print('OK')
    exit()
	
print('NG')
Problem p02833 (python)

Fixed submission:
N = int(input())

if N % 2 != 0:
    print('0')
else:
    count = 0
    i = 1

    while True:
        dif = (N // 2) // (5 ** i)
        count += dif
        if dif == 0:
            break

        i += 1

    print(count)

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

if N % 2 != 0:
    print('0')
else:
    count = 0
    i = 1
    while True:
        dif = (N // 2) // (5 ** i)
        count += dif
        if dif == 0:
            break

        i += 1

print(count)
Problem p02915 (python)

Fixed submission:
N = int(input())
print(N ** 3)

Buggy submission (verdict: Runtime Error):
N = input()
print(N ** 3)
Problem p02916 (python)

Fixed submission:
N = int(input())
A = [-1]
A.extend(list(map(int, input().split()))) # たべた料理
B = [-1]
B.extend(list(map(int, input().split()))) # 料理の満足度
C = [-1]
C.extend(list(map(int, input().split()))) # i -> i+1ボーナス

manzoku = 0

for i in range(1, N+1):
    manzoku += B[A[i]]
    if A[i-1] + 1 == A[i]:
        manzoku += C[A[i-1]]

print(manzoku)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [-1].extend(list(map(int, input().split()))) # たべた料理
B = [-1].extend(list(map(int, input().split()))) # 料理の満足度
C = [-1].extend(list(map(int, input().split()))) # i -> i+1ボーナス

manzoku = 0

for i in range(1, N+1):
  manzoku += B[A[i]]
  if A[i-1] + 1 == A[i]:
    manzoku += C[A[i-1]]

print(manzoku)
Problem p02711 (python)

Fixed submission:
N = input()

count = N.count('7')
if count >= 1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = input()
if N in 7:
  print('Yes')
else:
  print('No')
Problem p03013 (python)

Fixed submission:
MOD = 10 ** 9 + 7

N, M = map(int, input().split())

broken = [False for _ in range(N+1)]
for _ in range(M):
	broken[int(input())] = True

dp = [0 for _ in range(N + 1)]
dp[0] = 1
if(broken[1] == False):
  dp[1] = 1

for i in range(2, N+1):
	if broken[i]:
		continue
	else:
		dp[i] = dp[i-1] + dp[i-2]
		dp[i] %= MOD
print(dp[N])

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

N, M = map(int, input().split())

broken = [False for _ in range(N+1)]
for _ in range(M):
	broken[int(input())] = True

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

for i in range(1, N+1):
	if broken[i]:
		continue
  elif i == 1:
    dp[i] = dp[i-1]
	else:
		dp[i] = dp[i-1] + dp[i-2]
		dp[i] %= MOD
print(dp[N])

Buggy submission (verdict: Runtime Error):
MOD = 10 ** 9 + 7
N, M = map(int, input().split())
a = []
for i in range(M):
  a.append(int(input()))
broken = [False for _ in range(N+1)]

dp = [0 for _ in range(N + 1)]
dp[0] = 1
for _ in range(M):
	broken[int(input())] = True
for i in range(1, N+1):
	if broken[i]:
		continue
	if i == 1:
		dp[i] = dp[i-1]
	else:
		dp[i] = dp[i-1] + dp[i-2]
		dp[i] %= MOD
print(dp[N])
Problem p03041 (python)

Fixed submission:
N, K = map(int, input().split())
S = input()
print(S[:K-1] + S[K-1].lower() + S[K:])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()
if S[K - 1] == 'A':
  S[K - 1] = 'a'
elif S[K - 1] == 'B':
  S[K - 1] = 'b'
else:
  S[K - 1] = 'c'
print(S)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()
if S[K + 1] == 'A':
  S[K + 1] = 'a'
elif S[K + 1] == 'B':
  S[K + 1] = 'b'
else:
  S[K + 1] = 'c'
print(S)
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a <= k:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a <= k:
  print('Yey)
else:
  print(':)')

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
neck = int(input())
for i in range(N-1):
  neck = min(neck, int(input()))
res = math.ceil(N/neck)
print(res)
Problem p03077 (python)

Fixed submission:
import math
N = int(input())
neck = int(input())
for i in range(4):
  neck = min(neck, int(input()))
res = math.ceil(N/neck)
print(res + 4)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
neck = int(input())
for i in range(N-1):
  neck = min(neck, int(input()))
res = math.ceil(N/neck)
print(res + 4)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
neck = int(input())
for i in range(N-1):
  neck = min(min, int(input()))
res = math.ceil(N/neck)
print(res)
Problem p02629 (python)

Fixed submission:
n=int(input())
s='zabcdefghijklmnopqrstuvwxy'
a=''
while(int(n)>0):
        t=n%26
        if t==0:
            n-=26
        a=s[t]+a
        n=n//26
print(a)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
a=[]
y=math.ceil(math.log(((n*25)/26)+1,26))
for i in range(y):
    a.append(n%(26**(i+1)))
    if(n%(26**(i+1))!=0):
       n=n-n%(26**(i+1))
    else:
        n=n-26**(i+1)
a.reverse()
#print(a,y)
q=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']    
for i in range(y):
    print(q[a[i]-1],end="")

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
a=[]
y=math.log(((n*25)/26)+1,26)
#print(y)
if(y%1==0):
    print('z'*int(y))
else:
  y=math.ceil(y)
  for i in range(y):
    a.append(n%(26**(i+1)))
#print(a)
  for i in range(y):
       a[i]=a[i]//(26**(i))
  a.reverse()
#print(a,y)
  q=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']    
  for i in range(y+1):
    print(q[a[i]-1],end="")

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
a=[]
y=math.log(((n*25)/26)+1,26)
#print(y)
if(y%1==0):
    print('z'*int(y))
else:
  for i in range(y):
    a.append(n%(26**(i+1)))
#print(a)
  for i in range(y):
       a[i]=a[i]//(26**(i))
  a.reverse()
#print(a,y)
  q=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']    
  for i in range(y+1):
    print(q[a[i]-1],end="")
Problem p03803 (python)

Fixed submission:
A,B=map(int,input().split())
if (B==1 and A!=1) or(A!=1 and B>A):
  print("Bob")
elif (A==1 and B!=1) or B<A:
  print("Alice")
elif A==B:
  print("Draw")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if (B==1 and A!=1) or B>A:
  print("Bob")
elif (A==1 and B!=1) or B<A:
  print("Alice")
elif A==B:
  print(Draw)
Problem p03041 (python)

Fixed submission:
N,K= map(int, input().split())
S = list(str(input()))

S[K-1] = S[K-1].lower()
print(''.join(S))

Buggy submission (verdict: Runtime Error):
 N,K= map(int, input().split())
 S = list(str(input()))

 S[K-1] = S[K-1].lower()
 print(''.join(S))
Problem p03127 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

ans = A[0]

for a in A:
  ans = gcd(ans,a)

print(ans)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
A = [int(i) for i in input().split()]

ans = A[0]

for a in A:
  ans = math.gcd(ans,a)

print(ans)