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

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

Asum_li = [0]
Asum = 0
Bsum_li = [0]
Bsum = 0

for A_ in A:
    Asum = Asum + A_
    Asum_li.append(Asum)

for B_ in B:
    Bsum = Bsum + B_
    Bsum_li.append(Bsum)

cnt_max = 0
cnt_b = M

for cnt_a in range(N+1):

    if Asum_li[cnt_a] > K : break

    while (Bsum_li[cnt_b] + Asum_li[cnt_a]) > K:
        cnt_b = cnt_b - 1
        if cnt_b < 0: break

    if (cnt_max < cnt_a + cnt_b): cnt_max = cnt_a + cnt_b


print(cnt_max)

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

Asum_li = [0]
Asum = 0
Bsum_li = [0]
Bsum = 0

for A_ in A:
    Asum = Asum + A_
    Asum_li.append(Asum)

for B_ in B:
    Bsum = Bsum + B_
    Bsum_li.append(Bsum)

cnt_max = 0
cnt_b = M

for cnt_a in range(N+1):

    while (Bsum_li[cnt_b] + Asum_li[cnt_a]) > K:
        cnt_b = cnt_b - 1
        if cnt_b < 0: break

    if (cnt_max < cnt_b + cnt_a): cnt_max = cnt_b + cnt_a


print(cnt_max)

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

b_li = [0]
b_ = 0

for B_ in B:
    b_ = b_ + B_
    b_li.append(b_)

book_max = 0
book_cnt_a = 0
book_cnt_ab = 0
a_ = 0
book_cnt_ab = M

for i in range(N+1):
    while (b_li[book_cnt_ab-1] + a_) > K:
        book_cnt_ab = book_cnt_ab - 1
        if book_cnt_ab == 0: break
    if (book_max <= book_cnt_ab + book_cnt_a):
            book_max = book_cnt_ab + book_cnt_a
    book_cnt_a = book_cnt_a + 1
    if i >= N: break
    a_ = a_ + A[i]

print(book_max)

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

b_li = [0]
b_ = 0

for B_ in B:
    b_ = b_ + B_
    b_li.append(b_)

book_max = 0
book_cnt_a = 0
book_cnt_ab = 0
a_ = 0
book_cnt_ab = M

for i in range(N+1):
    while (b_li[book_cnt_ab-1] + a_) > K:
        book_cnt_ab = book_cnt_ab - 1
    if (book_max <= book_cnt_ab + book_cnt_a):
            book_max = book_cnt_ab + book_cnt_a
    book_cnt_a = book_cnt_a + 1
    if i >= N: break
    a_ = a_ + A[i]

print(book_max)

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_li = [0]
a_ = 0
b_li = [0]
b_ = 0

for A_ in A:
    a_ = a_ + A_
    a_li.append(a_)

for B_ in B:
    b_ = b_ + B_
    b_li.append(b_)

book_max = 0
book_cnt_a = 0
book_cnt_ab = 0

for a_ in a_li:
    book_cnt_ab = M
    for b_ in b_li.reverse():
        if (a_ + b_) < K:
            if (book_max <= book_cnt_ab + book_cnt_a):
                book_max = book_cnt_ab + book_cnt_a
            break
        book_cnt_ab = book_cnt_ab - 1
    book_cnt_a = book_cnt_a + 1

print(book_max)
Problem p02572 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
t = 0 
S = sum(A)
c = 0 
for i in range(len(A) - 1): 
        S -= A[i]
        t = (t + (A[i] * S)) % 1000000007
print(t)

Buggy submission (verdict: Runtime Error):
 = int(input())
A = list(map(int, input().split()))
t = 0 
S = sum(A)
c = 0 
for i in range(len(A) - 1): 
        S -= A[i]
        t = (t + (A[i] * S))
print(t % 1000000007)
Problem p02659 (python)

Fixed submission:
A, B = input().split()
ans = (int(A) * (int(B[0])*100 + int(B[2])*10 + int(B[3]))) // 100
print(int(ans))

Buggy submission (verdict: Runtime Error):
A, B = input().split()
print(ans = int(A) * round(float(B) * 100) // 100)
Problem p02723 (python)

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

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

Fixed submission:
A, B, C = map(int, input().split())
if A + B + C >= 22: 
        print("bust")
else:
        print("win")

Buggy submission (verdict: Runtime Error):
def counter(x):
        if x == 0:
                return 0
        return counter(x >> 1) + int(bin(x & 1), 2)

N = int(input())
A = []
x = [0] * N 
for i in range(N):
        A.append(int(input()))
        x[i] = [list(map(int, input().split())) for j in range(A[i])]

ans = 0 
for bits in range(1, 1 << N): 
        flag = 1 
        for i in range(N):
                if not int(bin(bits & (1 << i)), 2): 
                        continue
                for j in range(A[i]):
                        if int(bin((bits >> (x[i][j][0] - 1) & 1) ^ x[i][j][1]), 2): 
                                flag = 0 
        if flag:
                ans = max(ans, counter(bits))
print(ans)
Problem p02862 (python)

Fixed submission:
x, y = map(int, input().split())
n = (2*y - x)//3 
m = (2*x - y)//3
mod = 10**9+7
def inv(x):
        return pow(x, mod-2, mod)
def fact(x):
        f = 1 
        for i in range(1, x + 1): 
                f *= i
                f %= mod    
        return f
def comb(n, r): 
        return (fact(n) * inv(fact(n-r)) * inv(fact(r))) % mod 
res = comb(n+m, m)
if (x + y) % 3 == 0 and n >= 0 and m >= 0:
        print(res)
else:
        print(0)

Buggy submission (verdict: Runtime Error):
import math
x, y = map(int, input().split())
if (x + y) % 3 == 0:
        n = int(x - 2/3*(2*x-y))
        m = int((2*x - y)/3)
        c = 1 
        for i in range(n):
                c *= n + m - i 
        print(c // math.factorial(n) % (10**9+7))
else:
        print(0)
Problem p02880 (python)

Fixed submission:
s = int(input())
res = 'No'
for i in range(1,10):
        if s%i == 0 and s/i < 10: 
                res = 'Yes'
                break
print(res)

Buggy submission (verdict: Runtime Error):
a,b,*c = input();print('YNeos'[((c>[])|((int(b)==0)&(int(a)>4)))::2])
Problem p02693 (python)

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

listK = [K*i for i in range(1, 1000) if K*i<=1000]

for j in listK:
    if A<=j and j<=B:
        print('OK')
        exit()

print('NG')

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

listK = [K*i for i in range(1, 1000) if K*i<=1000]

for j in listK:
    if A<=listK[j] and listK[j]<=B:
        print('OK')
        exit()

print('NG')
Problem p02723 (python)

Fixed submission:
S = input()
l = []
cont = 0
for i in S:
    l.append(i)

if l[2] == l[3]:
    if l[4] == l[5]:
        cont = 1

if cont == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input()
l = []
for i in S:
    l.append(i)

if l[3] == l[4]:
    if l[5] == l[6]:
        print('Yes')

print('No')
Problem p02711 (python)

Fixed submission:
N = input()
word = "7"
if word in N:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input().rstrip)
count = 0
for i in N:
  if i == 7:
    count += 1
if count > 0:
  print("Yes")
else:
  print("No")
Problem p02701 (python)

Fixed submission:
s = set()
for _ in range(int(input())):
				a = input()
				s.add(a)
print(len(s))

Buggy submission (verdict: Runtime Error):
s = set()
for _ in range(int(input()):
               a = input()
               s.add(a)
print(len(s))

Buggy submission (verdict: Runtime Error):
s = set()
for _ in range(int(input()):
               a = input()
               s.add(a)
print(len(a))
Problem p02594 (python)

Fixed submission:
x = int(input())

if x >= 30:
    print("Yes")
else:
    print("No")

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

if x >= 30:
    print("Yes")
else:
    print("No")

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

if x >= 30:
    print("Yes")
else:
    print("No")
Problem p02627 (python)

Fixed submission:
A = str(input())

if A == A.upper():
    print("A")
else:
    print("a")

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

B = A.Upper()

if A == B:
    print("A")
else:
    print("a")
Problem p02723 (python)

Fixed submission:
S = 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]andS[4]==S[5]:
    print("Yes")
else:
    print("No")
Problem p03135 (python)

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

print(t/x)

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

l = []
sum = 0
  
for i in range(0, k+1):
  for j in a:
    sum += i ^ j
  l.append(sum)
  sum = 0


print(max(l))

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

l = []
sum = 0
  
for i in range(0, k+1):
  for j in a:
    sum += i ^ j
  l.append(sum)
  sum = 0


print(max(l))
Problem p03307 (python)

Fixed submission:
n = int(input())

if (n%2 == 0):
    print(n)
else:
    print(2*n)

Buggy submission (verdict: Runtime Error):
n = int(input()) 
row = input().split()
max = row[0]
min = row[0]


for i in range(n-1):
        if(max < row[i]):
            max = row[i]

for i in range(n-1):
        if(min > row[i]):
            min = row[i]


print (int(max)-int(min))

Buggy submission (verdict: Runtime Error):
n = int(input()) 
row = input().split()
max = row[0]
min = row[0]

for j in range(n-1):
    for i in range(n-1):
        if(row[j] < row[i+1]):
            max = row[i+1]


    for i in range(n-1):
        if(min > row[n-1]):
            min = row[n-1]


print (int(max)-int(min))

Buggy submission (verdict: Runtime Error):
n = int(input()) 
row = input().split()
max = row[0]
min = row[0]


    for i in range(n-1):
        if(max < row[n-1]):
            max = row[n-1]


    for i in range(n-1):
        if(min > row[n-1]):
            min = row[n-1]


print (min)

Buggy submission (verdict: Runtime Error):
n = int(input()) 
row = input().split()
max = row[0]
min = row[0]

for i  in range(n-1):
    if(row[i] < row[i+1]):
        max = row[i+1]

for i in range(n-1):
    if(row[i] > row[i+1]):
        min = row[i+1]


print(int(max)-int(min))

Buggy submission (verdict: Runtime Error):
n = int(input()) 
row = map(int, input().split())
max = row[0]
min = 0

for i in range(n-1):
    if(row[i] < row[i+1]):
        max = row[i+1]

for i in range(n-1):
    if(row[i] > row[i+1]):
        min = row[i+1]

print(max-min)

Buggy submission (verdict: Runtime Error):
if N%2==0:
    print(2)
else:
    print(2*N)
Problem p02594 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
C=list(input())
L=0
R=0
X=0
for i in range(N):
  L=i
  if L==N-1-R:
    break
  if C[i]=='W':
    for ii in range(N-L-R):
      R+=ii 
      if C[N-1-R]=='R':
        C[L]='R'
        C[N-1-R]='W'
        X+=1
        R+=1
        if L==N-1-R:
          break
        break
print(X)
Problem p02597 (python)

Fixed submission:
N = int(input())
C=list(input())
type=set(C)
L=0
R=0
RR=0
X=0
if 'R' in type and 'W' in type:
    for i in range(N):
      L=i
      R=RR
      if L>=N-1-R:
        break
      if C[i]=='W':
          for ii in range(N-L-R):
            if C[N-1-R-ii]=='R':
              C[L]='R'
              C[N-1-R-ii]='W'
              X+=1
              break
            RR+=1
            if L>=N-1-R:
              break
print(X)

Buggy submission (verdict: Runtime Error):
N = int(input())
C=list(input())
L=0
R=0
RR=0
X=0
    for i in range(N):
      L=i
      R=RR
      if L>=N-1-R:
        break
      if C[i]=='W':
          for ii in range(N-L-R):
            if C[N-1-R-ii]=='R':
              C[L]='R'
              C[N-1-R-ii]='W'
              X+=1
              break
            RR+=1
            if L>=N-1-R:
              break
print(X)

Buggy submission (verdict: Runtime Error):
N = int(input())
C=list(input())
L=0
R=0
X=0
for i in range(N):
  L=i
  if L==N-1-R:
    break
  if C[i]=='W':
    for ii in range(N-L-R):
      R+=ii 
      if C[N-1-R]=='R':
        C[L]='R'
        C[N-1-R]='W'
        X+=1
        R+=1
        if L==N-1-R:
          break
        break
print(X)

Buggy submission (verdict: Runtime Error):
N = int(input())
C=list(input())
L=0
R=0
X=0
for i in range(N):
  L=i
  if L==N-1-R:
    break
  if C[i]=='W':
    for ii in range(N-L-R):
      R+=ii 
      if C[N-1-R]=='R':
        C[L]='R'
        C[N-1-R]='W'
        X+=1
        R+=1
        if L==N-1-R:
          break
        break
print(X)
Problem p02634 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
def amari(a):
  return a % 998244353
X0=[[0]*d for i in range(c)]
X1=[[0]*d for i in range(c)]
X2=[[0]*d for i in range(c)]
X0[a-1][b-1]=1
for j in range(b,d):
 X0[a-1][j]=amari(X0[a-1][j-1]*(a-1))
 X1[a-1][j]=amari(X0[a-1][j-1]+X1[a-1][j-1]*(a-1))
 X2[a-1][j]=amari(X1[a-1][j-1]+X2[a-1][j-1]*a)
for i in range(a,c):
 for j in range(b,d+1):
  X1[i][j-1]=amari((X0[i-1][j-1]+X1[i-1][j-1]+X2[i-1][j-1])*j)
  if j>=2:
   X2[i][j-1]=amari(X1[i][j-2]+X2[i][j-2] *(i+1))
print(amari(X0[c-1][d-1]+X1[c-1][d-1]+X2[c-1][d-1]))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
def amari(a):
  return a % 998244353
import numpy as np
X=np.zeros((3, c, d),int)
X[0][a-1][b-1]=1
for j in range(b,d):
 X[0][a-1][j]=amari(X[0][a-1][j-1]*(a-1))
 X[1][a-1][j]=amari(X[0][a-1][j-1]+X[1][a-1][j-1]*(a-1))
 X[2][a-1][j]=amari(X[1][a-1][j-1]+X[2][a-1][j-1]*a)
for i in range(a,c):
 for j in range(b,d+1):
  X[1][i][j-1]=amari((X[0][i-1][j-1]+X[1][i-1][j-1]+X[2][i-1][j-1])*j)
  if j>=2:
   X[2][i][j-1]=amari(X[1][i][j-2]+X[2][i][j-2] *(i+1))
print(amari(X[0][c-1][d-1]+X[1][c-1][d-1]+X[2][c-1][d-1]))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
def amari(a):
  return a % 998244353
import numpy as np
X=np.zeros((3, c, d),int)
X[0][a-1][b-1]=1
for j in range(b,d):
 X[0][a-1][j]=amari(X[0][a-1][j-1]*(a-1))
 X[1][a-1][j]=amari(X[0][a-1][j-1]+X[1][a-1][j-1]*(a-1))
 X[2][a-1][j]=amari(X[1][a-1][j-1]+X[2][a-1][j-1]*a)
for i in range(a,c):
 for j in range(b,d+1):
  X[1][i][j-1]=amari(X[0][i-1][j-1]+X[1][i-1][j-1]+X[2][i-1][j-1]*j)
  if j>=2:
   X[2][i][j-1]=amari(X[1][i][j-2]+X[2][i][j-2] *(i+1))
  else:
    X[2][i][j-1]=0
print(amari(X[0][c-1][d-1]+X[1][c-1][d-1]+X[2][c-1][d-1]))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
import numpy as np
X0=np.zeros((a, d),int)
X1=np.zeros((c, d),int)
X2=np.zeros((c, d),int)
X0[a-1][b-1]=1
for j in range(b,d):
  if d>b:
    X0[a-1][j]=(X0[a-1][j-1]*(a-1))% 998244353
    X1[a-1][j]=((X0[a-1][j-1]+X1[a-1][j-1]*(a-1)))% 998244353
    X2[a-1][j]=(X1[a-1][j-1]+(X2[a-1][j-1]*a))% 998244353
for i in range(a,c):
  if c>a:
    for j in range(b,d+1):
      if i>a:
        X1[i][j-1]=((X1[i-1][j-1]+X2[i-1][j-1])*j) % 998244353
      else:
        X1[i][j-1]=((X0[i-1][j-1]+X1[i-1][j-1]+X2[i-1][j-1])*j) % 998244353
      if j>=2:
        X2[i][j-1]=(X1[i][j-2]+X2[i][j-2] *(i+1)) % 998244353
if a==c:
  print((X0[c-1][d-1]+X1[c-1][d-1]+X2[c-1][d-1])%998244353)
else:
  print((X1[c-1][d-1]+X2[c-1][d-1])%998244353)
Problem p02627 (python)

Fixed submission:
A='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
a='abcdefghijklmnopqrstuvwxyz'

n=input()

if n in A:
    print("A")

if n in a:
    print("a")

Buggy submission (verdict: Runtime Error):
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "g\n",
      "a\n"
     ]
    }
   ],
   "source": [
    "A='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n",
    "a='abcdefghijklmnopqrstuvwxyz'\n",
    "\n",
    "n=input()\n",
    "\n",
    "if n in A:\n",
    "    print(\"A\")\n",
    "\n",
    "if n in a:\n",
    "    print(\"a\")\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
Problem p02659 (python)

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

fa=int(a[0])
fb=int(a[1].replace(".", ""))

print(fa*fb//100)

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

fa=int(a[0])
fb=int(a[1]*100)

print(fa*fb//100)

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

fa=int(a[0])
fb=int(a[1]*100)

print((fa*fb//100)
Problem p02629 (python)

Fixed submission:
N = int(input())
ans = ''
for i in range(1, 99):
	if N <= 26 ** i:
		N -= 1
		for j in range(i):
			ans += chr(ord('a') + N % 26)
			N //= 26
		break
	else:
		N -= 26 ** i
print(ans[::-1]) # reversed

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 p02951 (python)

Fixed submission:
A, B, C = list(map(int, input().split()))
tmp = C-(A-B)
print(max(0, tmp))

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = sum(A)
flag = False
def make_divisors(n):
    divisors = []
    for i in range(int(n**0.5), 0, -1):
        if n%i == 0:
            divisors.append(i)
            if i != n//i:
                divisors.append(n//i)
    return sorted(divisors, reverse=True)
divs = make_divisors(s)
for x in divs:
    if flag:
        break
    sortedA = sorted([a%x for a in A])
    sumA = sum(sortedA)
    index_len = len(sortedA)
    sump = 0
    for i, a in enumerate(sortedA):
        sump += a
        summ = x*(index_len - (i+1)) - (sumA - sump)
        if sump == summ and sump <= K:
            print(x)
            flag = True
            break
Problem p03104 (python)

Fixed submission:
def f(a):
    if a%4 == 0:
        return a
    elif a%4 == 1:
        return 1
    elif a%4 == 2:
        return a^1
    elif a%4 == 3:
        return 0
A, B = list(map(int, input().split()))
print(f(A-1)^f(B))

Buggy submission (verdict: Runtime Error):
from functools import reduce
def xor(i, k):
    return i^k
A, B = list(map(int, input().split()))
AB = list(range(A, B+1))
print(reduce(xor, AB))
Problem p02596 (python)

Fixed submission:
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  myconst = 7 % k
  cnt = 1
  while True:
    if not myconst:
      print(cnt)
      break
    else:
      myconst = ((10 * myconst) + 7) % k
    cnt += 1

Buggy submission (verdict: Runtime Error):
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  myconst = 7 % k
  cnt = 1
  while True:
    if not myconst:
      print(cnt)
      break
	  else:
      myconst = ((10 * myconst) + 7) % k
    cnt += 1

Buggy submission (verdict: Runtime Error):
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  mystr = '7'
  while True:
    if int(mystr, 10) % k == 0:
      print(len(mystr))
      break
	else:
      mystr += '7'
Problem p02597 (python)

Fixed submission:
n = int(input())
c = list(input())
left = 0
cnt = 0
right = len(c) - 1
while left < n and right >=0 and left < right:
    while left < n and c[left] != 'W':
        left += 1
    while right >= 0 and c[right] != 'R':
        right -= 1
    if left< n and right >= 0 and left<right:
        c[left], c[right] = c[right], c[left]
        cnt += 1
        left += 1
        right -=1 
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = list(map(int, input().split()))
left = 0
cnt = 0
right = len(c) - 1
while left < n and right >=0 and left < right:
	while left < n and c[left] != 'W':
		left += 1
	while right >= 0 and c[right] != 'R':
		right -= 1
	if left< n and right >= 0 and left<right:
		c[left], c[right] = c[right], c[left]
		cnt += 1
		left += 1
		right -=1 
print(cnt)
Problem p02711 (python)

Fixed submission:
a = str(input())
b = a[0]
c = a[1]
d = a[2]
if b == "7" or c == "7" or d == "7":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = [int(input()) for i in range(3)]
b = a[1]
c = a[1]
d = a[2]
if b == 7 or c == 7 or d == 7:
    print("Yes")
else:
    print("No")
Problem p02712 (python)

Fixed submission:
a = int(input())
j = 0
for i in range(a + 1):
    if i%3!=0 and i%5!=0:
        j+=i
print(j)

Buggy submission (verdict: Runtime Error):
a = long(input())
j = 0
for i in range(a):
    if i%3==0:
        continue
    if i%5==0:
        continue
    else:
        j+=i
print(j)

Buggy submission (verdict: Runtime Error):
a = input()
j = 0
for i in range(a):
    if i%3==0:
        continue
    if i%5==0:
        continue
    else:
        j+=i
print(j)

Buggy submission (verdict: Runtime Error):
a = input()
j = 0
for i in range(a):
    if i%3==0:
        continue
    if i%5==0:
        continue
    else:
        j+=i
print(j)
Problem p02572 (python)

Fixed submission:
N=int(input())
a=list(map(int, input().split()))
sum=sum(a)
b=0
c=0
for i in range(N-1):
    b+=a[i]
    c=(c+(a[i]*(sum-b))) %(10**9+7)
print(c)

Buggy submission (verdict: Runtime Error):
N=int(int(input))
A=list(map(int,input().split()))
sum=sum[A]
b=0
c=0
for i in range(N-1):
    b+=A[i]
    c=(c+(A[i]*(sum-b))) %(10**9+7)
print(c)

Buggy submission (verdict: Runtime Error):
N=int(int(input))
A=list(map(int,input().split()))
sum=sum[A]
b=0
c=0
for i in range(N-1):
    b+=A[i]
    c=(c+(A[i]*(sum-b))) %(10**9+7)
print(c)
Problem p02699 (python)

Fixed submission:
num = map(int,input().split())
a = []
for i in num:
    a.append(i)
if a[0]<a[1]:
    print('unsafe')
elif a[0]>a[1]:
    print('safe')
else:
    print('unsafe')

Buggy submission (verdict: Runtime Error):
s = int(input())
w = int(input())
print("safe" if s > w else "unsafe")

Buggy submission (verdict: Runtime Error):
s = input('enter a number')
w = input('enter a number')
print('safe' if s > w else 'unsafe')

Buggy submission (verdict: Runtime Error):
s = input()
w = input()
print('safe' if s > w else 'unsafe')

Buggy submission (verdict: Runtime Error):
s = input()
w = input()
print('safe' if s > w else 'unsafe')

Buggy submission (verdict: Runtime Error):
s = input()
w = input()
print('safe' if s > w else 'unsafe')

Buggy submission (verdict: Runtime Error):
s = input()
w = input()
print('safe' if s > w else 'unsafe')

Buggy submission (verdict: Runtime Error):
s = input()
w = input()
print('safe' if s > w else 'unsafe')

Buggy submission (verdict: Runtime Error):
s = input()
w = input()
if w >= s:
  print('unsafe')
else:
  print('safe')

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

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

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

Buggy submission (verdict: Runtime Error):
s = input()
w = input()
if w >= s:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
s = input()
w = input()
if w >= s:
    print('unsafe')
else:
    print('safe')
Problem p02793 (python)

Fixed submission:
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
l %= mod
for x in a:
  res += l * pow(x, mod - 2, mod)
  res %= mod
print(res)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
m = 1000000007
l = list(map(int,input().split()))
a,v=1,1
for i in l:
    b = math.gcd(a,i)
    a = ((a*i)%m)*(pow(b,m-2,m))%m

ans=0
for i in range(n):
    ans+=a*pow(l[i],m-2,m)
    ans=ans%m
print(ans)

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

l = list(map(int,input().split()))
a=1
for i in range(n):
    a = a*l[i]//int(math.gcd(a,i))
ans=0
for i in range(n):
    ans=(ans+a//l[i])%1000000007
print(ans)

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

l = list(map(int,input().split()))
a=1
for i in l:
    a = a*i//math.gcd(a,i)
ans=0
for i in range(n):
    ans=(ans+a//l[i])%1000000007
print(ans)