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

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

if(mod !=0):
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
mod=N%K
if(mod !=0):
	print(1)
else:
  print(0)
Problem p03285 (python)

Fixed submission:
N = int(input())
K=4
D=7
c=False
for i in range(25):
        for j in range(7):
            if(i*K+D*j==N):
                c=True
                break
if(c):
    print("Yes")
else:
    print("No")

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

c=False
for (i in range(25)):
        for(j in range(7)):
            if(i*4+7*j==N):
                c=True
                break
if(c):
    print("Yes")
else:
    print("No")
Problem p03284 (python)

Fixed submission:
s = raw_input().split(' ')
n, k = int(s[0]), int(s[1])
if n % k == 0:
    print('0')
else:
    print('1')

Buggy submission (verdict: Runtime Error):
s = raw_input().split(' ')
n, m = int(s[0]), int(s[1])
nums = []
for _ in range(n):
    num = input()
    nums.append(num)
if n == 0:
    print('0')
    exit()
total = [0 for _ in range(n)]
total[0] = nums[0]
for i in range(1, n):
    total[i] = total[i-1] + nums[i]
cnt = 0
for i in range(0, n):
    for j in range(i+1, n):
        if (total[j]-total[i]) % m == 0:
            cnt += 1
print cnt

Buggy submission (verdict: Runtime Error):
s = raw_input().split(' ')
n, k = int(s[0]), int(s[1])
div, mo = n / k, n % d
if mo == 0:
    print mo
else:
    print div-mo
Problem p03645 (python)

Fixed submission:
s1 = raw_input().split(' ')
n, m = int(s1[0]), int(s1[1])
i2il = {}
for _ in range(m):
    s = raw_input().split(' ')
    if s[0] in i2il:
        i2il[s[0]].append(s[1])
    else:
        i2il[s[0]] = [s[1]]
    if s[1] in i2il:
        i2il[s[1]].append(s[0])
    else:
        i2il[s[1]] = [s[0]]
if '1' not in i2il or s1[0] not in i2il:
    print 'IMPOSSIBLE'
else:
    mid = i2il['1']
    bhit = False
    for m in mid:
        if s1[0] in i2il[m]:
            print 'POSSIBLE'
            bhit = True
            break
    if not bhit:
        print 'IMPOSSIBLE'

Buggy submission (verdict: Runtime Error):
s1 = raw_input().split(' ')
n, m = int(s1[0]), int(s1[1])
i2il = {}
for _ in range(m):
    s = raw_input().split(' ')
    if s[0] in i2il:
        i2il[s[0]].append(s[1])
    else:
        i2il[s[0]] = [s[1]]
    if s[1] in i2il:
        i2il[s[1]].append(s[0])
    else:
        i2il[s[1]] = [s[0]]
if '1' not in i2il or s1[1] not in i2il:
    print 'IMPOSSIBLE'
else:
    mid = i2il[1]
    bhit = False
    for m in mid:
        if s1[1] in m:
            print 'POSSIBLE'
            bhit = True
            break
    if not bhit:
        print 'IMPOSSIBLE'
Problem p03289 (python)

Fixed submission:
S = input()
     
a = S.find('A')
c = S.find('C')
     
s1 = S[2:-1]
s_count = s1.count('C')
   
y = S[1:c-1]
z = S[c+1:]

if c == 2:
	y = S[1]   

if a != 0:
	print('WA')

elif s_count != 1:
	print('WA')
     
else:
	if y.islower() and z.islower():
			print('AC')
	else:
		print('WA')

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

a = S.find('A')

s1 = S[2:-1]
s_count = s1.count('C')

if a != 0:
  return False

if s_count != 1:
  return False

c = s1.find('C')

y = S[1:c-1]
z = S[c+1:]


if y.islower() and z.islower:
  print('AC')
else:
  print('WA')
Problem p03385 (python)

Fixed submission:
print("Yes" if "".join(sorted(input())) == "abc" else "No")

Buggy submission (verdict: Runtime Error):
print("Yes" if sorted(input()).join("") == "abc" else "No")
Problem p03625 (python)

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

x=0
y=0
a.sort()
i=1
while (i<len(a)):
  if a[i-1]==a[i]:
    x=y
    y=a[i]
    i+=2
  else:
    i+=1

print(x*y)

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

x=0
y=0
a.sort()
i=len(a)
while (i>1):
  if a[i-1]==a[i]:
    x=y
    y=a[i]
    i-=2
  else:
    i+=1
  if y>0:
    break

print(x*y)
Problem p03302 (python)

Fixed submission:
a, b = map(int, input().split())
if a + b == 15:
    print("+")
elif a * b == 15:
    print("*")
else:
    print("x")

Buggy submission (verdict: Runtime Error):
def solution():

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


    if d == 0:
        guess = n
        return (m-1)/n

    else:

        guess = 2 * (n - d)
        return (guess*(m-1)/n**2)

print(solution())

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
if a + b == 15:
    print("+")
elif a * b == 15:
    print("*")
else:
    print("x")
Problem p03284 (python)

Fixed submission:
inp = list(map(int, input().split()))
n = inp[0]
k = inp[1]
if n % k == 0:
  print('0')
else:
  print('1')

Buggy submission (verdict: Runtime Error):
    inp = list(map(int, input().split()))
    n = inp[0]
    k = inp[1]
    print(str(abs(n%k)))
Problem p03493 (python)

Fixed submission:
s = input()
print(s.count("1"))

Buggy submission (verdict: Runtime Error):
num_list = list(map(int, input().split()))
count = 0

for i in range(3):
  count += num_list[i]

print(count)
Problem p03285 (python)

Fixed submission:
n = input()
n = int(n)
if n >= 20 or n % 7==0 or n%4==0 or n == 19 or n == 18 or n == 15 or n == 11:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = input()
if n >= 20 or n % 7==0 or n%4==0 or n == 19 or n == 18 or n == 15 or n == 11:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = map(int, input())
if n >= 20 or n % 7==0 or n%4==0 or n == 19 or n == 18 or n == 15 or n == 11 or n == 1:
    print("Yes")
else:
    print("No")
Problem p03294 (python)

Fixed submission:
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

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

N = int(input())
a = list(map(int, input().split()))
lcm2 = 1
for i in range(N):
    lcm2 = lcm(a[i], lcm2)
lcm2 -= 1
f = 0
for i in range(N):
    f += lcm2%a[i]
print(f)

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    a = (x*y)//math.gcd(x, y)
    return a

N = int(input())
a = list(map(int, input().split()))
lcm2 = 1
for i in range(N):
    lcm2 = lcm(a[i], lcm2)
lcm2 -= 1
f = 0
for i in range(N):
    f += lcm2%a[i]
print(f)

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x*y)//math.gcd(x, y)

N = int(input())
a = list(map(int, input().split()))
lcm2 = 1
for i in range(N):
    lcm2 = lcm(a[i], lcm2)
lcm2 -= 1
f = 0
for i in range(N):
    f += lcm2%a[i]
print(f)

Buggy submission (verdict: Runtime Error):
import math

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

N = int(input())
a = list(map(int, input().split()))
lcm2 = 1
for i in range(len(a)):
    lcm2 = lcm(a[i], lcm2)
lcm2 -= 1
f = 0
for i in range(len(a)):
    f += lcm2%a[i]
print(f)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y)//math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
a = list(map(int, input().split()))
lcm = lcm(*a)-1
f = 0
for i in range(len(a)):
    f += lcm%a[i]
print(f)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
a = list(map(int, input().split()))
lcm = lcm(*a)-1
f = 0
for i in range(len(a)):
    f += lcm%a[i]
print(f)
Problem p03360 (python)

Fixed submission:
s = list(map(int, input().split()))
K = int(input())
s = sorted(s)
for i in range(K):
    s[2] *= 2
print(sum(s))

Buggy submission (verdict: Runtime Error):
s = list(map(int, input().split()))
K = int(input())
s = sorted()
for i in range(K):
    s[2] *= 2
print(sum(s))
Problem p03380 (python)

Fixed submission:
n= int(input())
a = [int(i) for i in input().split()]
ai = max(a)
b = [abs(int(i-ai/2)) if i != ai else 10E9 for i in a]
aj = a[b.index(min(b))]
print(str(ai)+" "+str(aj))

Buggy submission (verdict: Runtime Error):
def comb(a, b):
    ans, x, y = 0, a, b
    for i in range(1, b):
        x *= a-i
        y *= b-i
    ans = int(x/y)
    return ans
    
n= int(input())
a = [int(i) for i in input().split()]
m = max(a)

t = 0
t2 = 0
b = a[:]
b.remove(m)
for j in b:
    if j == 0:
        continue
    t3 = comb(m, j)
    if t < t3:
        t = t3
        t2 = j
print(str(m)+" "+str(t2))
Problem p03288 (python)

Fixed submission:
r=int(input())
if r<1200:
  print('ABC')
elif 1200<=r and r<2800:
  print('ARC')
else:
  print('AGC')

Buggy submission (verdict: Runtime Error):
if s[0]=='A':
    if s[2:-2].count('C')==1:
        if (s[1]+s[2:-2].replace('C', '')+s[-1]).islower() :
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Buggy submission (verdict: Runtime Error):
s=input()
if s[0]=='A':
  if s[2:-2].count('C')==1:
    if (s[1]+s[2:-2].replace('C', '')+s[-1]).islower() :
  		print('AC')
    else:
    	print('WA')
  else:
  	print('WA')
else:
  print('WA')

Buggy submission (verdict: Runtime Error):
r=input()
if r<1200:
  print('ABC')
elif 1200<=r and r<2800:
  print('ARC')
else:
  print('AGC')

Buggy submission (verdict: Runtime Error):
r=input()
if r<1200:
  print('ABC')
elif 1200<=r<2800:
  print('ARC')
else:
  print('AGC')
Problem p03289 (python)

Fixed submission:
s=input()
if s[0]=='A':
    if s[2:-1].count('C')==1:
        if (s[1]+s[2:-1].replace('C', '')+s[-1]).islower() :
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')

Buggy submission (verdict: Runtime Error):
s=input()
if s[0]=='A':
  if s[2:-2].count('C')==1:
    if (s[1]+s[2:-2].replace('C', '')+s[-1]).islower() :
  		print('AC')
    else:
      print('WA')
  else:
    print('WA')
else:
  print('WA')
Problem p03285 (python)

Fixed submission:
N = int(input())

if N%4 == 0:
    print("Yes")

if N%4 == 1:
    if N < 21:
        print("No")
    else:
        print("Yes")

if N%4 == 2:
    if N < 14:
        print("No")
    else:
        print("Yes")


if N%4 == 3:
    if N < 7:
        print("No")
    else:
        print("Yes")

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

if N%4 == 0:
    print("Yes")

if N%7 == 0:
    print("Yes")

if N%4 == 1:
    if N < 29:
        print("No")
    else:
        print("Yes")

if N%4 == 2:
    if N < 11:
        print("No")
    elif N < 15:
        print("No")
    else:
        print("Yes")

    
if N%4 == 3:
    if N > 10:
        print("Yes")
    else:
        print("N

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

if N%4 == 0:
    print("Yes")
    exit()

if N%7 == 0:
    print("Yes")
    exit()

S = N%7
K = (S%4)%2

if K == 0:
    print("Yes")
else:
    print("No")

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

if N%4 == 0:
    print("Yes")
    exit()

if N%7 == 0:
    print("Yes")
    exit()

S = N%7
K = (S%4)%2

if K == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = list(map(int, input().split()))
S = N%4

if S == 0:
    print("Yes")
elif S == 3:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = list(map(int, input().split()))
S = N%4

if S == 0:
    print("Yes")
elif S == 3::
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = list(map(int, input().split()))
S = N%4

if S == 0 or S == 3:
    print("Yes")
else:
    print("No")
Problem p03294 (python)

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

print(sum(A) - N)

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

print(sum(A) - N)
Problem p03352 (python)

Fixed submission:
X = int(input())

import math
def is_beki(n):
  for i in range(2, int(math.sqrt(n)//1)+1):
    beki = i
    while beki <= n:
      if beki == n:
        return True
      beki = beki * i
  return False

if X == 1:
  print(1)
else:
  for i in range(X, 1, -1):
    if is_beki(i):
      break
  print(i)

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

import math
def is_beki(n):
  for i in range(2, int(math.sqrt(n)//1)+1):
    beki = i
    while beki <= n:
      if beki == n:
        return True
      beki = beki * i
  return False

for i in range(X, 1, -1):
  if is_beki(i):
    break
print(i)
Problem p03379 (python)

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

sorted_X = sorted(X)
m1, m2 = sorted_X[N//2-1: N//2+1]

if m1 == m2:
  for i in range(N):
    print(m1)
else:
  for i in range(N):
    if X[i] <= m1:
      print(m2)
    else:
      print(m1)

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

sorted_X = sorted(X)
m1, m2 = sorted[N//2-1: N//2]

if m1 == m2:
  for i in range(N):
    print(m1)
else:
  for i in range(N):
    if X[i] <= m1:
      print(m2)
    else:
      print(m1)
Problem p03478 (python)

Fixed submission:
n,a,b=map(int,input().split(" "))
def check(x):
    sum=0
    while x>0: 
        sum = sum + x % 10 
        x=int(x/10); 
    return sum

total=0
for i in range(n+1): #1-10 1,2,10
    sum=check(i)
    if sum<=b and sum>=a:
        #print(i)
        total=total+i

print(total)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split(" "))
def check(x):
    sum=0
    while x>0: 
        sum = sum + x % 10 
        x=int(x/10); 
    return sum
 
total=0
for i in range(n+1): #1-10 1,2,10
    sum=check(i)
    if sum<=b and sum>=a:
        #print(i)
        total=total+i
 
print(total)
n,a,b=map(int,input().split(" "))
def check(x):
    sum=0
    while x>0: 
        sum = sum + x % 10 
        x=int(x/10); 
    return sum

total=0
for i in range(n+1): #1-10 1,2,10
    sum=check(i)
    if sum<=b and sum>=a:
        #print(i)
        total=total+i

print(total)
提出情報
Problem p03502 (python)

Fixed submission:
# coding: utf-8
N = int(input())
X = N
f = 0
while N > 0:
    f += N % 10;
    N = int(N / 10)

if X%f == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
data = input().split(" ")

N = int(data[0])
A = int(data[1])
B = int(data[2])

total_sum = 0

for i in range(N+1):
    sum = 0
    tmp = i
    while tmp > 0:
        sum += tmp % 10;
        tmp = int(tmp/10)
    if sum >= A and sum <= B:
        total_sum += i

print(total_sum)
Problem p03285 (python)

Fixed submission:
def fits(N):
    answer = 'No'
    for cake in range(0,100,4):
        for donut in range(0,100,7):
            if cake + donut is N:
                answer = 'Yes'
    return answer
if __name__ == '__main__':
    N = int(input())
    print(fits(N))

Buggy submission (verdict: Runtime Error):
def fits(N):
    if N < 4:
        return 'no'
    else:
        for cake in range(0,100,4):
            for donut in range(0,100,7):
                if cake + donut is N:
                    return 'yes'

if __name__ == '__main__':
    print(fits(int(N)))
Problem p03293 (python)

Fixed submission:
S = str(input())
T = str(input())

for i in S:
    s = ''
    x = i
    s += S[1::1]
    s += x
    S = S[1::1] + S[0]
    
    if s == T:
        print('Yes')
        break
else:
    print('No')

Buggy submission (verdict: Runtime Error):
for i in S:
    s = ''
    x = i
    s += S[1::1]
    s += x
    S = S[1::1] + S[0]
    
    if s == T:
        print('Yes')
        break
else:
    print('No')
Problem p03292 (python)

Fixed submission:
# -*- coding: utf-8 -*-

tasks = list(map(int, input().split()))
answer = max(tasks) - min(tasks)
print(answer)

Buggy submission (verdict: Runtime Error):
import functools
import fractions

N = int(input())
numbers = list(map(int, input().split()))

max_under_lcm = functools.reduce(lambda x, y: int((x * y) / fractions.gcd(x,y)), numbers) - 1
answer = sum([max_under_lcm % n for n in numbers])

print(answer)

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

import functools

N = input()
numbers = list(map(int, input().split()))

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a if a > 0 else 1

max_under_lcm = functools.reduce(lambda x, y: int((x * y) / gcd(x,y)), numbers) - 1
answer = sum([ max_under_lcm % n for n in numbers])

print(answer)
Problem p03545 (python)

Fixed submission:
from itertools import product

A, B, C, D = list(map(int, input()))

for pattern in product('+-', '+-', '+-'):
    f = '{}{}{}{}{}{}{}'.format(A, pattern[0], B, pattern[1], C, pattern[2], D)

    if eval(f) == 7:
        print(f+'=7')
        break

Buggy submission (verdict: Runtime Error):
from itertools import product

A, B, C, D = list(map(int, input()))

for pattern in product('+-', repeat=3):
    f = '{}{}{}{}{}{}{}'.format(A, pattern[0], B, pattern[1], C, pattern[2], D)    if eval(f) == 7:
        print(f+'=7') 
        break
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
print("Even" if a*b % 2 == 0 else "Odd")

Buggy submission (verdict: Runtime Error):
def Product(a,b):
  if (a*b)%2 == 0:
    return 'even'
  else:
    return 'odd'

Product(a,b)
Problem p03294 (python)

Fixed submission:
import sys

sys.setrecursionlimit(3100)

def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)

def lcm(l):
    def aux(l, i):
        if i == len(l) - 1:
            return l[-1]
        rest = aux(l, i+1)
        return l[i] * rest // gcd(l[i], rest)
    return aux(l, 0)

def modsum(a):
    k = lcm(a) - 1
    return sum(map(lambda x: k % x, a))

if __name__ == '__main__':
    _ = input()
    a = list(map(int, input().split()))
    print(modsum(a))

Buggy submission (verdict: Runtime Error):
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)

def lcm(l):
    def aux(l, i):
        if i == len(l) - 1:
            return l[-1]
        rest = aux(l, i+1)
        return l[i] * rest // gcd(l[i], rest)
    return aux(l, 0)

def modsum(a):
    k = lcm(a) - 1
    return sum(map(lambda x: k % x, a))

if __name__ == '__main__':
    _ = input()
    a = list(map(int, input().split()))
    print(modsum(a))

Buggy submission (verdict: Runtime Error):
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)

def lcm(l):
    def aux(l, i):
        if i == len(l) - 1:
            return l[-1]
        rest = aux(l, i+1)
        return int((l[i] * rest) / gcd(l[i], rest))
    return aux(l, 0)

def modsum(a):
    k = lcm(a) - 1
    return sum(map(lambda x: k % x, a))

if __name__ == '__main__':
    _ = input()
    a = list(map(int, input().split()))
    print(modsum(a))
Problem p03369 (python)

Fixed submission:
print(700 + 100 * input().count('o'))

Buggy submission (verdict: Runtime Error):
print(700 + 100 * input().count('o'))print(700 + 100 * input().count('o'))
Problem p03739 (python)

Fixed submission:
def ops_needed(x, target):
    if abs(target - x) < abs(x):
        return 0
    else:
        return target - x

def count_ops(a, first_target):
    total_ops = 0
    accum = 0
    for i, ai in enumerate(a):
        new_accum = accum + a[i]
        if i % 2 == 1:
            ops = ops_needed(new_accum, first_target)
        else:
            ops = ops_needed(new_accum, -1 * first_target)
        total_ops += abs(ops)
        accum = new_accum + ops
    return total_ops
        

if __name__ == '__main__':
    _ = int(input())
    a = list(map(int, input().split()))
    print(min(count_ops(a, 1), count_ops(a, -1)))

Buggy submission (verdict: Runtime Error):
def ops_needed(x, target):
    if abs(target - x) < abs(x):
        return 0
    else:
        return target - x

def count_ops(a):
    total_ops = 0
    accum = a[0]
    for i in range(1, len(a)):
        new_accum = accum + a[i]
        if new_accum == 0:
            ops =  -1 * (accum / abs(accum))
        else:
            ops = ops_needed(new_accum, -1 * (accum / abs(accum)))
        total_ops += abs(ops)
        accum = new_accum + ops
    return int(total_ops)
        

if __name__ == '__main__':
    _ = int(input())
    a = list(map(int, input().split()))
    print(count_ops(a))

Buggy submission (verdict: Runtime Error):
def count_ops(a):
    if a[0] == 0:
        total_ops = 1
        if a[1] < 0:
            accum = 1
        else:
            accum = -1
    else:
        total_ops = 0
        accum = a[0]
    for i in range(1, len(a)):
        new_accum = accum + a[i]
        if (accum > 0 and new_accum > 0):
            ops = ops_needed(new_accum, -1)
        elif (accum > 0 and new_accum == 0):
            ops = -1
        elif (accum < 0 and new_accum < 0):
            ops = ops_needed(new_accum, 1)
        elif (accum < 0 and new_accum == 0):
            ops = 1
        else:
            ops = 0
        total_ops += abs(ops)
        accum = new_accum + ops
    return total_ops
        

if __name__ == '__main__':
    _ = int(input())
    a = list(map(int, input().split()))
    print(count_ops(a))
Problem p03852 (python)

Fixed submission:
print('vowel') if input() in 'aeiou' else print('consonant')

Buggy submission (verdict: Runtime Error):
rint('vowel') if input() in 'aeiouAEIOU' else print('consonant')
Problem p04012 (python)

Fixed submission:
from collections import Counter

word = input()
c = Counter(word)
counts = c.values()
print('Yes') if all(map(lambda x: x % 2 == 0, counts)) else print('No')

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

word = input()
c = Counter(word)
counts = c.values()
if all(map(lambda x: x % 2 == 0, counts)) print('Yes') else print('No')
Problem p03288 (python)

Fixed submission:
n=eval(input())
if n<1200:
	print("ABC")
elif n>=1200 and n<2800:
	print("ARC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):
n=eval(input())
if n<1200:
	print("ABC")
elif n>=1200 and n<2800:
	print("ARC")
else:
    peint("AGC")
Problem p03288 (python)

Fixed submission:
R = int(input())
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Buggy submission (verdict: Runtime Error):
S = input()
n = len(S)
for m in range (3, n):
    if S[m-1] == C:
        Count_C = Count_C + 1
        S[m-1].lower()
if S[1] == A:
    Count_A = 1
    S[1].lower()
if(Count_C == 1 and Count_A == 1 and S.islower()):
    print('AC')
else:
    print('WA')
Problem p03370 (python)

Fixed submission:

N,X=map(int,input().split())
m=[]
for i in range(N):
    mix=int(input())
    m.append(mix)
lowest=sum(m)
X=X-lowest
minimum=min(m)
ans=N
while X>=minimum:
    ans+=1
    X=X-minimum
print(ans)

Buggy submission (verdict: Runtime Error):

N,X=map(int,input().split())
m=[]
for i in range(N):
    mix=int(input())
    m.append(mix)
lowest=sum(m)
X=X-lowest
def dp(rm,num):
    if rm<m[num]:return 0
    
    if num<N-1:
        return max(1+dp(rm-m[num],num),dp(rm,num+1))
    else :
        return 1+dp(rm-m[num],num)
print(dp(X,0)+N)

Buggy submission (verdict: Runtime Error):

N,X=map(int,input().split())
m=[]
for i in range(N):
    mix=int(input())
    m.append(mix)
lowest=sum(m)
X=X-lowest
def dp(rm,num):
    if rm<m[num]:return 0
    
    elif num<N-1:
        return max(1+dp(rm-m[num],num),dp(rm,num+1))
    else :return 1+dp(rm-m[num],num)
print(dp(X,0)+N)