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

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
    print(s)
else:
    print('red')

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

N, Q = map(int, input().split())
edge = defaultdict(list)
for i in range(N-1):
    a, b = map(int, input().split())
    edge[a].append(b)
    edge[b].append(a)

cnt = [0]*(N+1)
for i in range(Q):
    p, x = map(int, input().split())
    cnt[p] += x

root_node = (1, -1) # (id, value, parent_id)
open_list = [root_node]
closed_list = []
while True:
    if len(open_list) == 0:
        break
    cur_node = open_list.pop()
    cur_id, parent_id = cur_node
    if not(parent_id == -1):
        cnt[cur_id] += cnt[parent_id]
    for child_id in edge[cur_id]:
        if child_id == parent_id:
            continue
        open_list.append((child_id, cur_id))
print(*cnt[1:])
Problem p03107 (python)

Fixed submission:
S = list(input())
n0 = S.count('0')
n1 = S.count('1')
print(2*min(n0, n1))

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

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

if s <= w:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(20000*20000)

S = str(input())
ans = set()
check = set()

def dfs(i, j):
    if (i, j) in check:
        return
    else:
        check.add((i, j))
    if int(S[i:j+1])%2019 == 0:
        ans.add((i, j))
    if j == len(S)-1:
        return

    dfs(i+1, j+1)
    dfs(i, j+1)

if len(S) < 4:
    print(0)

else:
    dfs(0, 3)
    print(len(ans))
Problem p02695 (python)

Fixed submission:
n, m, q = map(int, input().split())   
a = []
for i in range(10):
  a.append(1)
max = 0
inp = []
for i in range(q):
  ta,tb,tc,td = map(int,input().split())
  inp.append((ta,tb,tc,td))
for i1 in range(1,m+1):
  a[0] = i1
  for i2 in range(i1,m+1):
    a[1] = i2
    for i3 in range(i2,m+1):
      a[2] = i3
      for i4 in range(i3,m+1):
        a[3] = i4
        for i5 in range(i4,m+1):
          a[4] = i5
          for i6 in range(i5,m+1):
            a[5] = i6
            for i7 in range(i6,m+1):
              a[6] = i7
              for i8 in range(i7,m+1):
                a[7] = i8
                for i9 in range(i8,m+1):
                  a[8] = i9
                  for i10 in range(i9,m+1):
                    a[9] = i10
                    sum = 0
                    if q != 1:
                      for i in range(q):
                        if a[inp[i][1]-1] - a[inp[i][0]-1] == inp[i][2]:
                          sum = sum + inp[i][3]
                        if sum > max:
                          max = sum
                    else:
                      if a[inp[0][1]-1] - a[inp[0][0]-1] == inp[0][2]:
                          sum = sum + inp[0][3]
                      if sum > max:
                          max = sum

print(max)

Buggy submission (verdict: Runtime Error):
n, m, q = map(int, input().split())   
a = []
for i in range(10):
  a.append(1)
max = 0
inp = []
for i in range(q):
  ta,tb,tc,td = map(int,input().split())
  inp.append((ta,tb,tc,td))
for i1 in range(1,m+1):
  a[0] = i1
  for i2 in range(i1,m+1):
    a[1] = i2
    for i3 in range(i2,m+1):
      a[2] = i3
      for i4 in range(i3,m+1):
        a[3] = i4
        for i5 in range(i4,m+1):
          a[4] = i5
          for i6 in range(i5,m+1):
            a[5] = i6
            for i7 in range(i6,m+1):
              a[6] = i7
              for i8 in range(i7,m+1):
                a[7] = i8
                for i9 in range(i8,m+1):
                  a[8] = i9
                  for i10 in range(i9,m+1):
                    a[9] = i10
                    sum = 0
                    for i in range(q):
                      if a[inp[i][1]] - a[inp[i][0]] == inp[i][2]:
                        sum = sum + inp[i][3]
                      if sum > max:
                        max = sum

print(max)
Problem p02793 (python)

Fixed submission:
from fractions import gcd
from functools import reduce
     
mod = 10 ** 9 + 7
     
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
     
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)
     
    # print('input >>')
N = int(input())
A = list(map(int,(input().split())))
     
lcmn = lcm(A)
    
ans = 0
for i in range(len(A)):
    ans += lcmn // A[i]
     
    # print('-----output-----')
print(int(ans%mod))

Buggy submission (verdict: Runtime Error):
    from fractions import gcd
    from functools import reduce
     
    mod = 10 ** 9 + 7
     
    def lcm_base(x, y):
        return (x * y) // gcd(x, y)
     
    def lcm(numbers):
        return reduce(lcm_base, numbers, 1)
     
    # print('input >>')
    N = int(input())
    A = list(map(int,(input().split())))
     
    lcmn = lcm(A)
     
    ans = 0
    for i in range(len(A)):
        ans += lcmn // A[i]
     
    # print('-----output-----')
    print(int(ans%mod))
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())

print (6-a-b)

Buggy submission (verdict: Runtime Error):
str = list(map(int, input().split()))
a = str[0]
b = str[1]
i = 1
if a < b:
  big = b
  small = a
else:
  big = a
  small = b

while i != 0:
  i = big % small
  big = small
  small = i

print (int(a*b/big))
Problem p03011 (python)

Fixed submission:
l = list(map(int, input().split()))
print(min([sum(l) - l[i] for i in range(len(l))]))

Buggy submission (verdict: Runtime Error):
print(min([sum(l) - l[i] for i in range(len(list(map(int, input().split()))))]))
Problem p03013 (python)

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

mod = 1000000007

DP = [-1] * (N + 1) 
DP[0] = 1 
DP[1] = 1 

def fib(n):
    for i in range(2, n + 1):
        DP[i] = DP[i-1] + DP[i-2]
    
    return DP[n]

ans = 1
x = 0

for a in a_list:
    if a == x:
        ans = 0
        break
    
    ans = (ans * fib((a-1)-x)) % mod
    x = a+1
else:
    ans = (ans * fib(N-x)) % mod
    
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)

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

mod = 1000000007
  
ans = 1
result = {0:1, 1:1}

def fib(x):
    if(result.get(x)):
        return result.get(x)
    
    if x == 0 or x == 1:
        return result[x]
    else:
        a = fib(x - 1)
        result[x-1] = a
        b = result.get(x-2)
        
        return a + b

x = 0

for a in a_list:
    if a == x:
        ans = 0
        break
    
    ans = (ans * fib((a-1)-x)) % mod
    x = a+1
else:
    ans = (ans * fib(N-x)) % mod

print(ans)

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

mod = 1000000007
  
ans = 1
result = {0:1, 1:1}

def fib(x):
    if x == 0 or x == 1:
        return result[x]
    else:
        a = result.get(x-1) if result.get(x-1) else fib(x - 1)
        result[x-1] = a
        b = result.get(x-2)
        
        return a + b

x = 0

for a in a_list:
    if a == x:
        ans = 0
        break
    
    ans = (ans * fib((a-1)-x)) % mod
    x = a+1
else:
    ans = (ans * fib(N-x)) % mod

print(ans)

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

mod = 1000000007
  
ans = 1

def fib(x):
    if x == 0 or x == 1:
        return 1
    else:
        return (fib(x - 1) + fib(x - 2))

x = 0

for a in a_list:
    if a == x:
        ans = 0
        break
    
    ans = (ans * fib((a-1)-x)) % mod
    x = a+1
else:
    ans = (ans * fib(N-x)) % mod

print(ans)
Problem p02831 (python)

Fixed submission:
a,b = map(int,input().split())
 
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a


def lcm(a,b):
    return a*b//gcd(a,b)

print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
import numpy as np

a,b = map(int,input().split())

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

print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())

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

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

Fixed submission:
import sys

n = int(input())
nums = list(map(int,input().split()))

number = 1
count = 0

if 1 not in nums:
    print(-1)
    sys.exit()

for num in nums:
    if num == number:
        number += 1
    else:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
import sys

n = int(input())
nums = list(map(int,input().split()))

number = 1
count = 0

if 1 not in nums:
    print(-1)
    sys.exit()

while len(nums) > 0:
    try:
        idx = nums.index(number)
    except ValueError:
        break
    count += idx
    nums = nums[idx+1:]
    print(nums)
    number += 1

print(count)
Problem p03038 (python)

Fixed submission:
import heapq

n,m = map(int,input().split())
a_list = list(map(int,input().split()))
move = [list(map(int,input().split())) for _ in range(m)]

heapq.heapify(a_list)
move = sorted(move, key=lambda x: x[1],reverse=True)

for elem in move:
    for i in range(elem[0]):
        _min = heapq.heappop(a_list)
        if _min < elem[1]:
            heapq.heappush(a_list,elem[1])
        else:
            heapq.heappush(a_list,_min)
            break

print(sum(a_list))

Buggy submission (verdict: Runtime Error):
import heapq

n,m = map(int,input().split())
a_list = list(map(int,input().split()))
move = [list(map(int,input().split())) for _ in range(m)]

heapq.heapify(a_list)
a_list = sorted(a_list, key=lambda x: x[1],reverse=True)

for elem in move:
    for i in range(elem[0]):
        _min = heapq.heappop(a_list)
        if _min < elem[1]:
            heapq.heappush(a_list,elem[1])
        else:
            heapq.heappush(a_list,_min)
            break

print(sum(a_list))
Problem p02790 (python)

Fixed submission:
N, M = input().split()
a = N*int(M)
b = M*int(N)
print(sorted([a,b])[0])

Buggy submission (verdict: Runtime Error):
O, K = input().split()
i = O*int(k)
u = K*int(O)
print(sorted([i,u])[0])

Buggy submission (verdict: Runtime Error):
O,K = input().split()
I = O*int(k)
U = K*int(O)
print(sorted([I,U])[0])
Problem p02729 (python)

Fixed submission:
def fact(n):
    if n < 0:
        return 0
    if n == 0:
        return 1
    if n == 1:
        return 1
    return n * fact(n-1)

def combination(n, k):
    if n < k:
        return 0
    return fact(n) / ( fact(n-k) * fact(k))

n, m = [int(x) for x in input().split()]
answer = int(combination(n, 2) + combination(m, 2))
print(answer)

Buggy submission (verdict: Runtime Error):
def combination(n, k):
	return fact(n) / ( fact(n-k) * fact(k) )

def fact(n):
	if n < 0:
		return 0
	if n == 0:
		return 1
	if n == 1:
		return 1
	return fact(n-1)

n, m = [int(x) for x in input().split()]
answer = combination(n, 2) + combination(m, 2)
print(answer)
Problem p02682 (python)

Fixed submission:
A,B,C,K=map(int,input().split())
if (A>=K):
	print(K)
else:
	K = K-A
	if (B>=K):
		print(A)
	else:
		K = K-B
		print(A-K)

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
if (A>=K):
	print(K)
else:
	K = K-A
	if (B>=D):
		print(A)
	else:
		K = K-B
		print(A-K)

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
if (A>=K):
  print(K)
else:
  K = K-A
  if (B>=D):
    print(A)
  else:
    K = K-B
    print(A-K)
Problem p03041 (python)

Fixed submission:
n, k = map(int, input().split())
k -= 1
s = input()
c = s[k]
s = s[:k] + chr(ord(c) - ord('A') + ord('a')) + s[k + 1:]
print(s)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
c = s[k]
s = s[:k] + chr(ord(c) - ord('A') + ord('a')) + s[k + 1:]
print(s)
Problem p02685 (python)

Fixed submission:
#E
n,m,k = list(map(int,input().split()))
fac = [1]*n
finv = [1]*n
inv = [1]*n
MOD = 998244353
for i in range(2,n):
    fac[i] = fac[i-1]*i%MOD
    inv[i] = MOD-inv[MOD%i]*(MOD//i)%MOD
    finv[i] = finv[i-1]*inv[i]%MOD
def comb(n,k):
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD

ans = 0
for i in range(k+1):
#     print(comb(n-1,i),m*(m-1)**(n-i-1))
    ans += comb(n-1,i)*m*pow(m-1,n-i-1,MOD)%MOD
    ans %= MOD
print(ans)

Buggy submission (verdict: Runtime Error):
#E
n,m,k = list(map(int,input().split()))
fac = [1,1]
finv = [1,1]
inv = [1,1]
MOD = 998244353
for i in range(2,n):
    fac[i].append(fac[i-1]*i%MOD)
    inv[i].append(MOD-inv[MOD%i]*(MOD//i)%MOD)
    finv[i].append(finv[i-1]*inv[i]%MOD)
def comb(n,k):
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD
ans = 0
for i in range(k+1):
#     print(comb(n-1,i),m*(m-1)**(n-i-1))
    ans += (comb(n-1,i)*(m*(m-1)**(n-i-1)%MOD))%MOD
    ans %= MOD
print(ans)
Problem p02862 (python)

Fixed submission:
# n+2m=i
# 2n+m=j
# (4n+2m=2j)
# n=(2j-i)/3
# m=(2i-j)/3
# n+m C n (n+m)!/n!/m!

MOD = 10**9+7
MAX = (10**6)*2+5
fac = [0]*MAX
inv = [0]*MAX
finv = [0]*MAX
def COMinit():
    fac[0]=1
    fac[1]=1
    finv[0]=1
    finv[1]=1
    inv[1]=1
    for i in range(2,MAX):
        fac[i] = fac[i-1]*i%MOD
        inv[i] = MOD - inv[MOD%i]*(MOD//i)%MOD
        finv[i] = finv[i-1]*inv[i]%MOD
def COM(n,k):
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD

x,y=list(map(int,input().split()))
if (2*y-x)%3!=0 or (2*x-y)%3!=0:
    print(0)
else:
    n=(2*y-x)//3
    m=(2*x-y)//3
    if n<0 or m<0:
        print(0)
    else:
        COMinit()
        print(COM(n+m,n))

Buggy submission (verdict: Runtime Error):
MOD = 10**9+7
fac = [0]*MOD
inv = [0]*MOD
finv = [0]*MOD
def COMinit():
    fac[0]=1
    fac[1]=1
    finv[0]=1
    finv[1]=1
    inv[1]=1
    for i in range(2,MOD):
        fac[i] = fac[i-1]*i%MOD
        inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD
        finv[i] = finv[i-1]*inv[i]%MOD
def COM(n,k):
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD

x,y=list(map(int,input().split()))
if (2*y-x)%3!=0 or (2*x-y)%3!=0:
    print(0,'NO')
else:
    n=(2*y-x)//3
    m=(2*x-y)//3
    COMinit()
    print(COM(n+m,n))
Problem p02712 (python)

Fixed submission:
n = int(input())
fizzbuzz = [i for i in range(n+1) if i%5!=0 and i%3!=0]
print(sum(fizzbuzz))

Buggy submission (verdict: Runtime Error):
n = int(input())
fizzbuzz = [i for i in range(n+1) if i%5!=0 and i%3!=0]
print(sum(fizzbuss))
Problem p02753 (python)

Fixed submission:
s = input()
if s=="AAA" or s=="BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
A,B = map(int,input().split())
if A<13:
  print(-1)
  sys.exit()
last = 2000

for i in range(last):
  mA = int(i*0.08)
  mB = int(i*0.10)
  print(mA,mB,i)

  
  if mA==A and mB==B:
    print("match")
    print(i)
    break
  if i==last-1:
    print("-1")
Problem p02688 (python)

Fixed submission:
N,K=(int(x) for x in input().split())
lists=[0]*N
while 1:
    try:
        tmp=int(input())
    except :
        break
    have_count=(int(x) for x in input().split())
    for i in have_count:
        lists[i-1]=1
print(lists.count(0))

Buggy submission (verdict: Runtime Error):
N,K=(int(x) for x in input().split())
lists=[0]*N
while 1:
    tmp=int(input())
    if not tmp:
        break
    have_count=(int(x) for x in input().split())
    for i in have_count:
        lists[i-1]=1
print(lists.count(0))

Buggy submission (verdict: Runtime Error):
N,K=int(int(x) for x in input().split())
lists=[0]*N
while 1:
    tmp=int(input())
    if not tmp:
        break
    have_count=int(input().split())
    for i in have_count:
        lists[i-1]=1
print(lists.count(0))

Buggy submission (verdict: Runtime Error):
N,K=int(input().split())
lists=[0]*N
while 1:
    tmp=int(input())
    if not tmp:
        break
    have_count=int(input().split())
    for i in have_count:
        lists[i-1]=1
print(lists.count(0))
Problem p02682 (python)

Fixed submission:
import math
A, B, C, K = list(map(int, input().split()))
if K <= A:
  print(K)
if A < K <= A + B:
  print(A)
if A + B < K <= A + B + C:
  print(A * 2 + B - K)

Buggy submission (verdict: Runtime Error):
import math
if K <= A:
  print(K)
if A < K <= A + B:
  print(A)
if A + B < K <= A + B + C:
  print(A * 2 + B - K)

Buggy submission (verdict: Runtime Error):
if K <= A:
  print(K)
if A < K <= A + B:
  print(A)
if A + B < K <= A + B + C:
  print(A * 2 + B - K)

Buggy submission (verdict: Runtime Error):
A = map(int(input()))
B = map(int(input()))
C = map(int(input()))
K = map(int(input()))
if K <= A + B:
  print(K)
else:
  print(A * 2 + B - K)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
K = int(input())
if K <= A + B:
  print(K)
else:
  print(A * 2 + B - K)

Buggy submission (verdict: Runtime Error):
int(input())
if K <= A + B:
  print(K)
else:
  print(A * 2 + B - K)

Buggy submission (verdict: Runtime Error):
input()
if K <= A + B:
  print(K)
else:
  print(A * 2 + B - K)

Buggy submission (verdict: Runtime Error):
A , B , C , K = int(input())
if K <= A + B:
  print(K)
else:
  print(A * 2 + B - K)

Buggy submission (verdict: Runtime Error):
if K <= A + B:
  print(K)
else:
  print(A * 2 + B - K)
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())
if 1 <= W <= 100 and 1 <= S <= 100 and W >= S :
  print ("unsafe")
if 1 <= W <= 100 and 1 <= S <= 100 and W < S :
  print("safe")

Buggy submission (verdict: Runtime Error):
if 1 <= W <= 100 and 1 <= S <= 100 and W >= S :
  print ("unsafe")
if 1 <= W <= 100 and 1 <= S <= 100 and W < S :
  print("safe")

Buggy submission (verdict: Runtime Error):
if W >= S :
  print ("unsafe")
if W < S :
  print("safe")
Problem p02682 (python)

Fixed submission:
A,B,C,K=map(int,input().split())
if A>=K:
  print(K)
elif (A+B)>=K:
  print(A)
else:
  print(A-(K-A-B))

Buggy submission (verdict: Runtime Error):
A,B,C,K=int(input().split())
if A>=K:
  print(K)
elif (A+B)>=K:
  print(A)
else:
  print(A-(K-A))
Problem p02693 (python)

Fixed submission:
K=int(input())
A,B=map(int,input().split())
for i in range(A,B+1,1):
  if i%K==0:
    print("OK")
    break
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
K=int(input())
A,B=map(int,input().split())
for (A;B;A++):
  if A%K==0:
    print("OK")
    break
else:
  print("NG")
Problem p02699 (python)

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

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

Fixed submission:
N=int(input())
SS=set()
while N!=0:
  S=input()
  SS.add(S)
  N=N-1
print(len(SS))

Buggy submission (verdict: Runtime Error):
N=int(input())
SS=set()
while N=0:
  S=input()
  SS.add(S)
  N=N-1
print(len(SS))

Buggy submission (verdict: Runtime Error):
N=int(input())
SS=set()
while N=0:
  S=input()
  SS.add(S)
  N=N-1
print(len(SS))

Buggy submission (verdict: Runtime Error):
N=int(input())
SS=set()
while N=0:
  S=input()
  SS.add(S)
  N=N-1
Problem p02701 (python)

Fixed submission:
#coding UTF-8
from collections import Counter
n= int(input())#1行目のNを取得する
l=[input()for i in range(n)] #複数行の数値の入力を取得
c=Counter(l)

print(len(c))

Buggy submission (verdict: Runtime Error):
#coding UTF-8
from collections import Counter
n= int(input())#1行目のNを取得する
l=[input()for i in range(n)] #複数行の数値の入力を取得
c=cCounter(l)

print(len(c))
Problem p02682 (python)

Fixed submission:
a, b, c, k = map(int, input().split())
if a >= k :
    print(k)
elif b >= (k-a):
    print(a)
else:
    print(a-k+a+b)

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if a >= k :
    print(2*k)
    elif b >= (k-a):
        print(2*a + k-a)
        else:
            print(2*a+k-a-(k-a-b))
Problem p02693 (python)

Fixed submission:
K = int(input())
A, B = map(int,input().split())
 
 
if A // K == B // K:
    if A % K ==0:
        print('OK')
    else:
        print('NG')  
else:
    print('OK')

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

if A//K == B//K:
  if A % K == 0:
    print("OK")
    else:
      print("NG")
      
  else:
    print("OK")

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

if A//K == A//K:
  if A % K == 0:
    print("OK")
    else:
      print("NG")
      
  else:
    print("OK")

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

if A//K == A//K:
  if A % K == 0:
    print("OK")
    else:
      print("NG")
else:
  print("OK")

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

if b//k == a//k:
  if a % k == 0:
    print("OK")
    else:
      print("NG")
else:
  print("OK")

Buggy submission (verdict: Runtime Error):
k = int(input())
a, b = int(input())
if k<=b-a+1:
  print("OK")
  else:
    print("NG")

Buggy submission (verdict: Runtime Error):
k = int(input())
a, b = int(input())
if k<=b-a+1:
  print("OK")
  else:
    print("NG")

Buggy submission (verdict: Runtime Error):
k = int(input())
a, b = int(input())
if k<=(B-A+1):
  print("OK")
  else:
    print("NG")
Problem p02712 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
re=0
for i in range(1,n+1):
 if (i%3!=0) and (i%5!=0)
  re+=i
print(re)
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
str=input()
if (str[2]==str[3])&&(str[4]==str[5]):
 print("Yes")
else:
  print("No")
Problem p02699 (python)

Fixed submission:
s,w = (int(x) for x in input().split())
if s<=w:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
a,b,c,d = (int(x) for x in input().split())

x=int(a/d)+1
y=int(b/c)+1

if x>=y:
    print("Yes")
else:
    print("No")
Problem p02693 (python)

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

if k == 1:
  print('OK')
  exit( )
else:
  pass
  
num = a
for num in range(a,b+1):
    if num % k != 0:
        num += 1
    else:
        print('OK')
        break
else:
	print('NG')

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

num = (a-1)
while num <= b:
    num += 1
        if num % k != 0:
            continue
        else:
            print('OK')
            break
    else:
        print('NG')

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

num = (a-1)
while num <= b:
  num += 1
  	if num % k != 0:
      continue
    else:
      print('OK')
      break
  else:
    print('NG')
Problem p02693 (python)

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

sum=0
for i in range(A,B+1,1):
    
    if i%K==0:
        sum+=1
if sum>=1:
    print('OK')
else:
    print('NG')

Buggy submission (verdict: Runtime Error):
K= int(input())
A, B = map(int, input().split())
sum=0
for(int i = A; i <= B; i++)
    if i%K==0:
        sum+=1
if sum>=1:
    print('OK')
else:
    print('NG')
Problem p02766 (python)

Fixed submission:
N,K=map(int, input().split()) 
for i in range(8000):
    if K**i<=N<K**(i+1):
        print(i+1)

Buggy submission (verdict: Runtime Error):
N,K=map(int, input().split()) 
for i in　range(10)
	if K**i<=N<=K**(i+1):
    	print(i+1)
Problem p02707 (python)

Fixed submission:
def function(n, list1):
  ans = [0] * n
  for i in list1:
    ans[i - 1] += 1
  string = ""
  for i in range(len(ans)):
    if i < len(ans) - 1:
      string += str(ans[i]) + "\n"
    else:
      string += str(ans[i])
  return string
 
n = int(input())
list1 = input().split()
list1 = [int(i) for i in list1]
print(function(n, list1))

Buggy submission (verdict: Runtime Error):
def function(n, list1):
  ans = [0] * n
  for i in list1:
    ans[i - 1] += 1
  string = ""
  for i in range(len(ans)):
    if i < len(ans) - 1:
      string += ans[i] + "\n"
    else:
      string += ans[i]
  return string

n = int(input())
list1 = input().split()
list1 = [int(i) for i in list1]
print(function(n, list1))