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

Fixed submission:
from sys import stdin
#from collections import deque
#from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return list(mi())
def lsi():
    x=list(stdin.readline())
    x.pop()
    return x
def si(): return stdin.readline()
############# CODE STARTS HERE #############
n=ii()
s=[0]*n
a=li()
s[n-2]=abs(a[n-2]-a[n-1])
for i in range(n-3, -1, -1):
    s[i]=min(abs(a[i]-a[i+1])+s[i+1], abs(a[i]-a[i+2])+s[i+2])
print(s[0])

Buggy submission (verdict: Runtime Error):
from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return list(mi())
def lsi():
    x=list(stdin.readline())
    x.pop()
    return x
def si(): return stdin.readline()
############# CODE STARTS HERE #############
n=ii()
s=[0]*n
a=li()
s[n-2]=abs(a[n-2]-a[n-1])
for i in range(n-3, -1, -1):
    s[i]=min(abs(a[i]-a[i+1])+s[i+1], abs(a[i]-a[i+2])+s[i+2])
print(s[0])
Problem p04043 (python)

Fixed submission:
a, b, c= map(int, input().split())
if a+b+c==17 and a*b*c==175:
   print("YES")
else:
   print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c= map(int, input().split())
if a+b+c==17 && a*b*c==175:
   print("YES")
else:
   print("NO")
Problem p02612 (python)

Fixed submission:
def resolve():
    n = int(input())
    while n>0:
        n = n - 1000

    print(abs(n))
    
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    while n>0:
        n = n - 1000

    print(abs(n))
resolvea()
Problem p02628 (python)

Fixed submission:
def resolve():
    n,k = map(int, input().split())
    listA = list(map(int,input().split()))
    listA.sort()
    c = sum(listA[:k])
    print(c)
    
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n,k = map(int, input().split())
    listA = list(map(int,input().split()))
    listA.sort()
    c = sum(listA[:k])
    print(c
resolve()
Problem p02675 (python)

Fixed submission:
n = input()
n1 = int(n[-1])

hon = [2,4,5,7,9]
pon = [0,1,6,8]

if hon.count(n1):
    print('hon')
elif pon.count(n1):
    print('pon')
else:
    print('bon')

Buggy submission (verdict: Runtime Error):
k = int(input())
s = input()

print(s if len(s) <= k else s[0:k] + '...')
Problem p02741 (python)

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())
print(a[k-1])

Buggy submission (verdict: Runtime Error):
import math

h,w = list(map(int,input().split()))
x = (h*w)
if h ==1 or h == 1:
	print(1)
else:
	y = int(x /2)
	if x%2 == 0:
		print(y)
	else:
		print(y+1)
Problem p02760 (python)

Fixed submission:
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
result = 'No'

n = int(input())
for i in range(n):
	In = int(input())
    
	a1 = ['' if a1[j] == In else a1[j] for j in range(3)]
	a2 = ['' if a2[j] == In else a2[j] for j in range(3)]
	a3 = ['' if a3[j] == In else a3[j] for j in range(3)]
    
# tate
for i in range(3):
	if a1[i] == '' and a2[i] == '' and a3[i] == '':
		result = 'Yes'
		break
# yoko
if a1.count('') == 3:
		result = 'Yes'
if a2.count('') == 3:
		result = 'Yes'
if a3.count('') == 3:
		result = 'Yes'

# naname
if a1[0] == '' and a2[1] == '' and a3[2] == '':
		result = 'Yes'
    
if a1[2] == '' and a2[1] == '' and a3[0] == '':
		result = 'Yes'
print(result)

Buggy submission (verdict: Runtime Error):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
result = 'No'

n = int(input())
for i in range(n):
	In = int(input())
    
	a1 = ['' if a1[j] == In else a1[j] for j in range(3)]
	a2 = ['' if a2[j] == In else a2[j] for j in range(3)]
	a3 = ['' if a3[j] == In else a3[j] for j in range(3)]
    
# tate
for i in range(2):
	if a1[i] == '' and a2[i] == '' and a3[i] == '':
		result = 'Yes'
		break
# yoko
if a1.count('') == 3:
		result = 'Yes'
if a2.count('') == 3:
		result = 'Yes'
if a3.count('') == 3:
		result = 'Yes'

# naname
if a1[0] == '' and a2[1] == '' and a3[2] == '':
		result = 'Yes'
    
if a1[2] == '' and a2[1] == '' and a3[3] == '':
		result = 'Yes'
print(result)
Problem p02772 (python)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
result = "APPROVED"
for i in range(N):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            result = "DENIED"
            break
print(result)

Buggy submission (verdict: Runtime Error):
# 偶数かつ3または5で割り切れる

N = int(input())
a = list(map(int(input().split())))
for i in range(N):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            print("DENIED")
            exit(0)
print("APPROVED")
Problem p02801 (python)

Fixed submission:
C = input()
al = list("abcdefghijklmnopqrstuvwxyz")
print(al[al.index(C)+1])

Buggy submission (verdict: Runtime Error):
al = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 'q', 'u', 'v', 'w', 'x', 'y', 'z']
i = al.index(input())
print(al[i+1])
Problem p02909 (python)

Fixed submission:
s = input()
if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')

Buggy submission (verdict: Runtime Error):
const main = input =>{
    result = '';
    switch (input) {
        case 'Sunny':
            result = 'Cloudy';
            break;
        case 'Cloudy':
            result = 'Rainy';
            break;
        case 'Rainy':
            result = 'Sunny';
            break;
    }
    console.log(result);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
Problem p03101 (python)

Fixed submission:
h, w = list(map(int, input().split()))
dh, dw = list(map(int, input().split()))

print((h-dh) * (w-dw))

Buggy submission (verdict: Runtime Error):
N, M, C = list(map(int, input().split()))
b = list(map(int, input().split()))
count = 0

for i in range(N):
    a = list(map(int, input().split()))
    add = 0
    for j in range(M):
        add += a[j] * b[j]

    if add + C > 0:
        count += 1

print(count)
Problem p03206 (python)

Fixed submission:
d = int(input())
print('Christmas'+(' '+'Eve')*(25-d))

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [int(input()) for _ in range(n)]
print(sum(p) - int((max(p)/2)))
Problem p03219 (python)

Fixed submission:
x,y = list(map(int,input().split()))
print(x+(y//2))

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 1
ans_t = abs(A-(T-H[1]*0.006))
for i in range(N):
    if abs(A-(T-H[i]*0.006)) < ans_t:
        ans = i+1
        ans_t = abs(A-(T-H[i]*0.006))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

L = [abs(int(A-(T-i*0.006))) for i in H]
print(L.index(min(L))+1)
Problem p03220 (python)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 1
ans_t = abs(A-(T-H[1]*0.006))
for i in range(N):
    if abs(A-(T-H[i]*0.006)) < ans_t:
        ans = i+1
        ans_t = abs(A-(T-H[i]*0.006))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

L = [abs(A-(T-i*0.006)) for i in H]
print(L.index(min(L)+1))
Problem p03284 (python)

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

print(0 if a%b==0 else 1)

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

print(0 if a%b==0 else 1)
Problem p03469 (python)

Fixed submission:
s = input()
replace_num = '8'
print(s[:3]+replace_num+s[4:])

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

YH = -1
IH = -1
HN = -1

for a in range(n):
    for b in range(n-a):
         c = n-a-b
         total = 10000*a + 5000*b + 1000*c
         if total == y:
            YH = a
            IH = b
            HN = c

print(YH, IH, HN)
Problem p03473 (python)

Fixed submission:
m = int(input())
print(48-m)

Buggy submission (verdict: Runtime Error):
a,b = list(map(int,input().split()))
s = input()
num = s[:a] + s[a+1]
print('Yes' if s[a+1] == '-' and len(s) == a+b+1 and ('-' not in num) else 'No')
Problem p03624 (python)

Fixed submission:
s = input()
result = 'None'
for i in range(26):
    if chr(ord('a')+i) not in s:
        result = chr(ord('a')+i)
        break
print(result)

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

num = set(list(range(1, m + 1)))
for i in range(n):
    in_li = list(map(int, input().split()))
    num = num & set(in_li[1:])
print(len(num))
Problem p03844 (python)

Fixed submission:
a, o, b = list(input().split())
a,b = int(a),int(b)
print(a+b if o == '+' else a-b)

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

for i in range(m):
    p,x = list(map(int,input().split()))
    a = t.copy()
    a[p-1] = x
    print(sum(a))
Problem p03962 (python)

Fixed submission:
a = list(map(int, input().split()))
b = set(a)
print(len(b))

Buggy submission (verdict: Runtime Error):
n,c = list(map(int,input().split()))
print(c*((c-1)**(n-1)))
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h / 2))

Buggy submission (verdict: Runtime Error):
a,b,h = list(map(int, input().split()))
print((a+b)*h / 2)
Problem p02639 (python)

Fixed submission:
a_list = list(map(int, input().split()))
print(1 + a_list.index(0))

Buggy submission (verdict: Runtime Error):
# a: 総数hiki， b: 足の数
a, b = map(int, input().split())

# かめiひき
for i in range(a+1):
  total = 4*i + 2*(a-i)
  if total == b:
    ans = 'Yes'
    break
  else:
    ans = 'No'

print(ans)

Buggy submission (verdict: Runtime Error):
# a: 総数hiki， b: 足の数
a, b = map(int, input().split())

# かめiひき
ans = 'No'
for i in range(a+1):
  total = 4*i + 2*(a-i)
  if total == b:
    ans = 'Yes'
    break

print(ans)

Buggy submission (verdict: Runtime Error):
# a: 総数hiki， b: 足の数
a, b = map(int, input().split())

# かめiひき
ans = 'No'
for i in range(a+1):
  total = 4*i + 2*(a-i)
  if total == b:
    ans = 'Yes'

print(ans)

Buggy submission (verdict: Runtime Error):
# a: 総数hiki， b: 足の数
a, b = map(int, input().split())

# かめiひき
ans = 'No'
for i in range(a+1):
  total = 4*i + 2*(a+1-i)
  if total == b:
    ans = 'Yes'
    break

print(ans)
Problem p02642 (python)

Fixed submission:
import sys
sys.setrecursionlimit(2147483647)
input=sys.stdin.readline

def main():
  n = int(input())
  a = list(map(int, input().split(' ')))
  a.sort()
  a_max = a[-1]
  b = 0
  db = [0] * a_max
  for i in range(1, n-1):
    if a[i] != a[i+1] and a[i] != a[i-1]:
      db[a[i]-1] = 1
  if n == 1 or a[0] != a[1]:
    db[a[0]-1] = 1
  if n > 1 and a[-1] != a[-2]:
    db[-1] = 1
  for i in a:
    t = 2
    while(i * t <= a_max):
      db[i*t-1] = 0
      t += 1
  print(sum(db))
  

if __name__=='__main__':
  main()

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

def main():
  n = int(input())
  a = list(map(int, input().split(' ')))
  a.sort()
  a_max = a[-1]
  b = 0
  db = [0] * a_max
  for i in range(1, n-1):
    if a[i] != a[i+1] and a[i] != a[i-1]:
      db[a[i]-1] = 1
  if n == 1 or a[0] != a[1]:
    db[a[0]] = 1
  if n > 1 and a[-1] != a[-2]:
    db[-1] = 1
  for i in a:
    t = 2
    while(i * t <= a_max):
      db[i*t-1] = 0
      t += 1
  print(sum(db))
  

if __name__=='__main__':
  main()

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

def main():
  n = int(input())
  a = list(map(int, input().split(' ')))
  a.sort()
  a_max = a[-1]
  b = 0
  db = [0] * a_max
  for i in range(1, n-1):
    if a[i] != a[i+1] and a[i] != a[i-1]:
      db[a[i]-1] = 1
  if a[0] != a[1]:
    db[a[0]] = 1
  if n > 1 and a[-1] != a[-2]:
    db[-1] = 1
  for i in a:
    t = 2
    while(i * t <= a_max):
      db[i*t-1] = 0
      t += 1
  print(sum(db))
  

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

Fixed submission:
import numpy as np
N = int(input())
T,A = map(int,input().split())
H = np.array(list(map(int,input().split())))
p = np.absolute(((T-H*0.006)-A))
print(np.argmin(p)+1)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
T,A = map(int,input().split())
H = np.array(list(map(int,input().split())))
p = np.absolute(((T-H*0.006)-A)))
print(np.argmin(p)+1)
Problem p03231 (python)

Fixed submission:
import numpy as np
import scipy
def gcd(a, b):
    if a % b:
        return gcd(b, (a % b))
    else:
        return b
N, M = map(int,input().split())
S = input()
T = input()
t = gcd(N,M)
n = N // t
m = M // t
ans = n * m * t
for i in range(t):
    if(S[n*i]!=T[m*i]):
        ans = -1
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import scipy
def gcd(a, b):
    if a % b:
        return gcd(b, (a % b))
    else:
        return b
N, M = map(int,input().split())
S = input()
T = input()
t = gcd(N,M)
n = N // t
m = M // t
ans = n * m * t
for i in range(t):
    if(S[n*m*i]!=T[n*m*i]):
        ans = -1
        break
print(ans)
Problem p03262 (python)

Fixed submission:
N,X = map(int,input().split())
towns = list(map(int,input().split()))
towns.append(X)
towns.sort()
town_diff = [0]*(len(towns)-1)
for i in range(len(towns)-1):
    town_diff[i] = towns[i+1]-towns[i]
town_diff.sort()
if(len(town_diff) == 1):
    gcd = town_diff[0]
elif(len(town_diff) == 2):
    a = town_diff[0]
    b = town_diff[1]
    while(True):
            t = b%a
            if(t == 0):
                gcd = a
                break
            b = a
            a = t
else:
    a = town_diff[0]
    b = town_diff[1]
    for i in range(len(town_diff)-2):
        while(True):
            t = b%a
            if(t == 0):
                gcd = a
                break
            b = a
            a = t
        a = gcd
        b = town_diff[i+2]
print(gcd)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
towns = list(map(int,input().split()))
towns.append(X)
towns.sort()
town_diff = [0]*(len(towns)-1)
for i in range(len(towns)-1):
    town_diff[i] = towns[i+1]-towns[i]
town_diff.sort()
if(len(town_diff) == 1):
    gcd = town_diff[0]
else:
    a = town_diff[0]
    b = town_diff[1]
    for i in range(len(town_diff)-2):
        while(True):
            t = b%a
            if(t == 0):
                gcd = a
                break
            b = a
            a = t
        a = gcd
        b = town_diff[i+2]
print(gcd)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
towns = list(map(int,input().split()))
towns.append(X)
towns.sort()
town_diff = [0]*(len(towns)-1)
for i in range(len(towns)-1):
    town_diff[i] = towns[i+1]-towns[i]
town_diff.sort()
status = ''
a = town_diff[0]
b = town_diff[1]
for i in range(len(town_diff)-2):
    while(True):
        t = b%a
        if(t == 0):
            gcd = a
            break
        b = a
        a = t
    a = gcd
    b = town_diff[i+2]
print(gcd)
Problem p03284 (python)

Fixed submission:
N, K = map(int, input().split())
if(N%K==0):
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
if(N%K==0):
    return 0
else:
    return 1
Problem p02615 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)

maxval = a[0]
cc = {maxval: 1}

ans = 0
idx = 0

for i in range(1, n):
    if a[i] in cc:
        cc[a[i]] += 2
    else:
        cc[a[i]] = 2
    cc[maxval] -= 1
    ans += maxval
    if cc[maxval] == 0:
        while 1:
            idx += 1
            if maxval > a[idx]:
                maxval = a[idx]
                break

print(ans)

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

ans = 0
for i in range(1, n):
    ans += a[n-int(i/2)]
print(ans)
Problem p02642 (python)

Fixed submission:
n = int(input())
*A, = map(int, input().split())
maxA = max(A)
# C[a] = A内のaの個数
C = {a: 0 for a in A}
for a in A:
    C[a] += 1
# D[a]=1: Aにaより小さいaの約数が存在する
D = {a: 0 for a in A}
for a in A:
    if C[a] > 0:
        t = 2
        while a * t <= maxA:
            D[a * t] = 1
            t += 1
ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1
print(ans)

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

dp = {i: 0 for i in range(1, dp+1)}

ans = 0
for i in range(n):
    if dp[a[i]] == 1:
        continue

    if i == n - 1 or a[i] != a[i+1]:
        ans += 1

    prime += a[i]
    while prime <= maxa:
        dp[prime] = 1
        prime += a[i]
    
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
A, = map(int, input().split())
maxA = max(A)
# C[a] = A内のaの個数
C = {a: 0 for a in A}
for a in A:
    C[a] += 1
# D[a]=1: Aにaより小さいaの約数が存在する
D = {a: 0 for a in A}
for a in A:
    if C[a] > 0:
        t = 2
        while a * t <= maxA:
            D[a * t] = 1
            t += 1
ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1
print(ans)

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

# print(li)
li.sort()
# print(li)

one = [1 for _ in range(n)]

if li[0] == li[1]:
    one[0] = 0

check = set([i for i in range(1, n)])

for i in range(n-1):
    a = set([_ for _ in range(i+1, n)]) & check
    # print(a)
    for j in a:
        if li[j] % li[i] == 0:
            one[j] = 0
            check.remove(j)
    check = set(list(check)[1:])
print(sum(one))

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

# print(li)
li.sort()
# print(li)

one = [1 for _ in range(n)]

if li[0] == li[1]:
    one[0] = 0

check = [i for i in range(1, n)]

for i in range(n-1):
    a = set([_ for _ in range(i+1, n)]) & set(check)
    for j in a:
        if li[j] % li[i] == 0:
            one[j] = 0
    del check[0]
print(sum(one))
Problem p02678 (python)

Fixed submission:
from collections import deque

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

# dist = [-1 for i in range(n)]
prenodes = [-1 for i in range(n)]

G = [[] for i in range(n)]
ab = []
for i in range(m):
    ab.append(list(map(int, input().split())))

for i in range(m):
    G[ab[i][0]-1].append(ab[i][1]-1)
    G[ab[i][1]-1].append(ab[i][0]-1)
# print(G)

# dist[0] = 0
prenodes[0] = 0
que = deque([0])

while len(que) != 0:
    v = que.popleft()

    for vi in G[v]:
        if prenodes[vi] != -1:
            continue
        que.append(vi)
        # dist[vi] = dist[v] + 1
        prenodes[vi] = v

ans = "Yes"
for i in range(n):
    if prenodes[i] == -1:
        ans = "No"
        break

if ans == "No":
    print(ans)
else:
    print(ans)
    for i in range(1, n):
        print(prenodes[i]+1)

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

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

dist = [-1 for i in range(n)]

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

dist[0] = 0
que = deque([0])

while len(que) != 0:
    v = que.popleft()

    for vi in G[v]:
        if dist[vi] != -1:
            continue
        que.append(vi)
        dist[vi] = dist[v] + 1

ans = "Yes"
for i in range(n):
    if dist[i] == -1:
        ans = "No"
        break

if ans == "No":
    print(ans)
else:
    print(ans)
    for i in range(1, n):
        print(dist[i])
Problem p02690 (python)

Fixed submission:
import sys

x = int(input())

for i in range(-200, 200):
    for j in range(-200, 200):
        if i**5 - j**5 == x:
            print(i, j)
            sys.exit()

Buggy submission (verdict: Runtime Error):
x = int(input())
for i in range(-200, 200):
  for j in range(-200, 200):
    if i**5-j**5 == x):
      print(i, j)
      exit()
Problem p02783 (python)

Fixed submission:
h, a = map(int, input().split())
c = int(h/a)
if h%a!=0:
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
h, a = map(int, input().split())
c = int(h/a)
if h%a!=0:
    c+=1
print(c)
Problem p02921 (python)

Fixed submission:
s=input()
t=input()
c = 0
for i in range(3):
    if s[i]==t[i]:
        c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
print(int(n*(n-1)/2))
Problem p02981 (python)

Fixed submission:
l = list(map(int, input().split()))
n=l[0]
a=l[1]
b = l[2]

if a*n >= b:
    print(b)
else:
    print(a*n)

Buggy submission (verdict: Runtime Error):
l=list(map(int, input().split())
n=l[0]
a, b = l[1], l[2]

if a*n>=b:
    print(b)
else:
    print(a*n)
Problem p02642 (python)

Fixed submission:
import sys
from collections import Counter
N = int(input())
As = list(map(int,input().split()))
ct = Counter(As)
As =sorted(As)
max_dp = As[-1] +1
dp = [True] * max_dp
for key,count in ct.items():
	if count > 1:
		dp[key] = False
		i = 2
		while key*i < max_dp:
			dp[key*i] = False
			i+=1
for A in As:
	if dp[A] == True:
		i = 2
		while A*i < max_dp:
			dp[A*i] = False
			i+=1

ans = 0
# print(len(dp))
for A in As:
	# print(A)
	if dp[A]:
		ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
from collections import Counter
N = int(input())
As = list(map(int,input().split()))
ct = Counter(As)
As =sorted(As)
max_dp = As[-1] +1
dp = [True] * max_dp
for key,count in ct.items():
	if count > 1:
		dp[key] = False
for A in As:
	if dp[A] == True:
		i = 2
		while A*i <= max_dp:
			dp[A*i] = False
			i+=1

ans = 0
# print(len(dp))
for A in As:
	# print(A)
	if dp[A]:
		ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
from collections import Counter
N = int(input())
As = map(int,input().split())

As = sorted(As)
max_dp = As[-1] +1
dp = [True] * max_dp

for A in As:
	if dp[A] == True:
		i = 2
		while A*i <= max_dp:
			dp[A*i] = False
			i+=1

ans = 0
for A in As:
	if dp[A]:
		ans+=1
print(ans)
Problem p02706 (python)

Fixed submission:
n, m = map(int, input().split())
As = list(map(int, input().split()))

vacation = n-sum(As)
if vacation < 0:
	print('-1')
else:
	print(vacation)

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

vacation = n-sum(As)
if vacation < 0:
	print('-1')
else:
	print vacation
Problem p02717 (python)

Fixed submission:
a, b, c = map(int, input().split())
 
print("{} {} {}".format(c, a, b))

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

print("{} {} {}".format(c, a, b))
Problem p02724 (python)

Fixed submission:
N=int(input())
print('{}'.format(str(int(N/500)*1000+int(N%500/5)*5)))

Buggy submission (verdict: Runtime Error):
x = int(input())
print('{}'.format(str(int(x/500)*1000 + x%500))
Problem p02981 (python)

Fixed submission:
n, a, b = map(int, raw_input().split())
if a*n > b:
  min_value = b
else:
  min_value = a*n

print str(min_value)

Buggy submission (verdict: Runtime Error):
import map
n, a, b = map(int, raw_input().split())
if a < b:
  max_value = b
else:
  max_value = a

print(str(max_value*n))

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, raw_input().split())
if a < b:
  max = b
else:
  max = a

print(str(max*n))
Problem p03284 (python)

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

a = [0] * K

for i in range(N):
  a[i%K] +=1

print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
N = int(input())
res = 'No'
for i in range(int(100/7)+1):
	for j in range(int(100/4)+1):
		a = i*7 + j*4
		if int(N) == a:
			res='Yes'
print(res)