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

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log,gcd
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')

#Pythonを用いる場合
#numpy 1.18.0, scipy 1.4.1, scikit-learn 0.22, numba 0.47.0, networkx 2.4
 
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix

 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

a=ss()

if 65<= ord(a) <=90:
    print("A")
else:
    print("a")

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log,gcd
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')

#Pythonを用いる場合
#numpy 1.18.0, scipy 1.4.1, scikit-learn 0.22, numba 0.47.0, networkx 2.4
 
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix

 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

a=ii()

if 65<= ord(a) <=90:
    print("A")
else:
    print("a")
Problem p02689 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n,m=mii()

arr=limii()

mat=[[0] for _ in range(n)]
for i in range(m):
    a,b=mii()
    mat[a-1].append(arr[b-1])
    mat[b-1].append(arr[a-1])
chk=0
for i in range(n):
    if arr[i]>max(mat[i]):
        chk+=1

print(chk)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n,m=mii()

arr=limii()

mat=[1]*n
for i in range(m):
    a,b=mii()
    if arr[a-1] < arr[b-1]:
        mat[a-1] =0
    elif: arr[b-1]<arr[a-1]:
        mat[b-1] =0
print(sum(mat))
Problem p02759 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd

mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
n=ii()
if n%2==0:
    print(n//2)
else:
    print((n+1)//2)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
from statistics import median,median_high,median_low
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
n=ii()
if n%2==0:
    print(n//2)
else:
    print((n+1)//2)
Problem p02777 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

s,t=input().split()
a,b=mii()
u=ss()

if u==t:
    print(str(a)+" "+str(b-1))
elif u==s:
    print(str(a-1)+" "+str(b))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

s,t=mii()
a,b=mii()
u=ii()

if u=="blue":
    print(str(a)+" "+str(b-1))
else u=="red":
    print(str(a-1)+" "+str(b))
Problem p02831 (python)

Fixed submission:
a,b = map(int,input().split())
 
import fractions
 
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
print(lcm(a, b))

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

import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))
Problem p02862 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

x,y=mii()

if (x+y) %3!=0:
    print(0)
    exit()
if max(x,y)/min(x,y)>2:
    print(0)
    exit()

def nCk(n, k, mod=10 ** 9 + 7):
    if n < k:
        return 0
    k = min(k, n - k)
    numer = 1
    for x in range(n - k + 1, n + 1):
        numer = (numer * x) % mod
    denom = 1
    for x in range(1, k + 1):
        denom = (denom * x) % mod
    return numer * pow(denom, mod - 2, mod) % mod

n=(2*y-x)//3
m=(2*x-y)//3

print(nCk(n+m,n,mod))

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

import math

a = x+y

def P(n, r):
    return math.factorial(n)//math.factorial(n-r)

if a % 3 != 0:
    print(0)

else:
    c = int(x% (a/3))
    b = a/3 -c

    d = math.factorial(a/3) /(math.factorial(b)*math.factorial(c))
    print(d%(10**9 +7))
Problem p02912 (python)

Fixed submission:
import heapq as hq

num ,m =map(int,input().split())

arr = [-i for i in list(map(int,input().split()))]
hq.heapify(arr)

for i in range(m):
    hq.heappush(arr, -1*(-1*hq.heappop(arr)//2))

    
print(-1*sum(arr))

Buggy submission (verdict: Runtime Error):
num ,m =map(int,input().split())
if num == 1:
    s = int(input())
    print(s//(2**m))
    
else:
    arr = sorted(list(map(int,input().split())),reverse=True)

    for i in range(m):
        for j in range(len(arr)):
            if arr[j]//2 < arr[j+1]:
                arr[j] = arr[j] //2
                
                if arr[j] < arr[j+1]:
                    arr[j],arr[j+1] = arr[j+1],arr[j]
                    if len(arr) >= j+2 and arr[j+1] < arr[j+2]:
                        arr[j+1],arr[j+2] = arr[j+2],arr[j+1]
                break

    print(sum(arr))

Buggy submission (verdict: Runtime Error):
num ,m =map(int,input().split())
if num == 1:
    s = int(input())
else:
    arr = sorted(list(map(int,input().split())),reverse=True)

if num == 1:
    print(s//(2**m))
    
else:
    for i in range(m):
        for j in range(len(arr)):
            if arr[j]//2 < arr[j+1]:
                arr[j] = arr[j] //2
                
                if arr[j] < arr[j+1]:
                    arr[j],arr[j+1] = arr[j+1],arr[j]
                break
    print(sum(arr))

Buggy submission (verdict: Runtime Error):
num ,m =map(int,input().split())
arr = sorted(list(map(int,input().split())),reverse=True)

for i in range(m):
    for j in range(len(arr)):
        if arr[j]//2 < arr[j+1]:
            arr[j] = arr[j] //2
            arr.sort(reverse=True)
            break
print(sum(arr))

Buggy submission (verdict: Runtime Error):
num ,m =map(int,input().split())
arr = sorted(list(map(int,input().split())),reverse=True)
print(arr)

for i in range(m):
    for j in range(len(arr)):
        if arr[j]//2 < arr[j+1]:
            arr[j] = arr[j] //2
            arr.sort(reverse=True)
            break

    print(arr)

print(sum(arr))
Problem p03805 (python)

Fixed submission:
import itertools

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

if n ==2:
    print(1)
    exit()

arr=[[_] for _ in range(n)]

for i in range(m):
    a,b=map(int,input().split())
    #print(a,b)
    
    arr[a-1].append(b-1)
    arr[b-1].append(a-1)

#print("arr",arr)

route=list(itertools.permutations(range(1,n)))
#print("route",route) 
ans=0
for i in route:
    chk0=0
    chk=True
    if i[0] in arr[0]:
        chk0 =True
        #print(i)
        for j in range(1,n-1):
            if i[j] in arr[i[j-1]]:
                chk0+=1
                
                pass
            else:
                #print(1,i[j],arr[i[j-1]])
                break
                
    if chk0==n-1:
        
        ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

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

if n ==2:
    print(1)
    exit()

arr=[[_] for _ in range(n)]

for i in range(n):
    a,b=map(int,input().split())
    
    arr[a-1].append(b-1)
    arr[b-1].append(a-1)
for i in range(n):
    arr[i] = arr[i][1:]
#print("arr",arr)

route=list(itertools.permutations(range(1,n)))
#print("route",route) 
ans=0
for i in route:
    chk0=False
    chk=True
    if i[0] in arr[0]:
        #print(i)
        for j in range(1,n-1):
            if i[j] in arr[i[j-1]]:
                chk0=True
                #print(i[j],arr[j])
                pass
            else:
                chk=False
    if chk==True and chk0==True:
        #print(i)
        ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

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

if n ==2:
    print(1)
    exit()

arr=[[_] for _ in range(n)]

for i in range(n):
    a,b=map(int,input().split())
    
    arr[a-1].append(b-1)
    arr[b-1].append(a-1)

#print("arr",arr)

route=list(itertools.permutations(range(1,n)))
#print("route",route) 
ans=0
for i in route:
    chk0=False
    chk=True
    if i[0] in arr[0]:
        #print(i)
        for j in range(1,n-1):
            if i[j] in arr[i[j-1]]:
                chk0=True
                #print(i[j],arr[j])
                pass
            else:
                chk=False
    if chk==True and chk0==True:
        #print(i)
        ans+=1

print(ans)
Problem p02773 (python)

Fixed submission:
from collections import Counter
N=int(input())
S=[input() for _ in range(N)]

C=Counter(S)
A=[]
B=[]
T=[]

for i,j in C.most_common():
    A.append(i)
    B.append(j)
for k in range(len(A)):
    if B[k]==B[0]:
        T.append(A[k])
T=sorted(T)
for m in range(len(T)):
  print(T[m])

Buggy submission (verdict: Runtime Error):
from collections import Counter
N=int(input())
S=[input() for _ in range(N)]

C=Counter(S)
A=[]
B=[]

for i,j in C.most_common():
    A.append(i)
    B.append(j)
for k in range(len(A)):
    if B[k]=B[0]:
        print(A[k])

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

S=sorted(S)
T=[]
m=S.count(S[0])
T.append(S[0])
c=1
for i in range(1,N):
    if i==N-1:
        if S[i]==S[i-1]:
            c+=1
            if c>m:
                T.clear()
                T.append(S[i])
            elif c==m:
                T.append(S[i])
        else:
            if m==1:
                T.appned(S[i])
    
    elif S[i]==S[i-1]:
        c+=1
    else:
        if c>m:
            T.clear()
            T.append(S[i-1])
            m=c
            c=1
        elif c==m:
            T.append(S[i-1])
            m=c
            c=1

for j in range(len(T)):
    print(T[j])
Problem p02820 (python)

Fixed submission:
N,K=map(int,input().split())
R,S,P=map(int,input().split()) #RSP グーチョキパー
T=list(input())

c=0

def jan(a):
    if a=="r":
        return P
    elif a=="s":
        return R
    elif a=="p":
        return S
    else:
        return 0

for i in range(K,N):
    if T[i-K]==T[i]:
        T[i]="o"

for i in range(1,K+1): #modK
    for j in range(N//K+1):
        if i+K*j>N:
            continue
        c+=jan(T[i+K*j-1])

print(c)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
R,S,P=map(int,input().split()) #RSP グーチョキパー
T=list(input())

c=0

def jan(a):
    if a=="r":
        return P
    if a=="s":
        return R
    if a=="p":
        return S

for i in range(1,N):
    if T[i]==T[i-1]:
        T[i]="o"

for i in range(1,K+1): #modK
    for j in range(N//K+1):
        if i+K*j>N-1:
            continue
        c+=jan(T[i+K*j])

print(c)
Problem p02596 (python)

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

Buggy submission (verdict: Runtime Error):
def main(h):
  count = 1
  n = 0
  if i in range (k):
    n = (n * 10 + 7) % k  
    if n == 0:
      break 
      print(count)
      return 0
    count += 1
  print(-1)
  
if __name__ == '__main__':
	k = int(input())
    main(k)
Problem p02779 (python)

Fixed submission:
n = int(input())
a = list(map(str,input().split()))
a.sort()
ans = 'YES'
for i in range(n-1):
    if a[i] == a[i+1]:
        ans = 'NO'
        break
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(str,input().split()))
a.sort()
ans = 'YES'
for i in range(n):
    if a[i] == a[i+1]:
        ans = 'NO'
        break
print(ans)
Problem p02627 (python)

Fixed submission:
n = input()

if n.isupper():
    print('A')
else:
    print('a')

Buggy submission (verdict: Runtime Error):
input().islower(): print("a")
else: print("A")

Buggy submission (verdict: Runtime Error):
if input().islower():
	return 'a'
 else:
  	return 'A'
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 p02594 (python)

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

Buggy submission (verdict: Runtime Error):
X_string=input()
int=input(X_string)
if X>=30:
  print("Yes")
else:
  print("No")
Problem p02594 (python)

Fixed submission:
a = int(input())
if a >=30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = input()
if a>=30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if X >=30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if X >= 30:
	print("Yes")
else:
	print("No")
Problem p02594 (python)

Fixed submission:
X = int(input())

if X >= 30:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
K = int(input())

d = pow(9, -1, K)
t = 1
for ans in range(1, K):
    #x = 7*(pow(10, ans, K) - 1)*d
    t = (t*10) % K
    x = 7*(t - 1)*d
    if  x%K == 0:
        print(ans)
        sys.exit()

print(-1)
Problem p02596 (python)

Fixed submission:
import sys
K = int(input())

x = 7
for ans in range(1, K*2):

    if  x%K == 0:
        print(ans)
        sys.exit()

    x = (x*10 + 7) % K
print(-1)

Buggy submission (verdict: Runtime Error):
import sys
K = int(input())
 
d = pow(9, -1, K)
t = 1
for ans in range(1, K*2):
    #x = 7*(pow(10, ans, K) - 1)*d
    t = (t*10) % K
    x = 7*(t - 1)*d
    if  x%K == 0:
        print(ans)
        sys.exit()
 
print(-1)

Buggy submission (verdict: Runtime Error):
import sys
K = int(input())
 
d = pow(9, -1, K)
t = 1
for ans in range(1, K):
    #x = 7*(pow(10, ans, K) - 1)*d
    t = (t*10) % K
    x = 7*(t - 1)*d
    if  x%K == 0:
        print(ans)
        sys.exit()
 
print(-1)

Buggy submission (verdict: Runtime Error):
import sys
K = int(input())

d = pow(9, -1, K)
for ans in range(1, K):
    x = 7*(pow(10, ans, K) - 1)*d
    if  x%K == 0:
        print(ans)
        sys.exit()

print(-1)
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')

Buggy submission (verdict: Runtime Error):
If x => 30:
  print(yes)
  
else:
  print(No)
Problem p02623 (python)

Fixed submission:
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])

ans, j = 0, m
for i in range(n + 1):
    if a[i] > k:
        break
    while b[j] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)

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 j in range(m):
    b.append(b[i] + B[i])

ans, j = 0, m
for i in range(n + 1):
    if a[i] > k:
        break
    while b[j] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
Problem p02729 (python)

Fixed submission:
n,m=map(int,input().split())
print(int(n*(n-1)/2+m*(m-1)/2))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
n,m = map(int,input().split())
r = 2
if m >=2:
    a = comb(n, r, exact=True)
    print(a+m)
else:
    a = comb(n, r, exact=True)
    print(a)