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

Fixed submission:
def main():
    n, m = [int(x) for x in raw_input().split()]
    a = [[int(x) - 1 for x in raw_input().split()] for i in xrange(n)]
    ans = n
    for _ in xrange(m):
        cnt = [0] * m
        for ai in a:
            cnt[ai[0]] += 1
        c = max(xrange(m), key=lambda k: cnt[k])
        ans = min(ans, cnt[c])
        for ai in a:
            ai.remove(c)
    return ans


if __name__ == '__main__':
    print(main())

Buggy submission (verdict: Runtime Error):
d = {}


def f(s, n, m, a, js):
    if s in d:
        return d[s]
    cnt = [0] * m
    for i in xrange(n):
        cnt[a[i][js[i]]] += 1
    mc = max(cnt)
    d[s] = min(mc, min(
        f(s | {k}, n, m, a, [js[i] + (1 if a[i][js[i]] == k else 0) for i in xrange(n)])
        for k in xrange(m) if cnt[k] == mc
    ))
    return d[s]


def main():
    n, m = [int(x) for x in raw_input().split()]
    a = [[int(x) - 1 for x in raw_input().split()] for i in xrange(n)]
    d[frozenset(xrange(m))] = n
    return f(frozenset(), n, m, a, [0] * n)


if __name__ == '__main__':
    print(main())
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):
L=int(input())
L1=(L//3)
L2=L%3
while L2>=10**-16:
    L1+=(L2/3)
    L2=(L2/3)

print(L1**3)
Problem p02754 (python)

Fixed submission:
N,A,B=map(int,input().split())
print(N//(A+B)*A+min(N%(A+B),A))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
if  A==0:
    print(0)
elif N==A+B:
    print(A)
elif N<=A:
    print(N)
else N>A+B:
    print(N-B)
Problem p02682 (python)

Fixed submission:
#coding :utf-8
A,B,C,K=map(int,input().split())
cnt=0
if K-A > 0:
  cnt=A
  if K-A-B >0:
    cnt=cnt-(K-A-B)
    print(cnt)
  else:
    print(cnt)
else:
  print(K)

Buggy submission (verdict: Runtime Error):
#coding :utf-8

A,B,C,K=map(int,input().split())

ans=sum(([1]*A+[0]*B+[-1]*C)[:K])

print(ans)
Problem p02771 (python)

Fixed submission:
l = list(map(int, input().split()))
s = set(l)
if len(s) == 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
s=set(a,b,c)
if len(s)==2:
    print("Yes")
else:
    print("No")
Problem p02777 (python)

Fixed submission:
S,T=map(str, input().split())
A,B=map(int, input().split())
U=input()

if U==S:
    print(A-1,B)
else:
    print(A,B-1)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(4100000)
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitai=[0]*N
kitaiwa=[0]*(N-K+1)
for i in range(N):
    kitai[i]=(p[i]+1)/2
if N==K:
    print(sum(kitai))
elif K==1:
    print(max(kitai))
else:
    for i in range(N-K+1):
        for j in range(K):
            kitaiwa[i]+=kitai[i+j]
    print(max(kitaiwa))

Buggy submission (verdict: Runtime Error):
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitai=[0]*N
kitaiwa=[0]*(N-K+1)
for i in range(N):
    kitai[i]=(p[i]+1)/2
if N==K:
    print(sum(kitai))
elif K==1:
    print(max(kitai))
else:
    for i in range(N-K+1):
        for j in range(K):
            kitaiwa[i]+=kitai[i+j]
    print(max(kitaiwa))

Buggy submission (verdict: Runtime Error):
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitai=[0]*N
kitaiwa=[0]*(N-K+1)
if N=K:
    print(sum(kitai))
elif K==1:
    print(max(kitai))
else:
    for i in range(N):
        kitai[i]=(p[i]+1)/2
    for i in range(N-K+1):
        for j in range(K):
            kitaiwa[i]+=kitai[i+j]
    print(max(kitaiwa))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(4100000)
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitaiwa=[0]*(N-K+1)
for i in range(N):
    p[i]=(p[i]+1)/2
for i in range(N-K+1):
    kitaiwa[i] = sum(p[i:i+K])
print(max(kitaiwa))

Buggy submission (verdict: Runtime Error):
N,K=map(int, input().split())
p=list(map(int, input().split()))
kitaiwa=[0]*(N-K+1)
for i in range(N):
    p[i]=(p[i]+1)/2
for i in range(N-K+1):
    kitaiwa[i] = sum(p[i:i+K])
print(max(kitaiwa))
Problem p02829 (python)

Fixed submission:
s=[int(input()) for i in range(2)]
if s[0]+s[1]==3:
	print("3")
elif s[0]+s[1]==4:
	print("2")
elif s[0]+s[1]==5:
	print("1")
else:
	print("error")

Buggy submission (verdict: Runtime Error):
s=[int(input()) for i in range(2)]
elif s[0]+s[1]==3:
	print("3")
elif s[0]+s[1]==4:
	print("2")
elif s[0]+s[1]==5:
	print("1")
else:
	print("error")
Problem p02689 (python)

Fixed submission:


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

h = list(map(int,input().split()))

# a = [0] * m
# b = [0] * m

ma = [0]*n


for i in range(m):
    a, b = map(int,input().split())
    a -= 1; b -= 1
    ma[a] = max(ma[a],h[b])
    ma[b] = max(ma[b],h[a])

ans = 0    
for i in range(n):
    if h[i] > ma[i]:
        ans += 1
        

print(ans)

Buggy submission (verdict: Runtime Error):


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

h = list(map(int,input().split()))

# a = [0] * m
# b = [0] * m

ma = [0]*n


for i in range(m):
    a, b = map(int,input().split())
    a -= 1; b -= 1
    ma[a] = max(ma[a],h[b])
    ma[b] = max(ma[b],h[a])

int ans = 0    
for i in range(n):
    if h[i] > ma[i]:
        ans += 1
        

print(ans)

Buggy submission (verdict: Runtime Error):


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

h = list(map(int,input().split()))

# a = [0] * m
# b = [0] * m

ma = [0]*n


for i in range(m):
    a, b = map(int,input().split())
    a -= 1; b -= 1
    ma[a] = max(ma[a],h[b])
    ma[b] = max(ma[b],h[a])

int ans = 0    
for i in range(n):
    ans += h[i] > ma[i]
        

print(ans)
Problem p02711 (python)

Fixed submission:
#!/usr/bin/env python3

if "7" in str(input()):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

import re

if int(input()) > 100 and int(input()) <= 999:
    x = str(input())
else:
    print("No")
    exit

if re.match("7", x):
    print("Yes")
else:
    print("No")
Problem p02753 (python)

Fixed submission:
#!/usr/bin/env python3

S = input()
print("Yes" if "A" in S and "B" in S else "No")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

N, A, B = map(int, input().split())

print((N//(A+B))*A + min(A, (N%(A+B))))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

N, A, B = map(int, input().split())

if N%(A+B) <= A:
    print((N//(A+B))*A + (N%(A+B)))
else:
    print((N//(A+B))*A + A)
Problem p02726 (python)

Fixed submission:
n, x, y = map(int, input().split())
ans = [0 for i in range(n-1)]
for i in range(n-1):
  k = i + 1
  b_1 = k - x
  c_1 = k - y
  if b_1 < 0:
      b_1 = - b_1
  if c_1 < 0:
      c_1 = - c_1
  for j in range(i+1, n):
    l = j + 1
    a = l - k
    b_2 = l - y
    c_2 = l - x
    if b_2 < 0:
      b_2 = - b_2
    if c_2 < 0:
      c_2 = - c_2
    b = b_1 + b_2 + 1
    c = c_1 + c_2 + 1
    if b < a:
      a = b
    if c < a:
      a = c
    ans[a-1] += 1
for i in range(n-1):
  print(ans[i])

Buggy submission (verdict: Runtime Error):
n, x, y = map(int, input().split())
ans = [0 for i in range(n-1)]
for i in range(n-1):
  k = i + 1
  for j in range(i+1, n):
    a = l - k
    b = abs(k - x) + abs(j+1 - y) + 1
    if b < a:
      ans[b-1] += 1
    else:
      ans[a-1] += 1
for i in range(n-1):
  print(ans[i])
Problem p02753 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
q = int(input())
t = 0
for i in range(q):
  Q = input()
  if Q == "1":
    t += 1
  else:
    a, f, c = Q.split()
    f = int(f)
    if (t + f) % 2 == 0:
      s = ''.join([s, c])
    else:
      s = ''.join([c, s])
if t % 2 == 1:
  print(s[::-1])
else:
  print(s)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
a_min = a / 0.08
a_max = (a + 1) / 0.08
b_min = b / 0.1
b_max = (b + 1) / 0.1
if a_min > b_min:
  min = a_min
else:
  min = b_min
if a_max < b_max:
  max = a_max
else:
  max = b_max
min = math.ceil(min)
if math.floor(max) == max:
  max = max - 1 
else:
  max = math.floor(max)
if min <= max:
  print(min)
else:
  print(-1)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()

if n % 2 == 1:
    print('No')
    exit()

l = int(n/2)
print('Yes') if s[:l] == s[l:] else print('No')

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

if n % 2 == 1:
    print('No')
    exit()

print('Yes') if s[:n/2] == s[n/2:] else print('No')
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
s, w = int(input().split())
if w >= s:
    print("unsafe")
else:
    print("safe")
Problem p02785 (python)

Fixed submission:
N, K = map(int, input().split())
Hs = map(int,input().split())
print(sum(sorted(Hs, reverse=True)[K::]))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
Hs = map(int,input().split())
print(sum(sorted(Hs, reverse=True)[K::])
Problem p02835 (python)

Fixed submission:
a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

Buggy submission (verdict: Runtime Error):

def blackjack(a, b, c):
    if (a+b+c) >= 22:
        return "bust"
    else:
        return "win"

A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
print(blackjack(A1, A2, A3))

Buggy submission (verdict: Runtime Error):
def blackjack(A1, A2, A3):
    if (A1+A2+A3) >= 22:
        return "bust"
    else:
        return "win"

A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
print(blackjack(A1, A2, A3))

Buggy submission (verdict: Runtime Error):
A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
if (A1+A2+A3) >= 22:
    print('bust')
else:
    print('win')

Buggy submission (verdict: Runtime Error):
A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
if (A1+A2+A3) >= 22:
    print('bust')
else:
    print('win')
Problem p02699 (python)

Fixed submission:
str = input("")
li = str.split()
if(eval(li[0])<=eval(li[1])):
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
li = str.split()
if(eval(li[0])<=eval(li[1])):
  print("unsafe")
else:
  print("safe")

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

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

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

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

Buggy submission (verdict: Runtime Error):
t,n=map(int,input().split())
print(t/x)
Problem p02711 (python)

Fixed submission:
N = int(input())

hyaku = N // 100
resi = N - (100 * hyaku)
ju = resi // 10
iti = resi % 10

n = hyaku * ju * iti

if not hyaku == 7:
  if not ju == 7:
    if not iti == 7:
      print('No')
    else:
      print('Yes')
  else:
    print('Yes')
else:
  print('Yes')

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

hyaku = N // 100
resi = N - (100 * hyaku)
ju = resi // 10
iti = resi % 10

n = hyaku * ju * iti

if n % 7 == 0:
  print('Yes')

else:
  print('No')

N = int(input())
Problem p02723 (python)

Fixed submission:
S = input()

if S[2] == S[3]:
  if S[4] == S[5]:
    print('Yes')
  else:
    print('No')

else:
  print('No')

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

if S[2] = S[3]:
  if S[4] = S[5]:
    print('Yes')
  else:
    print('No')

else:
  print('No')
Problem p02729 (python)

Fixed submission:
N, M = map(int, input().split())
def sta(n):
  one = 1
  for i in range(1, n + 1):
    one *= i
  return one

if N >= 3:
  num = sta(N)/(sta(2)*sta(N-2))
if N == 2:
  num = 1
if N <= 1:
  num = 0

if M >= 3:
  mum = sta(M)/(sta(2)*sta(M-2))
if M == 2:
  mum = 1
if M <= 1:
  mum = 0

print(int(num + mum))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
def sta(n):
  one = 1
  for i in range(1, n + 1):
    one *= i
  return one

if N >= 3:
  num = sta(N)/(sta(2)*sta(N-2))
if N = 2:
  num = 1
if N <= 1:
  num = 0

if M >= 3:
  mum = sta(N)/(sta(2)*sta(N-2))
if M = 2:
  mum = 1
if M <= 1:
  mum = 0

print(num + mum)
Problem p02881 (python)

Fixed submission:
import math
A = int(input())
p = int(math.sqrt(A)) + 1
all_lis = []
ans_lis = []

for i in range(1,p,1):
    if A % i == 0:
        kumi = [i,int(A/i)]
        all_lis.append(kumi)

for j in all_lis:
    ans_lis.append(j[0]+j[1])
    
print(int(min(ans_lis)-2))

Buggy submission (verdict: Runtime Error):
import math
A = int(input())
p = int(math.sqrt(A))
all_lis = []
ans_lis = []

for i in range(1,p,1):
    if A % i == 0:
        kumi = [i,int(A/i)]
        all_lis.append(kumi)

for j in all_lis:
    ans_lis.append(j[0]+j[1])
    
print(int(min(ans_lis)-2))

Buggy submission (verdict: Runtime Error):
import math
A = int(input())
p = int(math.sqrt(A))
all_lis = []
ans_lis = []

for i in range(1,p,1):
    if A % i == 0:
        kumi = [i,int(A/i)]
        all_lis.append(kumi)
        
print(all_lis)

for j in all_lis:
    ans_lis.append(j[0]+j[1])
    
print(int(min(ans_lis)-2))

Buggy submission (verdict: Runtime Error):
import math
A = int(input())
p = int(math.sqrt(A))
all_lis = []
ans_lis = []

for i in range(1,p,1):
    if A % i == 0:
        kumi = [i,A/i]
        all_lis.append(kumi)

for j in all_lis:
    ans_lis.append(j[0]+j[1])
    
print(int(min(ans_lis)-2))
Problem p02682 (python)

Fixed submission:
a,b,c,k = map(int,input().split())
if a >= k:
    print(f"{k}")
else:
    if a + b >= k:
        print(f"{a}")
    else:
        print(f"{a*1 + b*0 + (k-a-b)*(-1)}")

Buggy submission (verdict: Runtime Error):
import heapq
a,b,c,k = map(int,input().split())
li = [1]*a + [0]*b + [-1]*c
print(sum(heapq.nlargest(k,li)))
Problem p02951 (python)

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

x=0
if c-(a-b)>0:
  x=c-(a-b)

print(x)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
x=np.where(c-(a-b)>0,c-(a-b),0)

print(x)

Buggy submission (verdict: Runtime Error):
a,b,c=int(input())
x=np.where(c-(a-b)>0,c-(a-b),0)

print(x)
Problem p02970 (python)

Fixed submission:
import math

n,d=map(int,input().split())
print(math.ceil(n/(2*d+1)))

Buggy submission (verdict: Runtime Error):
import math
n,d=map(int,input().split())
print(math.ceil(n/(2*d+1))

Buggy submission (verdict: Runtime Error):
n,d=map(int,input().split())
print(math.ceil(n/(2*d+1))
Problem p02987 (python)

Fixed submission:
l=[i for i in input()]

ans='No'

con=len(set(l))
if (con==2) and (l.count(l[0])==2):
  ans='Yes'

print(ans)

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

ans='No'

con=len(unique(l))
if (con==2) and (l.count(l[0])==2):
  ans='Yes'

print(ans)
Problem p03011 (python)

Fixed submission:
p,q,r=map(int,input().split())

print(p+q+r-max(p,q,r))

Buggy submission (verdict: Runtime Error):
p,q,r=map(int,input().split())

l=list(p,q,r)
l=sorted(l)

print(l[0]+l[1])
Problem p03012 (python)

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

ans=[]
left=0
right=0

for i in range(n):
  left=sum(l[:i+1])
  right=sum(l[i+1:])
  ans.append(abs(left-right))
  
print(min(ans))

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

ans=[]
left=0
right=0

for i in range(n):
  left=sum(l[:i+1])
  right=sum(l[i+1:])
  ans+=abs(left-right)
  
print(min(ans))

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

ans=[]
for i in range(n):
  left=sum(l[:i+1])
  right=sum(l[i+1:])
  ans+=abs(left-right)
  
print(min(ans))

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

sum_l=sum(l)

sum=0
a=0
for i in range(n):
  sum+=l[i]
  if sum>sum_l/2:
    a=i-1
    break
    
ans=abs(sum(l[:a])-sum(l[a:]))
print(ans)
Problem p03041 (python)

Fixed submission:
n,k=map(int,input().split())
l=[i for i in str(input())]

l[k-1]=l[k-1].lower()

print(''.join(l))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=[i for i in str(input())]

l[k]=l[k].lower()

print(''.join(l))
Problem p03042 (python)

Fixed submission:
l=[i for i in str(input())]
A=int(''.join(l[:2]))
B=int(''.join(l[2:]))

if A==0 or A>=13:
  if B==0 or B>=13:
    print('NA')
  else:
    print('YYMM')
elif A>=1 and A<=12:
  if B==0 or B>=13:
    print('MMYY')
  else:
    print('AMBIGUOUS')

Buggy submission (verdict: Runtime Error):
l=[i for i in str(input())]
A=int(''.join(l[:2]))
B=int(''.join(l[2:]))

if A==00 or A>=13:
  if B==00 or B>=13:
    print('NA')
  else:
    print('YYMM')
elif A>=01 and A<=12:
  if B==00 or B>=13:
    print('MMYY')
  else:
    print('AMBIGUOUS')
Problem p03072 (python)

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

ans=1
a=l[0]
for i in range(n-1):
  if a<=l[i+1]:
    ans+=1
    a=l[i+1]

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[int(input().split()) for _ in range(n)]

ans=1
a=l[0]
for i in range(n-1):
  if a<=l[i+1]:
    ans+=1
    a=max(a,l[i])

print(ans)
Problem p03775 (python)

Fixed submission:
import math

n=int(input())
n_sqrt=int(math.sqrt(n))

ans=[]

for i in range(1,n_sqrt+1):
  if n%i==0:
    x=int(max(math.log10(i)+1,math.log10(n//i)+1))
    ans.append(x)

print(min(ans))

Buggy submission (verdict: Runtime Error):
import math

n=int(input())
n_sqrt=int(math.sqrt(n))

ans=[]

for i in range(1,n_sqrt):
  if n%i==0:
    x=int(max(math.log10(i)+1,math.log10(n//i)+1))
    ans.append(x)

print(min(ans))
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
for i in range(100):
    c-=b
    if c<=0:
        print("Yes")
        break
    else:
        a-=d
        if a<=0:
            print("No")
            break
Problem p02915 (python)

Fixed submission:
N=input()
print(int(N)**3)

Buggy submission (verdict: Runtime Error):
N=input()
print(N**3)
Problem p02682 (python)

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

sum1 = 0
sum2 = 0
sum3 = 0

if k < a: sum = k
if k >= a and k < a+b: sum = a
if k >= a+b: sum = a-(k-a-b)

print(sum)

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

Slen = len(S)
Tx = T[0:Slen]

if S == Tx:print("Yes")
else: print("No")

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

Slen = len(S)
Tx = T[0:Slen]

if S == Tx:print("Yes")
else: print("No")

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

Slen = len(S)
Tx = T[0:Slen]

if S == Tx:print("Yes")
else: print("No")
Problem p02707 (python)

Fixed submission:
import collections
 
n = int(input())
a = list(map(int, input().split()))
ac = collections.Counter(a)
 
for i in range(1,n+1):
    print(ac[i])

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
a = list(map(int, input().split()))
ac = collections.Counter(a)

for i in range(1,n+1):
    print(a[i])
Problem p02754 (python)

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

q, mod = divmod(N, A+B)
# print(q,mod)

if A == 0:
    print(0)
else:
    if mod > A:
        print(q * A + A)
    else:
        print(q * A + mod)

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

c = N // (A + B)
mod = N % (A + B)
# print(c,mod)

if mod > A:
    mod_A = mod // A 
    # print(mod_A)
    print(c * A + mod_A * A)
else:
    print(c * A + mod)

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

c = N // (A + B)
mod = N % (A + B)
# print(c,mod)

mod_A = mod // A 
# print(mod_A)
print(c * A + mod_A * A)
Problem p02695 (python)

Fixed submission:
import itertools

n, m, q = [int(x) for x in input().split()]
 
tmp = []
for i in range(q):
    a, b, c, d = [int(x) for x in input().split()]
    tmp.append([a, b, c, d])

t = list(itertools.combinations_with_replacement(range(1, m + 1), n))

score = 0
for _t in t:
    _s = 0
    for a, b, c, d in tmp:
        if c == _t[b - 1] - _t[a - 1]:
            _s += d
    score = max(_s, score)
print(score)

Buggy submission (verdict: Runtime Error):
import itertools

n, m, q = [int(x) for x in input().split()]
 
tmp = []
for i in range(q):
    a, b, c, d = [int(x) for x in input().split()]
    tmp.append([a, b, c, d])

t = list(itertools.combinations_with_replacement(range(1, m + 1), m))

score = 0
for _t in t:
    _s = 0
    _t = list(_t)
    for a, b, c, d in tmp:
        if c == _t[b - 1] - _t[a - 1]:
            _s += d
    score = max(_s, score)
print(score)

Buggy submission (verdict: Runtime Error):
import itertools

n, m, q = [int(x) for x in input().split()]
 
tmp = []
for i in range(q):
    a, b, c, d = [int(x) for x in input().split()]
    tmp.append([a, b, c, d])

t = list(itertools.combinations_with_replacement(range(1, m + 1), m-1))

score = 0
for _t in t:
    _s = 0
    for a, b, c, d in tmp:
        if c == _t[b - 1] - _t[a - 1]:
            _s += d
    score = max(_s, score)
print(score)

Buggy submission (verdict: Runtime Error):
import itertools

n, m, q = [int(x) for x in input().split()]
 
t = [sorted(x) for x in list(itertools.product(range(1, m + 1), repeat=(m-1)))]
t = list(map(list, set(map(tuple, t))))
 
tmp = []
for i in range(q):
    a, b, c, d = [int(x) for x in input().split()]
    tmp.append([a, b, c, d])

score = 0
for _t in t:
    _s = 0
    for a, b, c, d in tmp:
        if c == _t[b - 1] - _t[a - 1]:
            _s += d
    score = max(_s, score)
print(score)

Buggy submission (verdict: Runtime Error):
n, m, q = [int(x) for x in input().split()]

t = [sorted(x) for x in list(itertools.product(range(1, m + 1), repeat=(m-1)))]
t = list(map(list, set(map(tuple, t))))

tmp = []
for i in range(q):
    a, b, c, d = [int(x) for x in input().split()]
    tmp.append([a, b, c, d])

score = 0
for _t in t:
    _s = 0
    for a, b, c, d in tmp:
        if c == _t[b - 1] - _t[a - 1]:
            _s += d
    score = max(_s, score)
print(score)
Problem p02701 (python)

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]
 
print(len(list(set(s))))

Buggy submission (verdict: Runtime Error):
n = input()
s = [input() for i in range(n)]
 
print(len(list(set(s))))

Buggy submission (verdict: Runtime Error):
n = input()
s = [input() for i in range(n)]

list(set(s))