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

Fixed submission:
rolls = int(input())
dices = []
for _ in range(rolls):
  dices.append(list(map(int, input().split())))
 
doubles = [d1 == d2 for d1,d2 in dices]
 
for i in range(1,rolls):
  doubles[i] *= (doubles[i] + doubles[i-1])
  if doubles[i] == 3:
    print('Yes')
    exit()
 
print('No')

Buggy submission (verdict: Runtime Error):
rolls = int(input())
dices = []
for _ in range(rolls):
  dices.append(list(map(int, input().split())))

doubles = [d1 == d2 for d1,d2 in dices]

for i in range(1,rolls):
  doubles[i] *= (doubles[i] + doubles[i-1])
  if double[i] == 3:
    print('Yes')
    exit()

print('No')
Problem p02551 (python)

Fixed submission:
import os
import io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline


n, q = list(map(int, input().split()))
count = (n - 2) ** 2
c = [n] * (n + 1)
r = [n] * (n + 1)
mc = n
mr = n
for _ in range(q):
    m,q = list(map(int, input().split()))
    if m == 1:
        if q <= mc:
            count -= mr -2
            for p in range(q+1, mc):
                c[p] = mr
            c[q] = 0
            mc = q
        else:
            count -= c[q] - 2
    else:
        if q <= mr:
            count -= mc -2
            for p in range(q+1, mr):
                r[p] = mc
            r[q] = 0
            mr = q
        else:
            count -= r[q] - 2
print(count)

Buggy submission (verdict: Runtime Error):
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
n, q = list(map(int, input().split()))
count = (n - 2) ** 2
c = [n] * n
r = [n] * n
for _ in range(q):
  m,q = list(map(int, input().split()))
  if m == 1:
    pos = r[q-1]
    c[:pos] = [min(q, v) for v in c[:pos]] 
    r[q-1] = 1
    if q not in [1,n]:
      count -= max(0, pos - 2)
  else:
    pos = c[q-1]
    r[:pos] = [min(q, v) for v in r[:pos]]
    c[q-1] = 1
    if q not in [1,n]:
      count -= max(0, pos-2)
print(count)
Problem p02659 (python)

Fixed submission:
from sys import stdin
input = stdin.readline


a, b = map(str, input().split())
a = int(a)
b = int((float(b) + 0.001) * 100)
ans = int(a * b // 100)
print(ans)

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


a, b = map(str, input().split())
a = int(a)
b = int((float(b) + 0.001) * 100)
ans = int(a * b // 100)
print(ans)

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

a, b = map(str, input().split())
a = int(a)
b = int(float(b + 0.001) * 100)
ans = int(a * b // 100)
print(ans)
Problem p02693 (python)

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

if ((A // K != B // K) or A % K == 0 or B % K == 0):
	print('OK')
else:
	print('NG')

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

if ((A // K != B // K) || A % K == 0 || B % K == 0):
	print('OK')
else:
	print('NG')
Problem p02547 (python)

Fixed submission:
N = int(input())
Di = 0
Di1 = []
Di2 = []
nmDi = 0
if N >= 3 and N <= 100:
   for x in range(N):
      Di = input()
      Di1.append(Di[0])
      Di2.append(Di[-1])
   for x in range(N):
      if Di1[x] == Di2[x]:
         nmDi += 1
         if nmDi == 3:
            break
      elif Di1[x] != Di2[x] and nmDi > 0:
         nmDi = 0
   if nmDi >= 3:
      print("Yes")
   else:
      print("No")
else:
   print ("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
Di1 = []
Di2 = []
nmDi = 0
if N >= 3 and N <= 100:
   for x in range(N):
      Di1.append(int(input()))
      Di2.append(int(input()))
   for x in range(N):
      if Di1[x] == Di2[x]:
         nmDi += 1
         if nmDi == 3:
            break
      elif Di1[x] != Di2[x] and nmDi > 0:
         nmDi = 0
   if nmDi >= 3:
      print("Yes")
   else:
      print("No")
else:
   print ("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
Di1 = []
Di2 = []
nmDi = 0
if N >= 3 and N <= 100:
   for x in range(N):
      Di1.append(int(input()))
      Di2.append(int(input()))
   for x in range(N):
      if Di1[x] == Di2[x]:
         nmDi += 1
         if nmDi == 3:
            break
      elif Di1[x] != Di2[x] and nmDi > 0:
         nmDi = 0
   if nmDi >= 3:
      print("Yes")
   else:
      print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
Di1 = []
Di2 = []
nmDi = 0
if N >= 3 and N <= 100:
   for x in range(N):
      Di1.append(int(input()))
      Di2.append(int(input()))
for x in range(N):
   if Di1[x] == Di2[x]:
      nmDi += 1
      if nmDi == 3:
         break
   elif Di1[x] != Di2[x] and nmDi > 0:
      nmDi = 0
if nmDi >= 3:
   print("Yes")
else:
   print("No")
Problem p02679 (python)

Fixed submission:
from collections import defaultdict
from math import gcd

N = int(input())
X = [list(map(int, input().split())) for _ in range(N)]

d = {}
for a, b in X:
    if a == b == 0:
        pass
    elif a == 0:
        if b > 0:
            b = 1
        else:
            b = -1
    elif b == 0:
        if a > 0:
            a = 1
        else:
            a = -1
    else:
        v = gcd(a, b)
        a //= v
        b //= v

    if (a > 0 and b >= 0) or (a < 0 and b <= 0):
        pair = (abs(a), abs(b))
        if pair not in d:
            d[pair] = [0, 0]
        d[pair][0] += 1
    else:
        pair = (abs(b), abs(a))
        if pair not in d:
            d[pair] = [0, 0]
        d[pair][1] += 1

mod = 10 ** 9 + 7
zero = 0
ans = 1
for p in d:
    if p == (0, 0):
        zero = d[p][1]
    else:
        a, b = d[p]
        ans *= pow(2, a, mod) + pow(2, b, mod) - 1
        ans %= mod
        
print((ans + zero - 1) % mod)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from math import gcd

N = int(input())
X = [list(map(int, input().split())) for _ in range(N)]

d = {}
for a, b in X:
    if a == b == 0:
        pass
    elif a == 0:
        if b > 0:
            b = 1
        else:
            b = -1
    elif b == 0:
        if a > 0:
            a = 1
        else:
            a = -1
    else:
        v = gcd(a, b)
        a //= v
        b //= v

    if a * b >= 0:
        pair = (abs(a), abs(b))
        if pair not in d:
            d[pair] = [0, 0]
        d[pair][0] += 1
    else:
        pair = (abs(b), abs(a))
        if pair not in d:
            d[pair] = [0, 0]
        d[pair][1] += 1

mod = 10 ** 9 + 7
zero = 0
ans = 1
for p in d:
    if p == (0, 0):
        zero = d[p]
    else:
        a, b = d[p]
        ans *= pow(2, a, mod) + pow(2, b, mod) - 1
        
print(ans + zero - 1)
Problem p02763 (python)

Fixed submission:
N = int(input())
S = list(input())
Q = int(input())
X = [input().split() for _ in range(Q)]


class BIT:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
        
    def sum(self, i):
        if i == 0:
            return 0
        
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
    
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


MAX = 5 * 10 ** 5 + 2
d = dict()

for c in range(ord("a"), ord("z") + 1):
    s = chr(c)
    d[s] = BIT(MAX)
    for i, v in enumerate(S):
        if v == s:
            d[s].add(i + 1, 1)


for t, i, c in X:
    if t == "1":
        i = int(i)
        
        if S[i - 1] != c:
            # Delete index
            d[S[i - 1]].add(i, -1)
            
            # Insert index
            d[c].add(i, 1)
            S[i - 1] = c
    else:
        l = int(i)
        r = int(c)
        
        res = 0
        for c in range(ord("a"), ord("z") + 1):
            s = chr(c)
            res += int(d[s].sum(r) - d[s].sum(l - 1) > 0)

        print(res)

Buggy submission (verdict: Runtime Error):
from bisect import bisect_left
from collections import defaultdict

N = int(input())
S = input()
Q = int(input())
X = [input().split() for _ in range(Q)]

d = defaultdict(list)
for i in range(N):
    d[S[i]].append(i + 1)
    
ss = list(S)
for t, i, c in X:
    if t == "1":
        i = int(i)
        
        # Delete index
        d[ss[i - 1]].remove(i)
        ss[i - 1] = c

        # Insert index
        d[c].insert(bisect_left(d[c], i), i)
    else:
        l = int(i)
        r = int(c)
        
        res = 0
        for key in d:
            l_idx = bisect_left(d[key], l)
            r_idx = bisect_left(d[key], r)
            res += int((l_idx < r_idx) or (l_idx == 0 and l <= d[key][l_idx] <= r))

        print(res)

Buggy submission (verdict: Runtime Error):
from bisect import bisect_left
from collections import defaultdict

N = int(input())
S = input()
Q = int(input())
X = [input().split() for _ in range(Q)]

d = defaultdict(list)
for i in range(N):
    d[S[i]].append(i + 1)

for t, i, c in X:
    if t == "1":
        i = int(i)
        
        # Delete index
        for key in d:
            if i in d[key]:
                d[key].remove(i)

        # Insert index
        d[c].insert(bisect_left(d[c], i), i)
    else:
        l = int(i)
        r = int(c)
        
        res = 0
        for key in d:
            l_idx = bisect_left(d[key], l)
            r_idx = bisect_left(d[key], r)
            res += int((l_idx < r_idx) or (l_idx == 0 and l <= d[key][l_idx] <= r))

        print(res)
Problem p02990 (python)

Fixed submission:
MOD = 10 ** 9 + 7
N, K = map(int, input().split())

def comb(n, k):
    ret = 1
    for i in range(1, k + 1):
        ret = ret * (n - i + 1) % MOD        
        ret = ret * pow(i, MOD - 2, MOD) % MOD
    return ret

for i in range(1, K + 1):
    n = i - 1 + 2
    k = N - K - (i - 1)
    if k < 0:
        print(0)
    else:
        ans = comb(n + k - 1, k) * comb(K - 1, i - 1) % MOD
        print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial
MOD = 10 ** 9 + 7

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

def rep_perm(n, k):
    if n == 0:
        return 1
    
    ans = factorial(n + k - 1) % MOD
    ans *= pow(factorial(n - 1), MOD - 2, MOD)
    ans %= MOD
    ans *= pow(factorial(k), MOD - 2, MOD)
    ans %= MOD
    return ans

for i in range(1, K + 1):
    ans = rep_perm(i + 1, N - K - i + 1)
    if i != 1:
        ans *= (K - i + 1)
    print(ans)
Problem p03013 (python)

Fixed submission:
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

B = [-1] + A + [N + 1]
B = [B[i + 1] - B[i] - 2 for i in range(M + 1)]

total = max(B)
dp = [1, 1] + [0] * (total - 1)
for i in range(total - 1):
    dp[i + 2] = (dp[i + 1] + dp[i]) % (10 ** 9 + 7)
        
ans = 1
for i in range(M + 1):
    ans *= dp[B[i]]
    ans %= 10 ** 9 + 7
print(ans if -1 not in B[1:] else 0)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

B = [-1] + A + [N + 1]
B = [B[i + 1] - B[i] - 2 for i in range(M + 1)]

total = max(B)
dp = [0] * (total + 1)
dp[0] = 1
dp[1] = 1

for i in range(total - 1):
    dp[i + 2] = (dp[i + 1] + dp[i]) % (10 ** 9 + 7)
        
ans = 1
for i in range(M + 1):
    ans *= dp[B[i]]
    ans %= 10 ** 9 + 7
print(ans if -1 not in B[1:] else 0)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

B = [-1] + A + [N + 1]
B = [B[i + 1] - B[i] - 2 for i in range(M + 1)]

total = max(B)
dp = [0] * (total + 1)
dp[0] = 1
dp[1] = 1

for i in range(total - 1):
    dp[i + 2] = (dp[i + 1] + dp[i]) #% (10 ** 9 + 7)
        
ans = 1
for i in range(M + 1):
    ans *= dp[B[i]]
    ans %= 10 ** 9 + 7
print(ans if -1 not in B[1:] else 0)
Problem p03077 (python)

Fixed submission:
N, *x = map(int, open(0))
print(4 - (-N // min(x)))

Buggy submission (verdict: Runtime Error):
N, *x = map(int, input(0))
print(5 + (N // min(x)))

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [int(input()) for _ in range(N)]
print(len(x) + (N // min(x)))

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [int(i) for i in input()]
print(len(x) + (N // min(x)))
Problem p03107 (python)

Fixed submission:
s = input()
print(2 * min([sum([v == '1' for v in s]), sum([v == '0' for v in s])]))

Buggy submission (verdict: Runtime Error):
s = input()
l = len(s)

def df(s):
  while True:
    if '01' in s or '10' in s:
      s = s.replace('01', '')
      s = s.replace('10', '')
    else:
      break
  return s

if len(s) < 1000:
  print(l - len(df(s)))
else:
  i = l // 4
  sx = df(s[:i]) + df[i:i * 2] + df[i * 2:i * 3] + df[i * 3:]
  print(l - len(df(sx)))
Problem p03127 (python)

Fixed submission:
def gcd(x, y):
  if x < y:
    a = y
    y = x
    x = a
  
  while y > 0:
    r = x % y
    x = y
    y = r
  
  return x

def main():
  N = int(input())
  a = list(map(int, input().split()))
  r = a[0]
  
  for i in range(1, len(a)):
    r = gcd(r, a[i])
    if r == 1:
      break

  print(r)
    

if __name__ == '__main__':
  main()

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

N, *A = map(int, open(0).read().split())

ans = A[0]
for v in A[1:]:
    ans = gcd(ans, v)
    
print(ans)
Problem p03221 (python)

Fixed submission:
N, M = map(int, input().split())
P, Y = zip(*(map(int, input().split()) for _ in range(M)))
ans = ['' for _ in range(M)]
c = [1 for _ in range(N + 1)]

for i, t in sorted(enumerate(zip(P, Y)), key=lambda x: x[1][1]):
  ans[i] = '{:06}{:06}'.format(t[0], c[t[0]])
  c[t[0]] += 1
  
print('\n'.join(ans))

Buggy submission (verdict: Runtime Error):

N, M = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(M)]

res = [""] * M
ctr = [0] * (M + 1)
for i, (p, y) in sorted(enumerate(X), key=lambda x: (x[1][0], x[1][1])):
    ctr[p] += 1
    res[i] = "{:0>6}{:0>6}".format(p, ctr[p])

print(*res, sep="\n")
Problem p03291 (python)

Fixed submission:
S = input()

MOD = 10 ** 9 + 7
N = len(S)
dp = [[0] * 4 for _ in range(N + 1)]
dp[-1][-1] = 1

for i in reversed(range(N)):
    m = 3 if S[i] == '?' else 1
    for j in reversed(range(3)):
        dp[i][j] = m * dp[i + 1][j]
        if S[i] == '?' or S[i] == 'ABC'[j]:
            dp[i][j] += dp[i + 1][j + 1]
        dp[i][j] %= MOD
    
    # j == 3
    dp[i][3] = m * dp[i + 1][3] % MOD
            
print(dp[0][0] % MOD)

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

MOD = 10 ** 9 + 7
N = len(S)
dp = [[0] * 4 for _ in range(N + 1)]
dp[-1][-1] = 1

for i in reversed(range(N)):
    m = 3 if S[i] == '?' else 1
    for j in reversed(range(3)):
        dp[i][j] = m * dp[i + 1][j]
        if S[i] == '?' or S[i] == 'ABC'[j]:
            dp[i][j] += m2 * dp[i + 1][j + 1]
        dp[i][j] %= MOD
    
    # j == 3
    dp[i][3] = m * dp[i + 1][3] % MOD
            
print(dp[0][0] % MOD)
Problem p03634 (python)

Fixed submission:
from collections import defaultdict
from heapq import heappop, heappush

N = int(input())
edges = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())

graph = defaultdict(set)
for v, w, c in edges:
    graph[v].add((w, c))
    graph[w].add((v, c))

dp = [-1] * (N + 1)
pq = []

# Initialization
dp[K] = 0
heappush(pq, (0, K))

while pq:
    cost, u = heappop(pq)
    
    for w, c in graph[u]:
        if dp[w] > -1:
            continue

        dp[w] = dp[u] + c
        heappush(pq, (dp[w], w))

for _ in range(Q):
    x, y = map(int, input().split())
    print(dp[x] + dp[y])

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

N = int(input())
edges = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())

graph = defaultdict(set)
for v, w, c in edges:
    graph[v].add((w, c))
    graph[w].add((v, c))

INF = 10 ** 9 + 7
dp = [INF] * (N + 1)
visited = [False] * (N + 1)

def dfs(v, p, d):    
    dp[v] = d
    visited[v] = True
    for j, c in graph[v]:
        if j == p or visited[j]:
            continue
        dfs(j, v, d + c)

dfs(K, 0, 0)

for _ in range(Q):
    x, y = map(int, input().split())
    print(dp[x] + dp[y])

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

N = int(input())
edges = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())

graph = defaultdict(set)
for v, w, c in edges:
    graph[v].add((w, c))
    graph[w].add((v, c))

INF = 10 ** 9 + 7
dp = [INF] * (N + 1)
visited = [False] * (N + 1)

def dfs(v, p, d):    
    dp[v] = d
    visited[v] = True
    for j, c in graph[v]:
        if j == p:
            continue
        dfs(j, v, d + c)

dfs(K, 0, 0)

for _ in range(Q):
    x, y = map(int, input().split())
    print(dp[x] + dp[y])
Problem p03775 (python)

Fixed submission:
from math import sqrt
N = int(input())
ans = []
for i in range(1, int(sqrt(N)) + 1):
    if i * (N // i) == N:
        ans.append(max(len(str(i)), len(str(N // i))))
print(min(ans))

Buggy submission (verdict: Runtime Error):
from math import sqrt
N = int(input())
ans = []
for i in range(1, int(sqrt(N)) + 1):
    if i * (N // i) == N:
        ans.append(max(len(str(i)), len(str(N // i)))
print(min(ans))

Buggy submission (verdict: Runtime Error):
from math import sqrt
N = int(input())
ans = []
for i in range(1, int(sqrt(N))):
    if i * (N // i) == N:
        ans.append(max(len(str(i)), len(str(N // i))))
        
print(max(min(ans), 1))

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

N = int(input())
ans = []
for i in range(1, int(sqrt(N))):
    if i * (N // i) == N:
        ans.append(max(len(str(i)), len(str(N // i))))
        
print(min(ans))
Problem p02880 (python)

Fixed submission:
N=int(input())
result=0
for i in range(1,10):
  for j in range(1,10):
    if i*j==N:
      result=1
if result==1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
result=0
for i in range(1,10):
  for j in range(1,10):
    if i*j==N:
      result=1
if result=1:
  print('Yes')
else:
  print('No')
Problem p03072 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
ans = 1
for i in range(1,N):
  for j in range(i):
    if H[i] < H[j]:
      break
    if j == i-1:
      ans +=1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
ans = 1
for i in range(1,N):
  for j in range(i+1):
    if H[i] =< H[j]:
      break
    if j == i+1:
      ans +=1

print(ans)
Problem p03775 (python)

Fixed submission:
import math
N=int(input())
frac=[]
for i in range(1,math.floor(math.sqrt(N))+1):
  if N%i==0:
    frac.append(len(str(int(N/i))))
if N !=1:
  print(min(frac))
else:
  print(1)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
frac=[]
result=len(str(N))
for i in range(1,math.ceil(math.sqrt(N))):
  if N%i==0:
    frac.append(len(str(int(N/i))))

print(min(frac))
Problem p03038 (python)

Fixed submission:
import numpy as np
n, m = (int(i) for i in input().split())
a = np.sort(np.array([int(i) for i in input().split()], dtype='int64'))
b, c = np.zeros(m, dtype='int64'), np.zeros(m, dtype='int64')
for i in range(m):
    b[i], c[i] = (int(i) for i in input().split())

b = b[np.argsort(-c)]
c = c[np.argsort(-c)]
i = 0
for bb, cc in zip(b, c):
    for cnt in range(bb):
        if a[i] < cc:
            a[i] = cc
        else:
            break
        i = i + 1
        if i >= len(a):
            break
    else:
        continue
    break
print(int(sum(a)))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = (int(i) for i in input().split())
a = np.sort(np.array([float(i) for i in input().split()]))
b, c = np.zeros(m), np.zeros(m)
for i in range(m):
    b[i], c[i] = (float(i) for i in input().split())

b = b[np.argsort(-c)]
c = c[np.argsort(-c)]
i = 0
for bb, cc in zip(b, c):
    for cnt in range(int(bb)):
        if a[i] < cc:
            a[i] = cc
        else:
            break
        i = i + 1
    else:
        continue
    break
print(int(sum(a)))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = (int(i) for i in input().split())
a = np.sort(np.array([int(i) for i in input().split()]))
b, c = np.zeros(m), np.zeros(m)
for i in range(m):
    b[i], c[i] = (int(i) for i in input().split())

b = b[np.argsort(-c)]
c = c[np.argsort(-c)]
i = 0
for bb, cc in zip(b, c):
    for cnt in range(int(bb)):
        if a[i] < cc:
            a[i] = cc
        else:
            break
        i = i + 1
    else:
        continue
    break
print(sum(a))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = (int(i) for i in input().split())
a = np.sort(np.array([int(i) for i in input().split()]))
b, c = np.zeros(m), np.zeros(m)
for i in range(m):
    b[i], c[i] = (int(i) for i in input().split())

b = b[np.argsort(-c)]
c = c[np.argsort(-c)]
i = 0
for bb, cc in zip(b, c):
    for cnt in range(int(bb)):
        if a[i] < cc:
            a[i] = cc
        else:
            break
        i = i + 1
    else:
        continue
    break
print(sum(a))
Problem p02595 (python)

Fixed submission:
N,D = map(int,input().split())
X=[]
Y=[]
count = 0
for i in range(N):
    a,b = map(float,input().split())
    X.append(a)
    Y.append(b)
for i in range(N):
    if (X[i]**2+Y[i]**2)**(1/2) <= D:
        count += 1

print(count)

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

r = 1
N = 0
while True:
    N += 7*(10**(r-1))
    if N%K ==0:
        break
    r += 1

print(r)

Buggy submission (verdict: Runtime Error):
N,D = map(int,input().split())
X=[]
Y=[]
count = 0
for i in range(N):
    a,b = map(float,input().split())
    X.append(a)
    Y.append(b)
for i in range(N):
    if (X[i]^2+Y[i]^2)^(1/2) <= D:
        count += 1

print(count)
Problem p02596 (python)

Fixed submission:
K = int(input())

for i in range(K):
    if i == 0:
        N= 7%K
    else:
        N = (10*N+7)%K
    if N == 0:
        print(i+1)
        break
else:
    print(-1)

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

for i in range(K):
    if i = 0:
        N= 7%K
    else:
        N = (10*N+7)%K
    if N == 0:
        print(i+1)
        break
else:
    print(-1)

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

for i in range(K):
    if i = 0:
        N= 7%K
    else:
        N = (10*N+7)%K
    if N == 0:
        print(i)
        break
else:
    print(-1)
Problem p02627 (python)

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

Buggy submission (verdict: Runtime Error):
str = input()
if str.isupper()==TRUE:
  print("A")
else:
  print("a")
Problem p02831 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    a, b = LI()
    gcd = fractions.gcd(a, b)
    print(a*b//gcd)

main()

Buggy submission (verdict: Runtime Error):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    a, b = LI()
    gcd = math.gcd(a, b)
    print(a*b//gcd)
        

main()