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

Fixed submission:
def main():
    from collections import deque, defaultdict
    n, m = map(int, input().split())
    g = [[] for _ in range(n + 1)]
    ref = defaultdict(list)
    q = deque([])
    visited = set()
    inf = 10 ** 10
    dist = [-inf] * (n + 1)

    for i in range(m):
        a, b, k = map(int, input().split())
        g[a].append(b)
        g[b].append(a)
        ref[(a, b)] = k


    def dfs(u):
        q.append(u)
        while q:
            v = q.pop()
            visited.add(v)
            for x in g[v]:
                if x not in visited:
                    if ref[(v, x)] != []:
                        y = ref.get((v, x))
                        if dist[x] == -inf:
                            dist[x] = dist[v] + y
                        elif dist[x] != dist[v] + y:
                            print("No")
                            exit()
                    else:
                        y = ref.get((x, v))
                        if dist[x] == -inf:
                            dist[x] = dist[v] - y
                        elif dist[v] != dist[x] + y:
                            print("No")
                            exit()
                    q.append(x)


    for i in range(1, n + 1):
        if i not in visited:
            dist[i] = 1
            dfs(i)
    print("Yes")
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    from collections import deque, defaultdict
    n, m = map(int, input().split())
    g = [[] for _ in range(n + 1)]
    ref = defaultdict(list)
    sta = 0

    for i in range(m):
        a, b, k = map(int, input().split())
        if i == 0:
            sta = a
        g[a].append(b)
        g[b].append(a)
        ref[(a, b)] = k

    q = deque([sta])
    visited = set()
    dist = [0] * (n + 1)
    dist[sta] = 1

    while q:
        v = q.pop()
        visited.add(v)
        for x in g[v]:
            if x not in visited:
                if ref[(v, x)]:
                    y = ref[(v, x)]
                    if not dist[x]:
                        dist[x] = dist[v] + y
                    elif not dist[v]:
                        dist[v] = dist[x] - y
                    elif dist[x] != dist[v] + y:
                        print("No")
                        exit()
                else:
                    y = ref[(x, v)]
                    if not dist[v]:
                        dist[v] = dist[x] + y
                    elif not dist[x]:
                        dist[x] = dist[v] - y
                    elif dist[v] != dist[x] + y:
                        print("No")
                        exit()
                q.append(x)
    print("Yes")
if __name__ == '__main__':
    main()
Problem p03497 (python)

Fixed submission:
from collections import Counter

n, m = map(int, input().split())
dic = Counter(map(int, input().split()))
lis = sorted(dic.items(), key=lambda x: x[1], reverse=True)

res = 0
for i, x in enumerate(lis):
    if i < m:
        continue
    else:
       res += x[1]
print(res)

Buggy submission (verdict: Runtime Error):
from collections import Counter

n, m = map(int, input().split())
dic = Counter(map(int, input().split()))
lis = sorted(dic.items(), key=lambda x: x[1], reverse=True)

res = 0
for i in range(m):
    res += lis[i][1]
print(n - res)
Problem p03559 (python)

Fixed submission:
import bisect
import sys
readline = sys.stdin.buffer.readline


def main():
    n = int(readline())
    a = list(map(int,readline().rsplit()))
    b = list(map(int,readline().rsplit()))
    c = list(map(int,readline().rsplit()))
    a.sort()
    c.sort()
    ans = 0
    for i in b:
        d = bisect.bisect_left(a, i)
        e = len(c) - bisect.bisect_right(c, i)
        ans += d * e
    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import bisect
import sys
readline = sys.stdin.buffer.readline


def main():
    n = int(readline())
    a = list(map(int,readline().rsplit()))
    b = list(map(int,readline().rsplit()))
    c = list(map(int,readline().rsplit()))
    as = sorted(a)
    cs = sorted(C)
    ans = 0
    for i in b:
        d = bisect.bisect_left(as, i)
        e = n - bisect.bisect_right(cs, i)
        ans += d * e
    print(ans)

if __name__ == '__main__':
    main()
Problem p03601 (python)

Fixed submission:
import bisect
a, b, c, d, e, f = map(int, input().split())
a = a * 100
b = b * 100
g = f * e // 100
wtr = [0] * f
sgr = [0] * g
wtr[0] = 1
sgr[0] = 1
wtr_l = []
sgr_l = []


def comb(lmt, tgt, lis):
    for i in range(lmt - tgt):
        if lis[i] != 0:
            lis[i + tgt] = 1


comb(f, a, wtr)
comb(f, b, wtr)
comb(g, c, sgr)
comb(g, d, sgr)

for i, w in enumerate(wtr):
    if i == 0:
        continue
    elif w == 1:
        wtr_l.append(i)

for j, s in enumerate(sgr):
    if s == 1:
        sgr_l.append(j)

res = -1
ans = []
for wt in wtr_l:
    pct = min(f - wt, wt * e // 100)
    sid = bisect.bisect_left(sgr_l, pct)
    if pct in sgr_l:
        sgr_max = sgr_l[sid]
    else:
        sgr_max = sgr_l[sid - 1]
    pct_max = 100 * sgr_max / (wt + sgr_max)
    if pct_max > res:
        res = pct_max
        ans.append((wt + sgr_max, sgr_max))
print(*ans[-1])

Buggy submission (verdict: Runtime Error):
import bisect
a, b, c, d, e, f = map(int, input().split())
a = a * 100
b = b * 100
g = f * e // 100
wtr = [0] * f
sgr = [0] * g
wtr[0] = 1
sgr[0] = 1
wtr_l = []
sgr_l = []


def comb(lmt, tgt, lis):
    for i in range(lmt - tgt):
        if lis[i] != 0:
            lis[i + tgt] = 1


comb(f, a, wtr)
comb(f, b, wtr)
comb(g, c, sgr)
comb(g, d, sgr)

for i, w in enumerate(wtr):
    if i == 0:
        continue
    elif w == 1:
        wtr_l.append(i)

for j, s in enumerate(sgr):
    if j == 0:
        continue
    elif s == 1:
        sgr_l.append(j)

res = 0
ans = []
for wt in wtr_l:
    pct = min(f - wt, wt * e // 100)
    sid = bisect.bisect_left(sgr_l, pct)
    if pct in sgr_l:
        sgr_max = sgr_l[sid]
    else:
        sgr_max = sgr_l[sid - 1]
    pct_max = 100 * sgr_max / (wt + sgr_max)
    if pct_max > res:
        res = pct_max
        ans.append((wt + sgr_max, sgr_max))
print(*ans[-1])
Problem p03763 (python)

Fixed submission:
from collections import Counter

n = int(input())
letters = [input() for _ in range(n)]

cnt = Counter(letters[0])

for i in range(1,n):
    cnt = cnt & Counter(letters[i])

int_list = sorted(cnt.items(), key=lambda x:x[0])

ans = ""
for key, val in int_list:
    ans += key*val
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
letters = [input() for _ in range(n)]

common = []

for item in letters[0]:
    if item in letters[1] and item in letters[2]:
        common.append(item)

if common == []:
    print()
else:
    b = sorted(common)
    ans = ""
    for i in range(n):
        ans = ans + b[i]
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
letters = [input() for _ in range(n)]

common = []

for item in letters[0]:
    if item in letters[1] and item in letters[2]:
        common.append(item)

b = sorted(common)

ans = ""

for i in range(n):
    ans = ans + b[i]

print(ans)
Problem p03352 (python)

Fixed submission:
n=(int)(input())
ans =1
for i in range(n):
  for j in range(n):
    p=j+2
    if i**p <=n:
      ans=max(ans,i**p)
    else:
      break
print(ans)

Buggy submission (verdict: Runtime Error):
n =(int)(input().split())
ans=0
for i in range(n):
  if i*i <= n:
    ans =i
print(ans)

Buggy submission (verdict: Runtime Error):
n =map(int,input().split())
ans=0
for i in range(n):
  if i*i <= n:
    ans =i
print(ans)
Problem p03679 (python)

Fixed submission:
a,b,c = map(int,input().split())
if(c-b>a): 
  print("dangerous")
elif(c-b<=0): 
  print("delicious")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if(c-b>a): print("dangerous")
else if(c-b<=0): print("delicious")
else : print("safe")
Problem p03862 (python)

Fixed submission:
n,x =map(int,input().split())
a=[int(x) for x in input().split()]
ans=0
for i in range(n-1):
  if(a[i]+a[i+1]>x):
    p = a[i]+a[i+1]-x
    ans+=p
    a[i+1]=max(0,a[i+1]-p)
print(ans)

Buggy submission (verdict: Runtime Error):
n,x =map(int,input().split())
a=[map(int,input().split())]
ans=0
for i in range(n-1):
  if(a[i]+a[i+1]>x):
    p = a[i]+a[i+1]-x
    ans+=p
    a[i+1]=max(0,a[i+1]-p)
print(ans)
Problem p02747 (python)

Fixed submission:
S = input()

flag = True

if len(S) % 2 == 0:
    if S.find('hi') % 2 == 0:
        flag = True
    else:
        flag = False
else:
    flag = False


if flag == True:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input()

flag = True
for i in range(0, 11, 2):#len(S), 2):
    if len(S) % 2 == 0:
        if S[i] + S[i + 1] == 'hi':
            if i + 2 == len(S):
                break
            else:
                pass
    else:
        if S[i] + S[i + 1] == 'hi':
           pass
        if i + 1 == len(S):
            flag = False
            break
        else:
            flag = False
            break

if flag == True:
    print('Yes')
else:
    print('No')
Problem p02608 (python)

Fixed submission:
N = int(input())
zeros = [0 for i in range(10050)]
for x in range(1,105):
    for y in range(1,105):
        for z in range(1,105):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n < 10050:
                zeros[n]+=1

for i in range(N):
    print(zeros[i+1])

Buggy submission (verdict: Runtime Error):
N = int(input())
zeros = [0 for i in range(10000)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n < 10000:
                zeros[n]+=1

for i in range(N):
    print(zeros[i+1])
Problem p02612 (python)

Fixed submission:
N = int(input())
final = 1000 - N%1000
if final == 1000:
    print(0)
else:
    print(final)

Buggy submission (verdict: Runtime Error):
N = input()
final = 1000 - N%1000
if final == 1000:
    print(0)
else:
    print(final)
Problem p02621 (python)

Fixed submission:
a = input()
first_a = int(a)
second_a = int(a)**2
third_a = int(a)**3
sum_a = first_a + second_a + third_a
print(sum_a)

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int,input().split()))
a,b = [0],[0]
for i in range(N):
    a.append(a[i] + A[i])
    
for i in range(M):
    b.append(b[i] + B[i])
totaltime = 0
count,j = 0, M
 
for i in range(N+1):
    if a[i] > K:
        break
    while a[i] + b[j] > K:
        j -= 1
    count = max(count,i + j)
 
print(count)

Buggy submission (verdict: Runtime Error):
a = input()
first_a = a
second_a = a**2
third_a = a**3
sum_a = first_a + second_a+third_a
Problem p03455 (python)

Fixed submission:
a, b = map(int,input().split())
 
ans = a * b
 
if ans % 2 == 1:
  print("Odd")
else:
  print("Even")

Buggy submission (verdict: Runtime Error):
a, b = int(input()),int(input())
 
ans = a * b
 
if ans % 2 == 1:
  print("Odd")
else:
  print("Even")

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

ans = a * b

if ans % 2 == 1:
	print("Odd")
else:
	print("Even")
Problem p02609 (python)

Fixed submission:
N = int(input())
X = input()
x = X[::-1]
one = X.count('1')
up = 0
down = 0
for i in range(N):
    up += (int(x[i]) * pow(2,i,one+1) % (one+1))
    up %= one+1
    if one > 1:
        down += (int(x[i]) * pow(2,i,one-1) % (one-1))
        down %= one-1
# print(up,down)
def f(ud,one):
    if one <= 0:
        return 0
    else:
        if ud == 0:
            return 1

        cnt = 0
        while ud != 0:
            ud = ud % one
            one = format(ud,'b').count('1')
            cnt += 1
        return cnt



for i in range(len(X)):
    if X[i] == '1':
        if one > 1:
            print(f((down - pow(2,(len(X)-1) - i, one-1)) % (one-1),one-1))
        #print(down - pow(2,(len(X)-1) - i, one-1) % (one-1))
        else:
            print(0)

    else:
        print(f((up + pow(2,(len(X)-1) - i, one+1)) % (one+1),one+1))
        #print(up + pow(2,(len(X)-1) - i, one+1) % (one+1))

Buggy submission (verdict: Runtime Error):
N = int(input())
X = input()
x = X[::-1]
one = X.count('1')
up = 0
down = 0
for i in range(N):
    up += (int(x[i]) * pow(2,i,one+1) % (one+1))
    up %= one+1
    if one > 1:
        down += (int(x[i]) * pow(2,i,one-1) % (one-1))
        down %= one-1
# print(up,down)
def f(ud,one):
    if one <= 0:
        return 0
    else:
        if ud == 0:
            return 1

        cnt = 0
        while ud != 0:
            ud = ud % one
            one = format(ud,'b').count('1')
            cnt += 1
        return cnt



for i in range(len(X)):
    if X[i] == '1':
        print(f((down - pow(2,(len(X)-1) - i, one-1)) % (one-1),one-1))
        #print(down - pow(2,(len(X)-1) - i, one-1) % (one-1))
    else:
        print(f((up + pow(2,(len(X)-1) - i, one+1)) % (one+1),one+1))
        #print(up + pow(2,(len(X)-1) - i, one+1) % (one+1))
Problem p02663 (python)

Fixed submission:
h1,m1,h2,m2,k = map(int, input().split())
m1 += h1*60
m2 += h2 * 60
val = m2 - m1
val -= k
print(max(0,int(val)))

Buggy submission (verdict: Runtime Error):
h1,m1,h2,m2,k = map(int, input().split())
h1 += m1/60
h2 += m2/60
val = h2-h1
val *= 60
val -= k
print(max(0,int(val))
Problem p02664 (python)

Fixed submission:
t = list(input())
for i in range(len(t)):
    if t[i] == "?":
        t[i] = "D"
print("".join(t))

Buggy submission (verdict: Runtime Error):
t = list(input())
if t[0] == "?":
    if t[1] == "P":
        t[0] = "D"
    else:
        t[0] == "P"
for i in range(1,len(t)):
    if t[i] == "?":
        if t[i-1] == "P":
            t[i] = "D"
        else:
            t[i] = "P"
print("".join(t))
Problem p02665 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if n == 0 and a[0] == 0:
    print(-1)
    exit()
if n != 0 and a[0] >= 1:
    print(-1)
    exit()
if n == 0 and a[0] >= 2:
    print(-1)
    exit()
ar = list(reversed(a))
#print(ar)
com = [ar[0]]
for i in range(n):
    com.append(com[i] + ar[i+1])
#print(com)
com.reverse()
ans = 1
val = 1
for i in range(1,n+1):
    val *= 2
    ans += min(val,com[i])
    val -= a[i]
    if (i < n and val <= 0) or (i == n and val < 0):
        print(-1)
        exit()
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
if n == 0 and a[0] == 0:
    print(-1)
    exit()
if n != 0 and a[0] >= 1:
    print(-1)
    exit()
val = 1
ans = 1
vlis = []
for i in range(n):
    ans += val * 2
    val *= 2
    val -= a[i+1]
    if val < 0:
        print(-1)
        exit()
    if val == 0 and i != (n-1):
        print(-1)
        exit()
    vlis.append(val-a[i+1])
val3 = (vlis[-2] - a[-2])
val -= val3
if val//2 > vlis[-2]:
    print(-1)
    exit()
ans -= val//2
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
if n == 0 and a[0] == 0:
    print(-1)
    exit()
if n != 0 and a[0] >= 1:
    print(-1)
    exit()
val = 1
ans = 1
for i in range(n):
    ans += val * 2
    val *= 2
    val -= a[i+1]
    if val < 0:
        print(-1)
        exit()
    if val == 0 and i != (n-1):
        print(-1)
        exit()
    if i == n-2:
        val2 = val
val3 = (val2 - a[-2])
val -= val3
if val//2 > val2:
    print(-1)
    exit()
ans -= val//2
print(ans)
Problem p02719 (python)

Fixed submission:
n, k = map(int, input().split())
val = n//k
print(min(n%k,abs(n-(k*val + k)),n))

Buggy submission (verdict: Runtime Error):
from math import ceil
n, k = map(int, input().split())
val = abs(ceil(n/k)
print(min(n%k,abs(n-(k*val)),n))
Problem p02768 (python)

Fixed submission:
n, a, b = map(int, input().split())
m = int(1e9) + 7
ans = (pow(2, n, m) -1) % m
val = 1
val2 = 1
for i in range(a):
    val = (val * (n - i)) % m
    val2 = (val2 * (i + 1)) % m
ans -= ((val % m) * (pow(val2, m-2, m)))
#print(((val % m) * (pow(val2, m-2, m))))
ans %= m
val = 1
val2 = 1
for i in range(b):
    val = (val * (n - i)) % m
    val2 = (val2 * (i + 1)) % m
ans -= ((val % m) * (pow(val2, m-2, m)))
#print(((val % m) * (pow(val2, m-2, m))))
print(ans % (int(1e9) + 7))

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 2 ** n -1
val = 1
for i in range(a):
    val *= (n-i) / (i+1)
ans -= val
val = 1
for i in range(b):
    val *= (n-i) / (i+1)
ans -= val
print(int(ans % (int(1e9) + 7)))

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 2 ** n -1
val = 1
for i in range(a):
    val *= (n-i) / (i+1)
ans -= val
val = 1
for i in range(b):
    val *= (n-i) / (i+1)
ans -= val
print(int(ans % int(1e9) + 7))
Problem p02780 (python)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int,input().split()))
val = 0
atai = 0
val2 = 0
for i in range(k):
    val2 += p[i]
#print(val2)
val = val2
for i in range(k,n):
    if val < val2:
        val = val2
        atai = i-k+1
    #print(i,p[i],p[i-k])
    val2 += p[i]
    if i==k:
        val2 == 0
    else:
        val2 -= p[i-k]
    #print(val2)
    if val < val2:
        val = val2

        atai = i-k+1
#print(atai)

#print(atai)
ans = 0
for i in range(k):
    ans += (p[atai]+1)/2
    atai += 1
    #print(atai)
    #print(kitai)
print(ans)

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

val = 0
for i in range(k):
    val += p[i]
point = k-1

cnt = val
for i in range(k,n):
    cnt += p[i] - p[i-k]
    if cnt > val:
        val = cnt
        point = i-k+1
#print(point)

ans = 0
for i in range(k):
    ans += (p[point] + 1) / 2
    point += 1

print(ans)
Problem p02797 (python)

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

if s != int(1e9):
    anslist = [int(1e9)] * n
    for i in range(k):
        anslist[i] = s
    for i in range(len(anslist)):
        print(anslist[i])
else:
    anslist = [1] * n
    for i in range(k):
        anslist[i] = s
    for i in range(len(anslist)):
        print(anslist[i])

Buggy submission (verdict: Runtime Error):
n, k, s = map(int,input().split())
anslist = [0] * n
for i in range(k):
    anslist[i] = s
for i in range(len(anslist)):
    print(s[i])
Problem p02804 (python)

Fixed submission:
MAX = 600000
MOD = 10 ** 9 + 7
fac = [0] * MAX
ifac = [0] * MAX
fac[0] = 1
for i in range(1,MAX):
    fac[i] = (fac[i-1] * i) % MOD
ifac[MAX-1] = pow(fac[MAX-1],MOD-2,MOD)
for i in reversed(range(1,MAX)):
    ifac[i-1] = (ifac[i] * i) % MOD

def combinations(n, k):
    if k < 0 or n < k:
        return 0
    else:
        return (fac[n] * ifac[k] * ifac[n-k]) % MOD


N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
com = [0]
for i in range(N):
    com.append(A[i] + com[-1])
#print(com)
ans = 0
for i in range(K-2,N-1):
    ans += combinations(i,K-2) * (-(com[N-i-1]) + (com[N]-com[i+1]))
    #print(N-i-1,N,i+1)
    ans %= MOD
    #print(combinations(i,K-2) * (-(com[N-i-1]) + (com[N]-com[i+1])))
print(ans)

Buggy submission (verdict: Runtime Error):
MAX = 600000
MOD = 10 ** 9 + 7
fac = [0] * MAX
ifac = [0] * MAX
fac[0] = 1
for i in range(1,MAX):
    fac[i] = (fac[i-1] * i) % MOD
ifac[MAX-1] = pow(fac[MAX-1],MOD-2,MOD)
for i in reversed(range(1,MAX)):
    ifac[i-1] = (ifac[i] * i) % MOD

def combinations(n, k):
    if k < 0 or n < k:
        return 0
    else:
        return (fac[n] * ifac[k] * ifac[n-k]) % MOD

N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

def f(A):
    ans = 0
    for i in range(K-1,N):
        ans += A[i]*combinations(i-1,K-1)
        ans %= MOD
    return ans

print((f(A) - f(reversed(A))) % MOD )
Problem p02842 (python)

Fixed submission:
n = int(input())
import math
for i in range(50000):
  if math.floor(i*1.08) == n:
    print(i)
    exit()
   

  
print(':(')

Buggy submission (verdict: Runtime Error):
n = int(input())
import.math
for i in range(n):
  if int(i * 1.08) == n:
    print(i)
    exit()
  elif math.ceil(i * 1.08) == n:
    print(i)
    exit()
   

  
print(':(')
Problem p02899 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
print(ans)
for i in range(n):
  ans[a[i]-1] = i +1
for i in range(n):
  print(ans[i])

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin().readline()

N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    print(A.index(i+1) +1, end =' ')

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin().readline()

N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    print(A.index(i+1) +1, end =' ')

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline()

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

for i in range(N):
    print(A.index(i+1) +1, end =' ')
Problem p02910 (python)

Fixed submission:
S = input()
b = list(S)
a = b[0::2]
c = b[1::2]
d = len(a)
e = len(c)
cnt = 0
f = a.count('R')
g = a.count('U')
h = a.count('D')
i = f + g + h



j = c.count('L')
k = c.count('U')
l = c.count('D')
m = j + k + l



if i == d and m == e:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input()
b = list(S)
a = b[0::2]
c = b[1::2]
d = len(b)
e = len(c)
cnt = 0
f = a.count('R' or 'U' or 'D')
g = c.count('L' or 'U' or 'D')
if f == d and e == g:
    print(Yes)
else:
    print(No)
Problem p02921 (python)

Fixed submission:
a,b,c = input()
d,e,f = input()
count = 0
if a == d:
    count+= 1
if b == e:
    count+= 1
if c == f:
    count+= 1
print(count)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-(c-1) // a-1))

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

c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-c // a-1)-1)

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

c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-c // a-1))

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

for i in range(20):
    if b > count:
        count += a-1
    else:
        break
c = -(-count // a)
if a == b:
    print(c + 1)
elif count // a >= 1:
    print(c)
else:
    print(0)

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

for i in range(20):
    if b > count:
        count += a-1
    else:
        break
if -(-count // a) >= 1:
    print(-(-count // a))
else:
    print(0)
Problem p02922 (python)

Fixed submission:
a, b = map(int, input().split())
print(-(-(b-1) // (a-1)))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-(c-1 // a-1))

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

c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-(c -1)// a-1)

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

c = 1
for i in range(20):
    if b > c:

        c += a-1
    else:
        break
print(count / a-1)

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

c = 1
for i in range(20):
    if b > c:

        c += a-1
    else:
        break
print(count / a-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
count = 1
 
for i in range(20):
    if b > count:
        count += a-1
    else:
        break
if -(-count // a) >= 1:
    print(-(-count // a))
else:
    print(0